Get the value of how long lights in variables have been on in a push notification


#1

1) Give a description of the problem
I have a piston that will turn off a group of lights after 35 minutes of no activity. However the lights will stay on if motion has activity. When the lights turn off I get a push. I would like to add an expression to calculate how long the lights were on before they turned off.

2) What is the expected behaviour?
Trying to figure out how to calculate the time the lights have been on before they turn off.

3) What is happening/not happening?
I don’t know how to write the expression or if it needs to be an argument.

**4) Post a Green Snapshot of the


#2

See previousAge().


#3

Try this… untested. Also see formatDuration() in the wiki for more formatting options.