Nodered to wait to trigger flow if other flow was triggered within 5 min

Hi

i have 2 flows, one for when im coming home and one when i leave home.
the one when im coming home is triggered using the door and time, but i like to ad a “if”
so if i trigger the “leave home” flow the coming homeflow can’t be triggered for 5min
what should i use to make this happen?

//Regards

You can use a custom made Boolean switch or some other variable, for example name it “hold” When you leave home set “hold” ON for 5 minutes. In the flow for coming home you put this same “hold” variable if Hold is NOT ON

Hi, thank you for your replay,
how do i do this?
im very new to this.

If you want to do it entirely in nodered your could do this:

[{"id":"59909777.6b7488","type":"inject","z":"d59703d6.87ebf","name":"Coming Home","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":4240,"wires":[["5e92ceaa.01ff7"]]},{"id":"5e92ceaa.01ff7","type":"traffic","z":"d59703d6.87ebf","name":"","property_allow":"payload","filter_allow":"on","ignore_case_allow":false,"negate_allow":false,"send_allow":false,"property_stop":"payload","filter_stop":"off","ignore_case_stop":false,"negate_stop":false,"send_stop":false,"default_start":true,"differ":false,"x":370,"y":4240,"wires":[["209996dd.77f58a"]]},{"id":"209996dd.77f58a","type":"debug","z":"d59703d6.87ebf","name":"Do stuff","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":560,"y":4240,"wires":[]},{"id":"27b8ab7.9d42554","type":"inject","z":"d59703d6.87ebf","name":"Leaving Home","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":4120,"wires":[["e57a2f76.d915b","78c7d033.61a3"]]},{"id":"6117a4c4.4c09ac","type":"debug","z":"d59703d6.87ebf","name":"Do stuff","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":520,"y":4120,"wires":[]},{"id":"e57a2f76.d915b","type":"change","z":"d59703d6.87ebf","name":"Block","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":4120,"wires":[["6117a4c4.4c09ac","5e92ceaa.01ff7"]]},{"id":"52d74d3b.50d034","type":"change","z":"d59703d6.87ebf","name":"Allow","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":4180,"wires":[["5e92ceaa.01ff7"]]},{"id":"78c7d033.61a3","type":"delay","z":"d59703d6.87ebf","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":120,"y":4180,"wires":[["52d74d3b.50d034"]]}]

If have set the delay at 10 second just to show… The trick is the “Traffic light” node. Add this to your palette.

GV

2 Likes

This is the way to go. The Traffic Light node is immensely useful and doesn’t require you to create all these random input booleans in HA. The only time I don’t use it is if I want the condition controllable from the HA UI (e.g. Vacation Mode is On or a variable timer that can be set from HA with an Datetime Input)

Thank you, this works perfectly! im very happy now :slight_smile:

//Regards

hello again and thanks for the help last time, i hope it’s ok that i ask a few more questions?
im a total noob to this but i rely like to learn, at least how some stuff work.

the excellent flow you did to me, Did you need to do any “programming” in the nod or is it just to drag and drop, and click on/off the dropdown?

the nod that have the light that turn on in, have multiple lights in one nod, is it possible to dim a single light in this nod by setting a value in that nod on that light, or do i need to ad another nod with only the light i like to dim? expel: in the nod i have, kitchen ceiling, hallway ceiling and hallway window, i like them al to turn on but i like the kitchen to be at 50%.

question 2, i use alexa to control my huse, if i understan it i can trigger alexa from nod reed? for example if i say good morning to my bedroom alexa spot, it runs one scenario, and if my kidds say good morning to their alexa spot some other flow happens.

question 3: can i trigger spotify from nodered, for example have a flow so when i come home it plays music or if i say good morning it plays another typ of songs.

//Regards

Just drag and drop. Quite often the hardest is to find the “right” node to use and looking onto flows.nodered.org will help.
For Q1, it is easier to have one node per light. I guess you could do something clever with groups… But why make it hard!
For Q2 and Q3, probably, but I don’t use any of the two. So, no practical experience.
But, again, search for the node that will do 99% of the job for yoU

GV

ok, thank you

//Regards