zachowj / hass-node-red

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

Detected that custom integration 'nodered' registers an entity service with a non entity service schema #296

Open vaibhav2912 opened 2 weeks ago

vaibhav2912 commented 2 weeks ago

Describe the bug

I am creating a Home Assistant button entity using https://flows.nodered.org/node/node-red-contrib-home-assistant-websocket.

I see a WARNING in the Home Assistant core log after update to Home Assistant Core 2024.9.0

Logger: homeassistant.helpers.frame Source: helpers/frame.py:184 First occurred: 11:11:23 PM (1 occurrences) Last logged: 11:11:23 PM

Detected that custom integration 'nodered' registers an entity service with a non entity service schema which will stop working in HA Core 2025.9 at custom_components/nodered/switch.py, line 61: platform.async_register_entity_service(, please create a bug report at https://github.com/zachowj/hass-node-red/issues

To Reproduce

  1. Upgrade Home Assistant to Core 2024.9.0
  2. Restart Home Assistant

Expected behavior

No warning in the log

Screenshots

No response

Example Flow

No response

Environment Information

Version: 0.65.1

Home Assistant version: 2024.9.0 Companion version: 4.0.2

Node-RED version: 4.0.2 Docker: yes Add-on: no

Node.js version: v18.20.3 x64 linux OS: Linux 6.6.46-haos x64

Additional context

No response

RobMeerwijk commented 1 week ago

I have the same error. Entities don´t show up in HA anymore.

I have updated node-red-contrib-home-assistant-websocket to 0.72.0 (via manage palette) and restarted the server. That didn't do the trick (I thought it did, but after refreshing the dashboards, all node-red entities were gone again)

RobMeerwijk commented 1 week ago

Does this help? https://developers.home-assistant.io/blog/2024/08/27/entity-service-schema-validation/

RobMeerwijk commented 1 week ago

afbeelding

vaibhav2912 commented 1 week ago

@RobMeerwijk, I have a button entity I am registering through nodered for sometime now. In the issues section, I don't see anything.

image

I still get the warning in the HA logs as in the original post but the entity is still available in HA. image image
RobMeerwijk commented 1 week ago

I am investigating all morning, and it is totally unclear. In fact, entities show up after registring in HA. And I can start a flow with a node-red entity ("laden aan") from HA overview. I can see things happening. But the status of "laden aan" remains unavailable. It is on in HA. And the dashboards don't show any values. Wait...

While I am trying to explain, I see that all entities in HA have a _2 added at the end of the entity_id. I can't see why this happenend, but probably, updating 137 nodes will do the trick (on the dashboards as well)

RobMeerwijk commented 1 week ago

Everything is working now. I don't know why all entity states got a "_2" suffix. But anyway. Next time I know what to do. Thanks for your reply.

RobMeerwijk commented 1 week ago

In order to explain a bit more in detail what happened, see below:

After the upgrade I noticed that the node-red entities were unavailable on the dashboards. I started looking in node red, and there I saw 137 node errors, telling me that enitities were not to be found (clear message in hindsight).

I started by looking in the logs, where I found a seemingly related message about entities. That got me on the wrong track (this issue). It turned out to be pretty simple (the solution, not the cause).

Somehow the system had decided that all node-red entities should get a _2 suffix in order to be unique. The original entities were all gone after that.

Changing the entities of all 137 affected nodes and changing the entities on the dashboards solved the problem for now.