Anyways to delay the retriggering of a PIR?

Discussion in 'C-Bus Toolkit and C-Gate Software' started by hh75, Feb 11, 2009.

  1. hh75

    hh75

    Joined:
    Jan 18, 2009
    Messages:
    11
    Likes Received:
    0
    Hi,

    I have a PIR in a walkthru wardrobe just outside the adjoining bathroom door.

    I want the PIR to turn on a bathroom light at night provided that bathroom light isn't already on. I know how to do this either with the PIR disable or using a logic group. However say I turn off the bathroom light manually and then want to walk back under the PIR is there anyway to have the PIR not retrigger the bathroom light for a delay period (so I can get out of the way before the PIR simply turns the bathroom light back on)?
     
    hh75, Feb 11, 2009
    #1
  2. hh75

    hh75

    Joined:
    Jan 18, 2009
    Messages:
    11
    Likes Received:
    0
    Someone just messaged me to try this:

    "If it's a 1 or 2 key unit (5031 / 5032 etc) use one of the spare blocks and its timer to enable a group for PIR enable / disable."

    I do have spare blocks and have enabled a separate logic PIR enable/disable group. I have the bathroom light (which is DSI dimmed BTW) and the PIR enable/disable group on the same key using blocks. Problem is as soon as I turn off the bathroom light manually that turns off the PIR disable and the PIR triggers as I walk past it. What I'd like to have happen is that when I press the bathroom light key as I leave the room, it both turns off the bathroom light but leave the PIR disable running for another 5-10 seconds. Is this possible (without using a second key or a logic PAC/touchscreen)?
     
    hh75, Feb 12, 2009
    #2
  3. hh75

    hh75

    Joined:
    Jan 18, 2009
    Messages:
    11
    Likes Received:
    0
    Hi - lots of people viewing but no suggestions so i have made a little diagram of what I'm trying to do so hopefully a cbus expert can help me?
     

    Attached Files:

    hh75, Feb 16, 2009
    #3
  4. hh75

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,151
    Likes Received:
    17
    I have been asked the same question - when you turn off the light the PIR turns the light back on as it sees you exit the room.

    I think the answer is to put a timer on the disable group, but how to do that and turn the light off a the same time is what I have not tried to do.

    To break it down more

    Turn light off (toggle) also turns on group 'PIR disable' for 30 seconds
    This in turn disables the PIR (as expected) until the timer expires and the disable is removed.
    This allows the person to exit the room.

    Try this (no guarantee's as I am not aboe to try it out and confirm it)
    if you set the button up as an on/off an then add a retrigger timer to the long press (on the key functions tab).
    On the blocks tab add the disable group to an un-usedblock and tie this to the key used for the on off.
    Set the timer to 30 seconds for this group and leave the other at 0 sec.

    Hopefully when you leave the room, you long press the key, the light will go off and probably back on and then off again (0sec timer - you may need to make this 1 sec depending on results) and the disable group will be active for 30 second.

    Mick
     
    znelbok, Feb 17, 2009
    #4
  5. hh75

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    IF you have a dedicated On and Off button on the Reflection switch for the DSI Fluoro in the bathroom you can do it like this.

    On the PIR UI:

    • Assign a Group Address as the Sensor Enable/Disable group
    • Select the 'Enables' radio button. When this group address is turned on, the PIR will be enabled.

    For the Reflections switch:

    • Assign the first key to the DSI Fluoro group address.
    • Go to the Key Functions tab and program the first key as the On Key, Idle, Idle, Idle for the Short Press, Short Release, Long Press and Long Release functions.
    • Program the second key as Off Key, Start, Start, Idle for the 4 key functions.
    • Go to the Blocks tab.
    • Make sure the timer for the DSI Fluoro group address is set to zero.
    • Assign the PIR Enable/Disable group to an unused block.
    • Make sure that the PIR Enable/Disable Recall1 value is set to 100%.
    • Set the block timer for the PIR Enable/Disable group to 10 seconds.
    • Set the Expiry command for the PIR Enable/Disable group to Recall1.
    • For the first key make sure that there is a single tick in the 'Keys Using Block' column that links the first key to the DSI Fluoro group address.
    • For the second key column put a tick in the box that links the key to the DSI Fluoro group and put a second tick in the box that links the key to the PIR Enable/Disable group address.
    The way this works is like this:
    When you walk into the room the PIR should detect you coming in and turn on the DSI Fluoro light. If, for some reason, it doesn't, you can press the first key and it will send an On command to the DSI Fluoro light.

    When you leave the room and press the second key on the Reflection switch several things will happen:

    1. The DSI Fluoro group address will turn off
    2. The PIR Enable/Disable group address will turn off, disabling the PIR
    3. A timer will start running in the Reflection switch to turn On the PIR Enable/Disable group address after 10 seconds
    When the 10 second timer expires, the PIR Enable/Disable group address will turn back on, re-enabling the PIR.

    Let us know how you go.
     
    Newman, Feb 17, 2009
    #5
  6. hh75

    hh75

    Joined:
    Jan 18, 2009
    Messages:
    11
    Likes Received:
    0
    Thank you both for trying to help a noob.

    These ideas are very useful but I suspect that it might not be possible to do what I want to with the following constraints?

    1. When I pass the PIR and bathroom light is already on I don't want the PIR to do anything - I have been achieving this by assigning bathroom light group to the PIR disable

    2. When I pass the PIR and bathroom light isn't on yet I want the light going to a low level - I have been achieving this by using a Recall1 at 5% for the bathroom light group on the PIR blocks tab

    3. I still want to be able to dim the DSI bathroom light up and down as required.

    4. I'd like to be able to do this all with one button on the reflections switch !

    5. When I manually turn off the bathroom light and exit the room I'd like the PIR to stay disabled for 10 seconds

    Having the bathroom group as the PIR disable group seems to allow for all of this EXCEPT item 5.

    I've tried using a separate logic group called PIR disable which I have selected as the PIR disable group and which is activated by either the PIR itself or by sharing a block with the light switch on the reflections pad. i.e. when I manually press the light switch it starts a 10 sec timer turning the PIR disable group on. The problem is that the system doesn't know when I am pressing the switch whether I want to leave the room or am just adjusting the dimmer up/down. In the later case I want the PIR to stay disabled until I finally exit the room.

    Clear as mud I guess but strikes me this is very much a bathroom fan run on problem with the added complication that it is a dimmer not a relay?!
     
    hh75, Feb 17, 2009
    #6
  7. hh75

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    I can't think of a way to do what you want using the PIR and Reflections unit alone.

    Requiring different decisions to be made regarding your presence in the room... yet still retaining the dimmer functionality... and all from 1 button... these units can't do all that on their own. They need some 'outside help'.

    I suggest you save yourself a great deal of time and effort and just buy a PAC. It's the cheapest product CIS sell that includes the logic engine (the others are the Colour C-Touch and it is optional on the B&W C-Touch MKII). Once you've got one, you'll find all kinds of useful things to do with it, like automatically changing the maximum brightness setting of your hallway and bathroom lights after certain hours, keeping common lighitng areas turned on when certain rooms are occupied, a big bucket of scenes for things like "welcome home" or "goodnight", RS-232 control of your A/V gear, automatically updating the time on your DLT's for daylight saving, etc.
     
    Newman, Feb 17, 2009
    #7
  8. hh75

    hh75

    Joined:
    Jan 18, 2009
    Messages:
    11
    Likes Received:
    0
    Hi first a big thanks to those who replied and got me thinking how it could be done. I think I have cracked it with your help.

    The attachments show the config of the DSI dimmer pak, the PIR and the 4-way reflection switch.

    I defined a group PIR trigger which the sensor unit ramp recalls to 5% so that I can bring the DSI fluro to 5% when I walk into the bathroom. I also set the PIR enable/disable to a group called PIR disable delay. Basically this group is on also most all the time enabling the PIR. The magic comes when we manipulate this group later.

    I also used PIR Trigger as a logic group Maxed with channel 6 (he bathroom fluro)of the DSI pak. This means that if the bathroom fluro is already on at 5% or higher the PIR trigger has no effect - useful becuase you don't want someone walking past the pir outside the bathroom dimming the bathroom light if you are happily in it.

    Using only the 1st key of the reflection switch as shown I can happily dim up/down long pushing. But when I short push/release the PIR trigger and bathroom light are turned off so the bathroom light actually goes off, but the PIR disable delay group also goes OFF turning off the PIR so it doesn't retrigger when I walk past it...then after 15 seconds the timer expires and we use Recall1 to bring it back to 100% so the PIR is re-enabled.

    Problem solved - so far as I can tell so far ;-)
     

    Attached Files:

    hh75, Feb 18, 2009
    #8
  9. hh75

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    One minor point. With the way you've programmed the 1st key of the Reflection unit I'd expect that the light level would drop to 5% every time you press the key and it would then start dimming upwards (if held down). If you swap the Short Press and Short Release key functions on key 1 you might solve that problem.
     
    Newman, Feb 18, 2009
    #9
  10. hh75

    hh75

    Joined:
    Jan 18, 2009
    Messages:
    11
    Likes Received:
    0
    Hi, thanks for the pointer. I was finally able to test it out. I switched the short press & release around and while it made the dimming work more normally, it prevented the PIR from retriggering after the delay so no dice. So my original workflow will have to stand until someone come come up with a better (no logic engine) solution. Anyway up for the challenge ;-)
     
    hh75, Mar 1, 2009
    #10
  11. hh75

    ssaunders

    Joined:
    Dec 17, 2008
    Messages:
    232
    Likes Received:
    31
    Location:
    Melbourne
    How I did a PIR with exit delay

    As a footnote to Newman's post about using a PAC, and in case someone else finds the approach useful, here is how I have accomplished a PIR delay with Pascal logic after I got the idea to do so from this thread. I know it doesn't answer the challenge of doing it without logic, but it does provide a nice solution.

    The PIR is set to pulse the "Bedroom 2 PIR_1 Trigger Night" group, and be disabled with "Bedroom 2 PIR_1 Disable". There are two keys on the switch: One as a memory dimmer, and the second to disable the PIR operation by sending "Bedroom 2 PIR_1 Disable" to on/off using a toggle. The disable group is also set on a schedule to automatically disable around bed time, and re-enable well after wake up time.

    - Code recovers operation gracefully after a logic re-start
    - PIR triggers while the lights are on will re-trigger the timer
    - Light can be dimmed up or down from the PIR activation level of 70%, which will prevent expiry of the timer from turning off the lights
    - If the lights are on at a level other than precisely 70%, the PIR trigger will not alter the level back to 70%
    - When the light is switched off using the switch, the PIR is disabled for 15 seconds to enable exit
    - When the timer expiry turns off the lights, the PIR is not disabled
    - Other buttons in the house (like beside the adults' bed) could also pulse the "Bedroom 2 PIR_1 Trigger Night" group, effectively waking up the kids ;)
    - Successfully field tested on the kids.

    I also have a similar set up in a hall, with dual light levels depending on day or night triggering. Hope it's of use to someone.

    Code:
    {Enter Constant definitions here}
    
    Bedroom2Timer1 = 2;
    Bedroom2Timer1Runtime = "0:03:00";
    Bedroom2PIRDisableDuration = "0:00:15";
    Bedroom2PIRSet = 178; {70%}
    
    {Enter Variable definitions here}
    
    Bedroom2PIRLevel : Integer;
    Bedroom2Timer1Expired : Boolean;
    Bedroom2RampingOff : Boolean;
    
    {Enter Initialisation code here}
    
    Bedroom2Timer1Expired := False;
    Bedroom2RampingOff := False;
    
    if GetLightingLevel("Bedroom 2 Pendant") = Bedroom2PIRSet then
    begin
      Bedroom2PIRLevel := Bedroom2PIRSet;
      TimerStart(Bedroom2Timer1);
    end;
    
    {Module code}
    
    once GetLightingState("Bedroom 2 Pendant") = OFF then
    begin
      if (not Bedroom2Timer1Expired) and (GetLightingState("Bedroom 2 PIR_1 Disable") = OFF) then
      begin
        TimerStop(Bedroom2Timer1);
        PulseCBusLevel("Local Network", "Lighting", "Bedroom 2 PIR_1 Disable", 100%, 0, Bedroom2PIRDisableDuration, 0%);
      end;
      Bedroom2Timer1Expired := False;
      Bedroom2RampingOff := False;
    end;
    
    once GetLightingState("Bedroom 2 PIR_1 Trigger Night") = ON then
    begin
      if TimerRunning(Bedroom2Timer1) then
      begin
        TimerStart(Bedroom2Timer1);
      end
      else
      if (GetLightingState("Bedroom 2 Pendant") = OFF) or Bedroom2RampingOff then
      begin
        SetLightingLevel("Bedroom 2 Pendant", Bedroom2PIRSet, "1s");
        Bedroom2PIRLevel := Bedroom2PIRSet;
        TimerStart(Bedroom2Timer1);
        Bedroom2Timer1Expired := False;
        Bedroom2RampingOff := False;
      end
    end;
    
    once TimerTime(Bedroom2Timer1) = Bedroom2Timer1Runtime then
    begin
      if GetLightingLevel("Bedroom 2 Pendant") = Bedroom2PIRLevel then
      begin
        SetLightingLevel("Bedroom 2 Pendant", 0%, "12s");
        Bedroom2RampingOff := True;
      end;
      TimerStop(Bedroom2Timer1);
      Bedroom2Timer1Expired := True;
    end;
    
     
    Last edited by a moderator: Mar 18, 2009
    ssaunders, Mar 18, 2009
    #11
  12. hh75

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Nice work there! Hopefully this saves a few others from some head-scratching.
     
    Newman, Mar 19, 2009
    #12
  13. hh75

    cheekymonkey

    Joined:
    Mar 10, 2013
    Messages:
    19
    Likes Received:
    1
    Location:
    Perth, WA
    Thanks heaps ssaunders cause I couldnt get the stuff written in the applications notes to work with my 5751L
     
    cheekymonkey, Dec 16, 2021
    #13
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.