Reverse PIR Logic

Discussion in 'General Discussion' started by impact, Mar 8, 2010.

  1. impact

    impact

    Joined:
    Feb 10, 2008
    Messages:
    117
    Likes Received:
    13
    Hints on how you would tackle this... I call it the reverse PIR conundrum.

    Background - Built the new house and had cbus installed, mainly wanted one button to turn all lights off when leaving, and I love the ramp off... But since that initial love, many extra other things have been added. After moving in - thinking of more to do...

    What annoys me the most is the kids - leaving lights on, and leaving the room. I hate walking upstairs seeing a bedroom light on, where it was probably bright enough without it, but no kids in sight, and knowing they aint been there for the last hour.....

    So how would you tackle occupancy of a room, and turnng a light off if nobody was in the room for a period of time.

    It cant be just a 360 PIR - as I dont want the PIR to turn on a light, sometimes you walk into a room to do something and dont need the light on, the sensor doesnt need to sense someone in the room at night (pitch black) and senses someone rolling over in their sleep to turn a light on - that would be silly.

    So, only if a light was on, the sensor detects no one in the room for 5 minutes and then turns the light off. It needs to do this in daylight or darkness (well in darkness the light would be on - so it would never truely be in darkness - I mean during the day or night if the light was on).

    On a 5753L I guess Motion in Light is a clue, or Any Motion (but that may flood network), and guessing the PIR would need the sensor turned all the way to the left (daylight)...

    I'd start playing with some logic - have a pac and touch screen - but before I started experimenting with the unkown - thought I'd ask for words of wisdom - as there may be a simpler way of doing it ?

    Thanks
     
    impact, Mar 8, 2010
    #1
  2. impact

    mmd

    Joined:
    Jan 30, 2006
    Messages:
    42
    Likes Received:
    0
    Location:
    Melbourne
    If you don't need the sensor to turn the light on then its very simple. Set the sensor to turn a separate (phantom if you like) group address on and off. Use normal Day movement and just adjust the pot on the sensor to give you functioning for both day and night, leave the other parts of the sensor programming well alone.

    Then in your logic (and you may even be able to do this in the relay logic if you care to muck around) you simply say (NB this is pseudo code, not actual PAC code)

    if phantomLight = off then actualLight = off

    Michael
     
    mmd, Mar 8, 2010
    #2
  3. impact

    impact

    Joined:
    Feb 10, 2008
    Messages:
    117
    Likes Received:
    13
    Michael thanks...

    Its kind of what I thought to do - but you described it so simply and elegantly compared to my mind....

    I wont muck around with relay logic - and go straight to the pac... as I know I will want to make it more complex...

    ie. Eventually when I get my holiday program working I will want to overide this functionality, as my random on for 30 mins or whatever would just get turned off, because there is nobody home in the room (lol)

    I am wondering and will have to play with it - but if you disable a sensor via group overide thing - does that mean the red light will not shine ?? It would be nice at night when the light is off (sleep) that the red light does not go on with every movement, sending off commands to the network that are not needed. ie. I could enable the PIR when the light is on, disable the PIR when the light is off...

    And I will need to do a little housekeeping logic I guess... If you leave the room and the light is on, return to the room before I kill the light, I would not want to kill light anymore... Will need to check out re-triggering and if I dont like it the way cbus works, write some code around it to suit my purpose.

    Its all good fun (and great people here to bounce ideas/thoughts)
     
    impact, Mar 8, 2010
    #3
  4. impact

    mattyb

    Joined:
    Jul 29, 2005
    Messages:
    78
    Likes Received:
    0
    Location:
    Sydney, Australia
    G'day

    You could achieve what you want without using the PAC. You just need to change the "key functions" for the PIR so the sensor is always using the default "motion in day" response for both light and dark conditions (ML & MD) ie.

    Short Press - Retrigger Timer
    Short Release - Idle
    Long Press - Idle
    Long Release - Idle

    In the "Blocks" your Timer Expiry is Off Key or Ramp Off.

    Cheers

    Matt
     
    mattyb, Mar 8, 2010
    #4
  5. impact

    mmd

    Joined:
    Jan 30, 2006
    Messages:
    42
    Likes Received:
    0
    Location:
    Melbourne
    If you disable a sensor then yes the red light does not display.

    mattyb's suggestion (a better one than mine as its a lot simpler) is probably still ok for doing that. If I read what he is suggesting correctly he is getting the sensor to retrigger on movement, turn off after timeout, but not turn the light on initially.

    As such if you set your light group address to "enable" in the sensor (not disable), then when the light is on, the sensor will turn it off after 5 minutes (or whatever). When you re-enter the room the sensor should start counting again and won't shut the light down until you leave.

    Having said that a sensor can't disable itself so not sure what happens when it shuts the light (and hence its enable group address) off.

    To properly disable under that circumstance I suspect you would have to turn the light on and off again to get it to kill the sensor.

    Can someone confirm this? I'm usually spoilt with a full touchscreen to do all the logic I want so I don't play with this stuff much.

    If you are using the pac then you can just use another group address for the enable disable component that says

    if actualLight =100% then sensorEnable=100%
    if actualLight =0% then sensorEnable=0%

    This way the sensor is not talking directly to its enable/disable group address so it should still shut it down and start up again when the light turns on.
     
    mmd, Mar 8, 2010
    #5
  6. impact

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,151
    Likes Received:
    17
    My kids do exactly the same. It is day time, they are too lazy to open the curtains and they don't turn lights off.

    I use an external PIR to set a phantom group to indicate daytime. This group, using relay logic prevents the lights from being turned on. This is their punishment for being lazy.

    It can be over-ridden by a single button (placed elsewhere - eg touchscreen) so that if the light is needed they can turn it on.

    If they start to do that too often and leave the light on, the next step is to use a timer. Bad luck to them if it goes out on them, again, its their punishment.

    Once they show that they can turn a light off, the rules will be relaxed.

    One comment, it seems that everyone is so quick to use a PAC these days. There is still a lot that can be done without one and I find it is more satisfying to achieve the level of functionality without the use of code in a PAC.

    Gotta love C-Bus as an aid for parental control.

    Mick
     
    znelbok, Mar 9, 2010
    #6
  7. impact

    mattyb

    Joined:
    Jul 29, 2005
    Messages:
    78
    Likes Received:
    0
    Location:
    Sydney, Australia
    Generally (and I think by default) the indicator in the PIR is set to follow the group address that it is controlling e.g 'Bedroom Lights'.

    It will only be on/flashing if the 'Bedroom Lights' GA is on i.e the actual bedroom lights are on!

    If the sensor is configured as I described and you've switched off the lights and gone to bed, the sensor will just keep retriggering the timer when you roll over - the indicator inside the sensor won't turn on 'cause the GA is not turning on.

    If it's only the indicator that you're concerned about, you don't even need to worry about all the disabling stuff.

    Cheers

    Matt

    Oh, and if you leave the room and re-enter before the lights turn off the sensor will just re-trigger the timer.
     
    Last edited by a moderator: Mar 9, 2010
    mattyb, Mar 9, 2010
    #7
  8. impact

    Ashley W

    Joined:
    Aug 4, 2004
    Messages:
    304
    Likes Received:
    3
    Location:
    Canberra
    After a PIR is set-up why even bother having the LED function? I always disable them once I know it is working properly.

    This is especially important for security systems. The number of places I see where security PIR's flash away all day really makes me wonder sometimes.
     
    Ashley W, Mar 9, 2010
    #8
  9. impact

    RossW

    Joined:
    Oct 10, 2005
    Messages:
    118
    Likes Received:
    0
    Sometimes, there's method to the madness.

    I used to install some with their lights enabled purely to catch peoples attention. Call them "decoys" if you like. People see those ones and think they've got it covered. Once they see the visible ones, they tend not to look for the less obvious ones. At least, thats been my experience. :)
     
    RossW, Mar 9, 2010
    #9
  10. impact

    Ashley W

    Joined:
    Aug 4, 2004
    Messages:
    304
    Likes Received:
    3
    Location:
    Canberra
    Yep that sounds like a good reason.
     
    Ashley W, Mar 10, 2010
    #10
  11. impact

    mmd

    Joined:
    Jan 30, 2006
    Messages:
    42
    Likes Received:
    0
    Location:
    Melbourne
    True for security.

    If however its for lighting use and its a clients home, I would strongly suggest you leave them on as it lets the client know its "working", even when the light doesn't come on.

    That way you can safely say its a globe thats gone, not the cbus that's not working, because 99.99% of end users will assume the latter rather than just checking the globe like they would if a convetional device didn't turn on.
     
    mmd, Mar 10, 2010
    #11
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.