Use node-red to fire events from actions

I’m trying to get ios.action_fired to work in Node red. The only thing I can get to work is using an “events All” in node-red and for it’s event type “ios.action_fired” but there isn’t a field to specify the action name, so as a result if I have more than one ios action it will not work.

Has anyone gotten something like this to work? I tried to do it as an automation in HA but I’m struggling to do get that working at all and I would prefer to have it in node-red.

You will have to add a switch node after the events all node to filter out the action you want depending on what the output is.

Thanks. How should the switch node be set up to look at the message.payload. I tried contains “lightsoff”, lightsoff is defined in the action but that didn’t work.

You would have to look at the payload. For example I use this for a switch event from deconz.

image
In this case if I want to filter by id for example I would set up a switch like this:

image

2 Likes