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

Entities not available (2023.11.0 and NR 15.0) #225

Closed driagi closed 8 months ago

driagi commented 8 months ago

I updated HA to 2023.11.0 and Node-Red to 15.0. After the upgrade some entities are not available in HA. Tried to do a downgrade and everything works, I created an updated clone and it doesn't work

driagi commented 8 months ago

I also tried the HA(2023.11.0) and Node-Red (14.6.3) configuration. Not all entities work. N.B. -> I was probably wrong, but the entities (Category -> Config) don't work. Leaving it blank, it works again

TuTunabh4 commented 8 months ago

I've met the same problem. Maybe it's because of the HA.

driagi commented 8 months ago

I've met the same problem. Maybe it's because of the HA.

Check if they are CONFIG

rlust commented 8 months ago

What has happened to some of my NR. sensors? I am at current releases and sensors become unavailable.

zachowj commented 8 months ago

What version of the package are you using?

Lateadapter commented 8 months ago

Same here... I did start from HA Core 2023.10.5 and NodeRed 15.0.0. After update to HA Core 2023.11.0 all within NodeRed defined entities were not anymore available in HA. I did a downgrade to NodeRed 14.6.3 - the same. I went back to HA Core 2023.10.5 and everything did work as before.

Again after update to HA Core 2023.11.0 (now with NodeRed 14.6.3) all entities disappeared.

The error log of HA start did show following inconsistencies:

`Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:507 Integration: Sensor (documentation, issues) First occurred: 20:57:24 (20 occurrences) Last logged: 20:57:25

Error adding entities for domain sensor with platform nodered Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1021, in add_to_platform_finish await self.async_internal_added_to_hass() File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 279, in async_internal_added_to_hass raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: Entity sensor.e3dc_batterie_laden_kwh cannot be added as the entity category is set to config `

and

`Logger: homeassistant Source: components/sensor/init.py:279 First occurred: 20:57:24 (20 occurrences) Last logged: 20:57:25

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1021, in add_to_platform_finish await self.async_internal_added_to_hass() File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 279, in async_internal_added_to_hass raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: Entity sensor.e3dc_batterie_laden_kwh cannot be added as the entity category is set to config `

I removed at all sensor definitions within NodeRed the category "config" and leave the field empty. After Restart of HA all entities were acquired.

Definition of new sensor with empty category field also is working - so far solved for me.

zachowj commented 8 months ago

Looks like the new check was added here https://github.com/home-assistant/core/pull/101471

dgthomson commented 8 months ago

Quick fix: in /custom_components/nodered/__init__.py lines 189 and 190, change to:

#        if category == "config":
#            return EntityCategory.CONFIG

i.e. comment these lines out, then restart. The entities reappear.