I want to use the motion light example if someone (usually me) is in the basement during the weekend. I have setup a binary_switch (PIR Sensor) that is working and have it controlled with an appdaemon app based on the motion_lights example.
My question is in addition to just checking the motion sensor I would like to build in some logic around keeping the switch on for some amount of time. Checking something like every 15 mins to see if motion has been detected in that time and I am thinking reset a timer?
I see a line in the code: self.cancel_timer(self.handle), but I am not sure what that does exactly.
It’s to handle retriggers - if motion is detected while the timer is ticking. It will be cancelled and the timer will be restarted for the full amount of time.
@smolz – This sounds exactly like what I’m wanting to do for my home office LIFX bulbs. If you get this working can you please share the config? Thank you!
@brianjking do you have appdaemon installed?
and do you have the motion light app (from the examples) copied to your app dir?
then follow the instructions that are at the top off the app and use a delay from 900
@ReneTode – No, I do not yet have AppDaemon installed. I just re-did my install about two weeks ago to start fresh and plan to add my Z-Wave USB Z-Stick in the next day or two and the motion sensor as I never had these on my prior (initial) setup with Home Assistant.
I have appdaemon and HA in the same virtualenv, but now I know how it works, I would create a separate virtualenv for each.
I can see there could be a situation where I would do not want to upgrade one or the other, which means they could be dependent on different versions of libraries.