Delay issues with sequence

I have a motion sensor trigger lights on motion, 2 route depending on the time.

They delay is to mimic Philips hue, but I think they are just collecting there each time motion is detected , instead of restarting the flow again, I think this is causing me issues with lights turning off randomly when the queued messages finally get through,

How do I stop this happening…

I need

motion = lights then delay then dim then delay then off. If motion detected in that flow again before it completes, reset and start the flow again.

what am I missing?

I’m a noob, so take this with a huge grain of salt.

That said, have you tried putting a delay node set to rate controll right after the motion sensor? The motion sensor is bombarding your flow whenever the motion occurs and the flow itself lasts for 7 minutes. Set up the way you seem to have set it up, the messages accumulate in the first delay node and everything goes crazy further down the flow. So, if you choose this way of solving it, you would put a one in 7 minutes with drop intermediate messages right after the motion sensor.

That said, again, I think this isn’t the best way to do it. Maybe you could think about making your motion sensor movement detected message reset the first delay… So every movement just prolonges the duration of full luminance. Every new message should, as I see it, replace the previous one and restart the 5 minute delay. I don’t think it’s possible with the delay node you’re using here, but try looking up timer nodes, I believe I’ve seen some that take inputs.

Once again, I repeat - I’m a noob. I may have spewed a load of bullshit here. Please research this further or wait for someone more knowledgeable to comment. I just came here to see if anyone answered my question and, well, saw yours and thought what the hell.

1 Like

yes the second paragraph is more what I’m looking for. so once its gone past that first 5 mins delay it need to stop the flow where it is and start again I guess. I’ve only been using it for 2 days now so am struggling a little

and its annoying the family the lights are being a pain hehe so trying to get it sorted

I totally understand your pain… Unfortunatelly, as much as I’d love to, I can’t help you much. I know far too little about all of this to help you without researching it myself for quite a bit, which I simply don’t have time to do ATM. Try looking around for node red custom nodes / flows that use simmilar logic. I believe this could be done with a wisely chosen “timer” node and maybe something relatively simple like a “change node”… Shouldn’t be too dificult.

I wish you luck!

yeah im googling at the moment :wink:

You need to reset the second delay, it’s easier to do with a trigger node.
\

[{"id":"e9f465662b9b9a0c","type":"trigger","z":"f80b6c338afd5483","name":"","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"5","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":710,"y":2640,"wires":[["1745ef4340c5fd7e"]]},{"id":"6f29818d8c625f86","type":"api-call-service","z":"f80b6c338afd5483","name":"","server":"","version":3,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"jsonata","mergecontext":null,"mustacheAltTags":false,"outputProperties":[],"queue":"none","x":490,"y":2640,"wires":[["e9f465662b9b9a0c","1a15dcdddb362fe8"]]},{"id":"1745ef4340c5fd7e","type":"api-call-service","z":"f80b6c338afd5483","name":"","server":"","version":3,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"jsonata","mergecontext":null,"mustacheAltTags":false,"outputProperties":[],"queue":"none","x":890,"y":2640,"wires":[["2ec1586db69858bf"]]},{"id":"2ec1586db69858bf","type":"trigger","z":"f80b6c338afd5483","name":"","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"2","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1110,"y":2640,"wires":[["f670126f83f1e43e"]]},{"id":"1a15dcdddb362fe8","type":"change","z":"f80b6c338afd5483","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":2700,"wires":[["2ec1586db69858bf"]]},{"id":"f670126f83f1e43e","type":"api-call-service","z":"f80b6c338afd5483","name":"","server":"","version":3,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"jsonata","mergecontext":null,"mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1310,"y":2640,"wires":[[]]}]
2 Likes

cool ill give that a try thank you will report back.

ah you beautiful brain, thanks I think this has solved my issue.

2 Likes