Hi I have Shelly Temperature sensors (H&T) and there is a problem that if they go off line you don’t know for many hours. I use these for my central heating, so that’s a problem.
So I want to run a script every hour.
I want to compare the current temperature with the one taken an hour ago (a variable)
If the temperature has changed then update the variable
If the temperature is the same then I can set an input Boolean
The temperature sensor is 1 decimal place, so what can I use for my variable?
It is a property of the entity (not an attribute or state). You can not use the states() method to access properties of entities. You access it like this:
That’s the problem I started with, when they go off line it takes up to 24 hours before the become unavailable.
Scenario: heating comes on set to 20 deg, temp sensor went off line at 18 deg, HA just see’s 18 deg, so the heating will never go off. (I have had this happen to me)
So I will set a timer when the heating comes on, and reset the timer via this automation, (so its constantly being reset as the temperature should be changing) if the timer reaches an hour I can get it to turn the heating off. (worse case the heating runs for 1 hour)