Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.01k stars 1.67k forks source link

Action label - Some devices don't work anymore with Node Red #24268

Open gregolin opened 2 weeks ago

gregolin commented 2 weeks ago

What happened?

I'm facing issue with some devices and Node Red. After last upgrade, it seems NodeRed is using the node label "action" to themselves, so any value there (string) result in error message (Node Red log):

"InputError: Invalid action format: unlock"

And all actions following the node result in error. Is "action" a right/best label for this node (for a door lock for instance)? I'm thinking if ACTION could be some protected word, something similar that.

Here is another user reporting the same issue: (zachowj/node-red-contrib-home-assistant-websocket#1489) Is there any way that I could change the label by myself or it must be done in the add-on level? This is the object which is returned:

action: "unlock" action_source: 2 action_source_name: "manual" action_user: 0 auto_relock_time: null battery: 100 battery_low: null linkquality: 120 lock_state: "locked" pin_code: null sound_volume: null state: "LOCK"

Thanks.

What did you expect to happen?

The node returns with some other label than "action", which seems used as a reserved word nowadays.

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.40.2-1

Adapter firmware version

2024.10.1

Adapter

Sonoff

Setup

Add-on working under Intel NUC

Debug log

No response

mundschenk-at commented 2 weeks ago

Seems like a Node Red issue.

gregolin commented 2 weeks ago

I don't consider an issue from their end. They just have decided to use the label "action" for other reasons. On the other hand I also don't consider a Z2M issue. I just would like to know how could I change a label for a specific device. This change would resolve the problem. Thanks.

mundschenk-at commented 2 weeks ago

No idea. There is probably a specific plugin for Node Red that interfaces with Z2M? "Label" has no meaning in MQTT.

gregolin commented 2 weeks ago

No idea. There is probably a specific plugin for Node Red that interfaces with Z2M? "Label" has no meaning in MQTT.

Label I mean the name/id/definition of the sensor (in the HA), which is created when we add some device in the HA by Z2M. If I could change this name/label, the problem is fixed.

gregolin commented 2 weeks ago

For this "action", under EXPOSES tab:

image

mundschenk-at commented 2 weeks ago

Not really, no. That's internal data of Z2M. And entity IDs in HA are entirely arbitrary anyway.

gregolin commented 2 weeks ago

I have imagined about that... so my question is about some possibility to change the Z2M for this device (maybe there are other reserved words as well), in the add-on level.

mundschenk-at commented 2 weeks ago

You need to talk to whatever Node Red plugin you use to connect Node Red and Home Assistant or Z2M.

gregolin commented 2 weeks ago

I use the most popular Node Red add-on for HA (Git) certainly they are using ACTION label for some reason, so the easier way to fix it would be to crate this node with a different word. I really think easier to change this word, since it is created when some device is added in the HA.

mundschenk-at commented 2 weeks ago

That's not how this works. You can rename all entities yourself in HA (but really the issue lies with the Node Red plugin that interfaces with HA and should be fixed there).

gregolin commented 2 weeks ago

This is the point. It seems isn't related to entities name, which I can change it. See the entity's name below:

image

image

But when I access the device by Node Red, the node still comes as ACTION:

image

I really can't understand where this ACTION is defined/created.

mundschenk-at commented 2 weeks ago

Well, then the issue obviously hasn't got anything to do with Z2M nor HA entity naming and needs to be found elsewhere (Node Red respectively the Node Red plugin/component that interfaces with Home Assistant - that doesn't mean the HA add-on, which is just a fancy packaging for a Docker container).

Most likely, the issue you experience is related to the recent renaming of service calls to actions in Home Assistant.

mundschenk-at commented 2 weeks ago

But just to be sure, do you interface Z2M with Node Red directly or via Home Assistant? The last screenshot appears to show something that is not mediated by HA.

gregolin commented 2 weeks ago

Via HA. The last screenshot is the NodeRed debug screen, over HA.

mundschenk-at commented 2 weeks ago

Well, it's just that zigbee2mqtt/Sala_Fechadura looks more like an MQTT topic (prefix) than something coming from Home Assistant.

gregolin commented 2 weeks ago

Well, then the issue obviously hasn't got anything to do with Z2M nor HA entity naming and needs to be found elsewhere (Node Red respectively the Node Red plugin/component that interfaces with Home Assistant - that doesn't mean the HA add-on, which is just a fancy packaging for a Docker container).

Most likely, the issue you experience is related to the recent renaming of service calls to actions in Home Assistant.

I think you are right about this suspicion. https://www.home-assistant.io/blog/2024/10/02/release-202410/#improved-yaml-syntax-for-automations It changed from SERVICE to ACTION. Thanks.