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

Node Red sensor entities not available anymore after update to HA core 2024.2.0 #251

Closed ullibak closed 4 months ago

ullibak commented 4 months ago

Hi

Yesterday, I updated HA core from 2024.1.6 to 2024.2.0 (Node Red version is 17.0.5) In Node Red, I use sensor entities and binary sensor entities. From the moment of the update, all the sensor entities stopped working while the binary sensor entites still work normally.

In Developer Tools -> States the state is "unavailable". I can find the entity in the entities list (Settings -> Devices&Services). When I click on it, an error message is shown:

This entity is no longer being provided by the nodered integration. If the entity is no longer in use, delete it in setting.

In Node Red, everything seems to be normal: No error message and the sensors seem to update their values normally.

I restartet HA several times, without success. Then I added a new additional sensor entity. Same problems.

Anyone with the same issue or a solution? Thx!

EDIT: Looked into the Logs and found error messages like

"/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 453, in state_attributes raise ValueError( ValueError: Entity sensor.fussbodenheizung_sollwert (<class 'custom_components.nodered.sensor.NodeRedSensor'>) with state_class measurement has set last_reset. Setting last_reset for entities with state_class other than 'total' is not supported. Please update your configuration if state_class is manually configured.

The problem seems to be that I had defined "last reset" values for the entities. BeforeHA core version 2024.2.0 obviously this (wrong) setting was ignored but since 2024.2.0 HA is more "picky" and raises an error when it finds a "last reset" value where it does not belong.

Problem solved...