I know I could write a webcore app to do what I wanted but really want to understand if rule machine or lighting app would have a simple option.
I have a rec room light, I have a virtual switch that will turn on momentarily each time a wyze cam has a motion trigger. How do I turn off the lights if the lights are turned on and there is no motion for 60 mins
In the RM, it implies it needs to see change (motion turns off) before counting to 60 ... if I turn on the light but don't trigger the motion sensor i dont think it will turn off.. was no motion in the last 60 mins (even if it didnt detect motion in the last 2 hours)
.
In room lighting, I don't see anything close to what I need
so call me paranoid...but i feel like I have the potential for lights to be left on with the above solutions... since I can turn on the light at the wall, and possibly not trip the motion sensor
in webcore, I would store the last_motion_timestamp and the light_on_timestamp
and then every 20 mins
I would check if (now-last_motion_timestamp > 60) AND (now-light_on_timestamp > 60) and then turn off the light.
so in these simpler apps....is there a test for
Lights on > x
MotionSensors off > y ?
And can i combine them into a test?
I appreciate the earlier response...but trying to learn the capabilities.
In Room Lighting, you need both the motion sensor and the switch itself to be Means to Activate. This way, if the switch is manually turned on, Room Lighting will still take over. Additionally, you want Activate even if partially activated in the options (you'll need it for later). In the Means to Turn Off, I have put three options: (1) Motion sensor inactive and stay, (2) manually turning off the switch, and (3) Elapsed Time. The latter is what you want. Basically, 60 minutes from the last Activation Event will turn off the switch. With the Activate option selected, every time the motion sensor goes active, it will reset the countdown.
Again, you need to put both the motion sensor and the switch itself as the triggers. In this example, you'll hit the switch with a second on command if it was manually turned on, but that won't hurt the rule. You could also adjust this action to be "command switches only if off" if that is desired. However, it's the wait for events that is key. I put the same three options as from Room Lighting, but it is the timeout that is the counter you want. Basically, it says that if neither of the other two go true (motion inactive or manually turning off the switch), the timeout will progress the rule after 60 minutes. With this design, every time the motion sensor goes active, it will reset the wait and thus the counter.