I can’t figure out how to do the following automation:
I have a sensor value and I want to do something when it changes from below (or equal) a threshold value to a value above the threshold.
For example:
Threshold is 20
sensor value changes from 7 to 10 - do nothing
sensor value changes from 10 to 11 - trigger automation
sensor value changes from 11 to 12 - do nothing
My problem is that I would need the previous sensor value, but don’t have access to it in an automation.
This kind of operation is easy in AppDaemon - when you subscribe to a state change you are handed the old and the new values so you can decide what to do.