Node that will repeat the action just in case

Hey all,

New to this whole Node-Red thing, really awesome stuff.

I'm looking for some kind of node that can repeat the action that just went off. I'm running into issues with my lights that are behind walls and the Bridge is in a different room. Sometimes... a light like in the kitchen or my room, the action won't go through because at that moment, it was unreachable. For the most part, whenever I manually turn a light on through the Home app, it always works (as if it continues to try until it completes, or surpasses the timeout), but when it comes to automatons, very seldomly it will not.

Anyway, is there a node I can attach to the beginning, or end of an action that will cause it to repeat after say, 5 seconds, just so it will for sure turns on. Or maybe a node that tells if the service/flow completed, and if it failed, try again? Something like that.

This may help you on your journey.

It is a bit .... small.... but it is only to get the idea to you for what you want to do.

The EVENT is what ever message/event that happens you want to start things happening.

The ACKNOWLEDGE is something that you send to stop the message.

You will need to tweak values and stuff, but I hope it shows you a way to do what you want.

Oh, and Welcome to the forum
Hope you enjoy things.

[{"id":"fccd05dc03402ab2","type":"inject","z":"65c9b63cb09879a0","name":"EVENT","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":2470,"y":640,"wires":[["9b248a544806af94"]]},{"id":"9b248a544806af94","type":"trigger","z":"65c9b63cb09879a0","name":"","op1":"ATTENTION!","op2":"0","op1type":"str","op2type":"str","duration":"-3","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":2660,"y":640,"wires":[["3bc9ab91486f1136"]]},{"id":"0447fdbbbc9b836e","type":"inject","z":"65c9b63cb09879a0","name":"Acknwledge","props":[{"p":"reset","v":"true","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":2500,"y":570,"wires":[["9b248a544806af94"]]},{"id":"3bc9ab91486f1136","type":"debug","z":"65c9b63cb09879a0","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2850,"y":640,"wires":[]}]
1 Like

Yes, the trigger node can be set to send the original message again after a defined time

If you want to keep re-trying till it works, and you have some way of knowing that it has worked, then you could use this flow. It might appear at first that it is not solving the same problem, but actually it is. Provided that you can provide a message when it fails (via a timeout possibly) and one when it succeeds, then the flow can do what you want.

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