How to tell how long a device was in a particular state?


#1

Fairly straight forward question. I’d like to write an expression to determine how long a device was in its current state so I can use it to figure out a wait.

Expression $myVariable = $time - [My Motion : motion].last_change_time

How do I grab, is there a way to grab, the time stamp of when a device last changed state?


#2

Try this. I do the same thing with this piston.

This piston will give you this.


#3

age([device : attribute] was exactly what I was looking for.

Thank you!