zachowj / hass-node-red

Companion Component for node-red-contrib-home-assistant-websocket to help integrate Node-RED with Home Assistant Core
MIT License
442 stars 181 forks source link

Cannot set the state of a sensor to unavailable or unknown #265

Closed RhavoX closed 2 months ago

RhavoX commented 2 months ago

Version of the custom_component

3.1.6

Configuration

Add your logs here.

Describe the bug

I periodically read data from the web and update some sensors I have created via Node-RED. Now when the network went down or the data is unavailable for any other reason I'd like to indicate that by setting the sensor state to unavailable or unknown. At the moment this seems to be impossible. The sensors accept the state in Node-RED but home assistant still reports the old (valid) value is set for these sensors.

Debug log


Add your logs here.
RhavoX commented 2 months ago

It looks like HA rejects unavailable or unknown due to validation errors when attempting to set a numeric sensor to this.