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.
OK, so there is a subtle different when it comes to switches and motion sensors... I have virtual switches that try and reflect motion
They are wyze camera's that with IFTTT turns on a virtual switch..
The problem ( I think) is that the rule machine wait event says TURNS OFF and stays that way ... which I'm assuming requires that switch to change from OFF to ON
this is different from the motion sensor which doesn't seem to require a change
I JUST want it to turn off with no motion for 15 mins (not requiring motion)
Is that correct? Is there a workaround?
In your last post here, are you talking about the vitual switch you referred to in your original post?
In that original post (if I understood it correctly), you used the term "momentarily" to describe that virtual switch's actions -- is that virtual switch set up as a momentary switch?
But my assumptions on the motion sensor were incorrect....
while it SAYS motion inactive and stays that way ....THAT DOES NOT WORK
it has to see motion active-> motion inactive and stay that way for x time
ARG...
Edit - deleted my original post here... Thinking about this more, I don't think the fact that it's a momentary switch should a big deal with respect to a "...and stays" caveat, I suppose the concept should still work OK. Apologies for the misdirection.
Yes. Under the options for โWait for Eventsโ you want Elapsed Time. Set that for 15 minutes and have it be the only option. Basically, the rule will wait for 15 minutes before progressing. If the rule is retriggered, the wait will reset.
On the motion sensor example...I missed something critical that was in @JB10 's answer ...which is the timeout setting... I totally missed that...
when I added that ..it did not need to see the active to inactive transition
the virtual motion (switch) works just fine after adding the timeout option to the wait
thanks again @JB10
I'm curious of the exact definition of timeout though : )
So the goal here is to get Den = Off... One way is to get the waited for event to happen within its own wait period. But if that doesn't happen, then the Timeout will take over and run the Den = Off action at the end of the timeout period.
Having both periods 30 minutes is potentially conflicting though -- they're both effectively set to trigger at about the same point in time. In fact, I think the Timeout period would always trigger first in this case, and that's not usually the desired behavior. If it was, just use a plain 30' wait or delay instead.
thats where i get confused about the timeout
you are saying that if the wait for motion inactive for 30 secs doesn't happen THEN the timeout kicks in
but when I tested it...if after 20 sec, i generated motion, the light turned off at 50 sec...
so somehow the timeout is reset by motion..
Crap, I'm not on a good roll here today... I mucked that up...
OK, so we start with Den = On. The next step involves a potential motion off (w/ a brief wait) as one way to turn Den = Off.
So let's first say there never was any motion anywhere at all... In that case, the designated Timeout will kill the Wait, and Den will go off after 30" (i.e. the Timeout period ends).
If motiion was involved, then the Wait is a player, and the rule will wait for motion to end (and then an add'l 30" after motion ends). As JB10 said, if add'l motion event occur, those will just continue to reset (cancel) the Wait and it all just keeps going until the motion stops for 30".