Inject node with multiple payload and topic

Hi

If I need to use an inject node and need to work with two msg.topic where the topic text is:
zigbee2mqtt/name1/set
zigbee2mqtt/name2/set

And name1 is using one payload and name2 another payload, how can I make the inject node and send the data to a switch node, so name1/payload1 is send to one output and name2/payload2 is send to another output?

The inject node will only allow one msg.topic for a single msg.

Why not use two inject nodes connecting to the switch node?

Hi Zenofmud

My problem is, that I have a motion detector, when that is "motion=true" then it fires an payload to my alarm to trigger (That is one topic and payload) but then I also need to activate a siren (smoke detector) so I use that to sound an alarm-siren (That's another topic and payload)

So the thats why I think one inject node with to topic, that have a relationship... if i'm using two inject nodes, how can I then trigger inject node 2, if inject node 1 motion is true?

Wont this work?
Untitled 3

[{"id":"b63aca45.aa973","type":"inject","z":"f28c9311.213ba","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":140,"wires":[["2ba89f82.e7991","94e1cb39.5b633"]]},{"id":"2ba89f82.e7991","type":"change","z":"f28c9311.213ba","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload1","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"zigbee2mqtt/name1/set","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":120,"wires":[[]]},{"id":"94e1cb39.5b633","type":"change","z":"f28c9311.213ba","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload2","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"zigbee2mqtt/name2/set","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":160,"wires":[[]]}]

Or if you prefer:

Thx Jbudd that will work ok.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.