How about you have a look at this flow.
It is not exactly what you want with how it is done, but it does do what you want.
Rather than using an IF
command, I used a switch
node.
Have a look.
[{"id":"245e5db1.d0feea","type":"inject","z":"b9924a74.4d98f8","name":"","topic":"","payload":"thunderstorms","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":260,"wires":[["cefa1eeb.51646"]]},{"id":"8f471843.fe865","type":"inject","z":"b9924a74.4d98f8","name":"","topic":"","payload":"lighting","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":300,"wires":[["cefa1eeb.51646"]]},{"id":"dce8eaf3.4573d","type":"inject","z":"b9924a74.4d98f8","name":"","topic":"","payload":"heavy rain","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":340,"wires":[["cefa1eeb.51646"]]},{"id":"61a76b87.b6e94c","type":"inject","z":"b9924a74.4d98f8","name":"","topic":"","payload":"anything else","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":380,"wires":[["cefa1eeb.51646"]]},{"id":"cefa1eeb.51646","type":"switch","z":"b9924a74.4d98f8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"thunderstorms","vt":"str"},{"t":"cont","v":"lighting","vt":"str"},{"t":"cont","v":"heavy rain","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":370,"y":300,"wires":[["a91b5133.f8ace8"],["a91b5133.f8ace8"],["a91b5133.f8ace8"],["7909e18.4ab142"]]},{"id":"a91b5133.f8ace8","type":"debug","z":"b9924a74.4d98f8","name":"Bad weather","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":560,"y":270,"wires":[]},{"id":"7909e18.4ab142","type":"debug","z":"b9924a74.4d98f8","name":"Good weather","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":570,"y":330,"wires":[]}]
The two output
nodes are for good weather and bad weather.
So depending on what you send in to the node depends on which debug
node get the message.
You can then use those outputs to start the next stage of things happening.
Also, you could put a change
node on each output that simply changes the msg.payload
to either bad
or good
for easier processing at the next stage. But really it isn't needed unless you really want to use the Original messages.