Wondering if anyone can shed some insight into this.
I have written an automation to turn on and turn off a switch when ever the temperature reading becomes “unavailable” as a way of resetting the sensor. I want it to trigger if the sensor is unavailable for five minutes. The automation does what is intended when triggered manually, but it won’t trigger otherwise.
I set that to ensure it wouldn’t cycle on/off continuously. I’m pretty sure it wasn’t working before I put that in. I’ll remove it and see how it goes. I’ll have to wait till it becomes unavailable again though.
It will only trigger when the sensor goes to ‘unavailable’, so unless the sensor keeps going connecting and disconnecting then it shouldn’t cycle continuously.
It would be good if you could do a screenshot of the unavailable device on the states page (Developer Tools > States) so we can help you further.
Thanks for the response Andy. Now you mention it, I should have checked the states page first. Thanks for the reminder and for taking the time to respond.
Yes, as I remember it I used the wrong ‘state name’. It displayed “unavailable” in the front end (lovelace), but the state (from developer tools) was actually “unknown”. I changed it in the automation and its been working since.
In my case the word unavailable had to be quoted in the automation YAML, and the UI editor for automations wouldn’t do that. More detail here: How to use "unavailable" as a trigger/status