Can the payload.action passed from a nodered switch be ignored? #1533
-
I've had some flows that used to work but have recently broken due to a change in either node red or this home assistant plugin. Previously I had data from some buttons going through a switch which then based on the button pressed went to a HA-websocket Action node. The problem now is that the switch passes through the data to HA-Websocket which now breaks as the original data contains payload.action which the HA-Action node throws an error on. Is there a way to have the HA-Action node ignore the payload.action and just use the configured values for the node? If there is a better way to achieve this I'm all ears. I did get it working with a Node Red function node but I was trying to avoid Javascript code as it's harder to see what's happening at a glance without looking at the underlying code. New working method but not ideal Node Red Function Node code
Ref to my original discussion : https://discourse.nodered.org/t/stop-switch-passing-through-data/90780/4 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Currently, the action node does not support ignoring the As a workaround, you can insert a change node between the MQTT node and the switch node. First, move |
Beta Was this translation helpful? Give feedback.
Currently, the action node does not support ignoring the
msg.payload.action
input override. This feature will likely be added in a future release, similar to the "Block input overrides" option in the current state node.As a workaround, you can insert a change node between the MQTT node and the switch node. First, move
msg.payload.action
tomsg.action
, then add a second rule to deletemsg.payload.action
. Finally, in the switch node, you can checkmsg.action
instead.