PIR in PAC logic?

Discussion in 'C-Bus Automation Controllers' started by Tension, May 2, 2026.

  1. Tension

    Tension

    Joined:
    Apr 30, 2015
    Messages:
    179
    Likes Received:
    6
    Location:
    Belfast
    Hi.

    I am trying to get my PIR sensor to light my front exterior lights at 30% at sunset and then go to 100% for 3 minutes if motion is detected, then back down to 30%. Then on sunrise they will turn off.

    I'm only starting out programming logic and the Wizard doesn't seem to let me do what I need.

    Is it possible to do this in logic somehow that I can program in PICED then transfer to my PAC?

    Thanks :)
     
    Tension, May 2, 2026
    #1
  2. Tension

    oracle

    Joined:
    Jan 18, 2010
    Messages:
    125
    Likes Received:
    11
    Location:
    NSW
    if you want to use the logic in the pac something like this is rough n ready

    Code:
    {sunset logic}
    once (Time = Sunset) then
    begin
      isDark := true;
      SetLightingLevel("Garage", 30%, "4s");
    end;
    
    once (Time = Sunrise) then
    begin
      isDark := false;
      SetLightingLevel("Garage", 0%, "4s");
    end;
    
    { PIR Logic}
    once (GetLightingState("garage pir?") = ON) and (isDark = true) then
    begin
      PulseCBusLevel("local", "Lighting", "Garage", 100%, "4s", "0:03:00", 30%);
    end;
    
    in global variables declare "isdark" as boolean, change garage address to your cbus tag address, make the pir a group address only triggering this code not directly linked to the dimmer example here "garage pir" you could do this otherways and in the wizard aswell.
     
    oracle, May 2, 2026
    #2
    Tension likes this.
  3. Tension

    Tension

    Joined:
    Apr 30, 2015
    Messages:
    179
    Likes Received:
    6
    Location:
    Belfast
    That's brilliant, thank you for that. Is there a way to do it without making the dummy group?
     
    Tension, May 2, 2026
    #3
  4. Tension

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,647
    Likes Received:
    219
    Location:
    Adelaide, Australia
    You can actually do this in the pir without any logic.
    Open the pir and in the ss (sunset to sunrise) box select the light ga.
    On the functions tab for short press ss select Recall 1 and OK the warning
    On the blocks tab on the row for your group change the recall 1 value to 30%
    That's the all night bit done.
    Under motion in light click the plus and create a new group called say "garage movement"
    OK the sensor dialog to close it
    Open the dimmer controlling the light and go to the logic tab
    On the first line select the "garage movement" ga you just created.
    Click the channel box number the light is connected to and under that column select the max option.

    Now between sunset the sunrise the light will be at 30%
    If during that time the sensor is triggered, the "garage movement" ga will go to 100% and the logic in the dimmer selects the max of the 2 ga's which will set the light to 100% until the timer expires when it will go back to 30%.
     
    Ashley, May 3, 2026
    #4
    oracle likes this.
  5. Tension

    oracle

    Joined:
    Jan 18, 2010
    Messages:
    125
    Likes Received:
    11
    Location:
    NSW
    Yes but more convoluted - make sure you set the trigger time in sensor to less then the logic time in the pac.
    I think the above is better, lbut you could leave everything on the sensor setup 1 group on for 3 mins then off as normal then try this clunky style less elegant operation - use the once rather than if for less potential looping also this will turn on light at sunset to 30% sensor will operate to 100% like normal and expiry set to ramp recall and leave the block at 0% at this point the light will have a sort of jump from sensor going off or below 30% to get set back to 30% by PAC there is no disable enable in the sensor you can use sensor internal logic it just means that at some points the sensor will go 100-0 outside of sunset-sunrise
    Code:
      {sunset logic}
    once (Time = Sunset) then
    begin
      isDark := true;
      SetLightingLevel("your outside light", 30%, "4s");
    end;
    
    once (Time = Sunrise) then
    begin
      isDark := false;
      SetLightingLevel("your outside light", 0%, "4s");
    end;
    
    { PIR Logic}
    once (GetLightingLevel("your outside light") < 30%) and (isDark = true) then
    begin
      SetLightingLevel("your outside light", 30%, "4s");
    end;
     
    oracle, May 3, 2026
    #5
  6. Tension

    oracle

    Joined:
    Jan 18, 2010
    Messages:
    125
    Likes Received:
    11
    Location:
    NSW
    yeah thats what i would probably do but he said he wanted in logic engine just assumed he was just wanting to play with the pac.
     
    oracle, May 3, 2026
    #6
  7. Tension

    Tension

    Joined:
    Apr 30, 2015
    Messages:
    179
    Likes Received:
    6
    Location:
    Belfast
    Thanks for the suggestions guys! :)

    Is there a way to make the lights ramp up and down gradually when movement is detected using the internal PIR settings, or do I need logic for that
     
    Tension, May 3, 2026
    #7
  8. Tension

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,647
    Likes Received:
    219
    Location:
    Adelaide, Australia
    Just change the Recall 1 to Ramp Recall 1 and the Off the ramp Off.
     
    Ashley, May 4, 2026
    #8
    Tension likes this.
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.