I would like to know the time difference between the current time and the time of the previousState of an item, if delta > 10 seconds do something.
Problem is that I cannot get the absolute time of the previous item, I’am able to read the state (working fine) by using
but I need something like
if (now() - sonoff195_Switch.previousState.time) > 10 then .....
Any hints greatly appreciated!