I’m trying to automate a device restart when the temperature sensors reported go to ‘unknown’. Here’s the automation I currently have. It didn’t trigger to restart the device. It does cycle the switch when manually executed.
When viewing the sensor state under Developer Tools, unknown appears. Doesn’t this establish unknown as a ‘real’ state? I’ll change to a Template trigger with your suggested template and see what happens. Thanks.
I’m using a custom component that scrapes a local web page for the value. One issue was I was using unknown instead of unavailable. I’ve added the template trigger and waiting for the device to require another reboot. Usually 12 to 18 hours.
This triggers when the outdoor temp sensor goes unavailable and toggles power to the PWS observer module. I’ve been able to reduce the occurrence of unavailable data by relocating the observer module. If you can reduce the distance between the observer and PWS, it may help.
Thanks to both. Quick question why for some cases (sensors) the state is ‘unavailable’ and for others is ‘unknown’? This depends on the implementation of the integration and HA doesn’t make any conversion?
Unavailable should mean there is an issue with the integration. Unknown should mean no state update has been received from the integration since home assistant started (or the integration was reloaded) but the integration itself is working as intended as far as HA can tell.
These definitions may be misused in third party integrations or templates.
That makes sense! Thank you for the clarification and somehow that match what I’m seeing with some sensors. I’ve learned one more today… Btw is the ‘unknown’ state case sensitive? or means the same as ‘Unknown’?
Really appreciate your kind support.