#Node-Red question. Action node doesn't work after switch node

1 messages · Page 1 of 1 (latest)

leaden pine
#

I have a remote control with 4 on and 4 off buttons. When I press 4 off, the remote sends "4_off".
In Node-Red I send this to a switch node and on an output I have "4_off".
On this output I have many action nodes to switch off switches, lights and my media player.
I recently added another action node to close my cover but this won't work.
The message under the action node with action "cover.cover_close", after it was called, is "switch.turn_off".
Do I need a node inbetween to change the action?
I played around and when I inject just "off", the action node closes the cover, why "off_4" isn't accespted and how to solve this?
Thanks for your input and help!

void nebula
leaden pine
void nebula
#

I meant a true test case that is reproduceable by other people. As in via inject for example.

#

You also mentioned 4_off but your switch checks for off_4.

leaden pine
#

I've added the inject node, don't believe this makes a big difference.
Apologies it's off_4. As I already mentioned; other action nodes are activated, sio it should be the correct sentence

void nebula
#

Yeah I can't really test this either. It's probably more of a device thing rather than a node thing? What device is it exactly? Does it work via service calls?

velvet isle
# leaden pine I've added the inject node, don't believe this makes a big difference. Apologies...

Try attaching a debug node to the MQTT output, and then another one to the switch output (I find its helpful to set node output to 'Complete message object').
To view this debug output, click the right hand hamburger menu in Node-RED, and select View -> Show Sidebar. Then select he 3rd tab icon on this new sidebar (debug view)

The inject node you added above isn't useful as it just triggers the action, instead of seeing why the conditions aren't triggering from the MQTT source

leaden pine
#

@velvet isle , thanks for your help to debug. I added 3 debug nodes. The output I get is:

zigbee2mqtt/muurknop_living : msg : Object
{ topic: "zigbee2mqtt/muurknop_living", payload: object, qos: 0, retain: false, _topic: "zigbee2mqtt/muurknop_living" … }
13-4-2025, 09:05:49node: Terras pin spot uit
msg : error
"InputError: Invalid action format: off_4"
13-4-2025, 09:05:49node: Sluit rolluik achterdeur
msg : error
"InputError: Invalid action format: off_4"
13-4-2025, 09:05:49node: Close cover
msg : error
"InputError: Invalid action format: off_4"
13-4-2025, 09:05:49node: debug 2
zigbee2mqtt/muurknop_living : msg : Object
{ topic: "zigbee2mqtt/muurknop_living", payload: object, qos: 0, retain: false, _topic: "zigbee2mqtt/muurknop_living" … }
13-4-2025, 09:05:49Erker, kast, klok berging, lamp achtergevel uit
msg :
{ domain: "switch", service: "turn_off", target: object }```