Is there a generic way to be able to write an expression in RM4 like:
IF (Garage Motion inactive for 15 minutes) Off: Garage Lights
I know each device has its own event log and with some custom code I can look back in that log to figure out when an attribute changed. Just wondering if there is a nice/generic way to do that same test in RM.
Note that this wouldn't be for Triggering a rule, just a conditional check.
Thanks, both of those look more like delays/timers that get set. Thinking about this more what I want is a "last changed" timestamp tracked for all device attributes.
IF (Garage Motion inactive AND Garage Motion last changed <= now - 15m) Off: Garage Lights
Breaking it out as a separate timestamp attribute would let you do all sorts of fun stuff conditionally on the attribute.
The way that I've use the switch timer is as follows:
I have a simple lighting automation that Turns on the switch timer when the switch is turned on. An attribute of the switch time switch, is how long (minutes or seconds) I want it to count down.
I have a RM that turns off the switch (or does some other action), when the switch timer switch "turns off".
Simple, but powerful. I'm also sure it can be done in a variety of other ways.
Right, that is what I do now but there are some cases where I'd like to check "how long has attribute X been in state Y", I just picked a simple example to illustrate it. I can work around the lack of last-changed information in each rule it is just more cumbersome to do so.
Sounds like I should submit a feature request for something like this