Page 1 of 1

Occupancy for lighting

PostPosted: Sat Dec 29, 2018 12:56 pm
by peszko
I have lights turn on and off based on several sensors. To do this, I have plenty of triggers, variables and conditions setup. This is very error prone, difficult to maintain and replicate. I'm sure there has to be a better way like a plugin.

So, example. I have a garage that I want to light up when things are happening in it. I have one occupancy sensor, one DSC (alarm) motion sensor, main door (dsc), side door (dsc) and the door to the house (dsc). All DSC sensor are instantaneous so motion turns on and off immediately. What I want is the light to come on if any of the doors are opened, or if any of the motion sensor are tripped. I want the light to go off, several minutes after the last sensor reported. So if not doors were opened or closed and no motion detected for several minutes the lights go off. As soon as any of them report then lights go on. (BTW virtual devices don't seem to support DSC plugin sensors)

I have this done using variables and triggers, but this requires 6 status variables plus virtual occupancy variable plus timing variables, 12 triggers (two per device for on and off plus two for final virtual occupancy on and off to actually turn the lights on/off)

I went to edit this today to add one more sensor and after a bit of fiddling, I decided that there has to be a better way.

Hope somebody has a suggestion on how best to do this, or possibly a plugin that does most of the nitty gritty.

Re: Occupancy for lighting

PostPosted: Sat Dec 29, 2018 4:38 pm
by jay (support)
peszko wrote:
(BTW virtual devices don't seem to support DSC plugin sensors)


Yeah, the DSC plugin predates some of the API functionality that the Device Group virtual device needs. There are other group/scene type devices in the Plugin Store that may help however.

Re: Occupancy for lighting

PostPosted: Sat Dec 29, 2018 4:56 pm
by jay (support)
Have you checked out the Alarm Zone Group device type in the DSC plugin? It may be what you're looking for.

Re: Occupancy for lighting

PostPosted: Sat Dec 29, 2018 4:56 pm
by siclark
I use the group trigger to do the same using any one of multiple alarm PIRs to trigger. That turns on lights then triggers, or restarts if already running, a timed devices timer(can't remember which one) that when runs out, turns off the lights. So if door is opened when lights about to go off, it restarts the timer to give another 5 mins.
Should hopefully make your setup easier. Also thinking about it, look at the EPS extensions for device that gives time since last tripped. Could also be used in a schedule? Ie check every minute all relevant ones are greater than 5 mins then turn off lights.
That's one group trigger to turn on lights, one EPS extension device per PIR to track time since activation and one schedule to to turn them off?


Sent from my iPhone using Tapatalk

Re: Occupancy for lighting

PostPosted: Sat Dec 29, 2018 7:50 pm
by peszko
jay (support) wrote:
Have you checked out the Alarm Zone Group device type in the DSC plugin? It may be what you're looking for.


I haven't considered this one. I'll investigate it a bit.

Re: Occupancy for lighting

PostPosted: Sat Dec 29, 2018 7:57 pm
by peszko
siclark wrote:
I use the group trigger to do the same using any one of multiple alarm PIRs to trigger.


Yes, this looks like a good idea. I rewrote my garage problem using this, and indeed this simplified things. I'll let it run for couple days to see if everything works correctly. I'd still wish for a plugin, that could do it all. Something like a virtual occupancy device that takes other devices and variables as inputs, has setting for what constitutes on or off, how much time to wait etc... I may have to bite the bullet and write one.

Re: Occupancy for lighting

PostPosted: Sun Dec 30, 2018 2:04 pm
by peszko
Sure enough, I turned off notifications when I updated the logic. I have to fix that. But that brings a question regarding triggers and actions. Is there a significant performance penalty in having multiple triggers with one action as opposed to one trigger with multiple actions?