I see that if I use “wait until” node and I have two messages waiting to condition in the same node, only the last message is sent.
How I can enqueue some messages and all they will sent when the condition will be true?
I see that if I use “wait until” node and I have two messages waiting to condition in the same node, only the last message is sent.
How I can enqueue some messages and all they will sent when the condition will be true?
I dont understand what you are trying to do.
The wait until node will check for a state to become true and will then fire so you can continue your flow.
You want multiple wait until nodes to be checked at the same time?
The message object of the wait-until nodes gets overwritten each time it receives a message. There’s probably a node out there that does exactly what you’re looking for but it’s simple to do with a function node.
If you want the function node to release the messages saved based on an event from HA swap the release inject node with an event-state or trigger-state node with the same conditions that you would have used in the wait-until node.
[{"id":"f6340139.4a6d","type":"inject","z":"316b7737.65f728","name":"","topic":"","payload":"abc","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":194,"y":272,"wires":[["bb2607fa.49b308"]]},{"id":"b0104973.6cc028","type":"inject","z":"316b7737.65f728","name":"","topic":"","payload":"xyz","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":194,"y":304,"wires":[["bb2607fa.49b308"]]},{"id":"bb2607fa.49b308","type":"function","z":"316b7737.65f728","name":"","func":"const messages = context.get('messages') || [];\n\nif(msg.release) {\n context.set('messages', null);\n node.status({text: `Sent: ${messages.length}`});\n return [messages];\n}\n\nmessages.push(msg);\ncontext.set('messages', messages);\nnode.status({text: `Holding: ${messages.length}`});","outputs":1,"noerr":0,"x":354,"y":288,"wires":[["c4099756.6950b8"]]},{"id":"2faac04a.096c2","type":"inject","z":"316b7737.65f728","name":"release","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":194,"y":368,"wires":[["40b5cda9.31cad4"]]},{"id":"40b5cda9.31cad4","type":"change","z":"316b7737.65f728","name":"","rules":[{"t":"set","p":"release","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":352,"y":368,"wires":[["bb2607fa.49b308"]]},{"id":"c4099756.6950b8","type":"debug","z":"316b7737.65f728","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":518,"y":288,"wires":[]}]
Works fine. Thanks.