Wait Untill Node Red

I have hunted for examples of the “Wait Until” node,
I am struggling to set it up for an automation to wait until a set time then pass on the message
i have a helper set up were i can set a time manually
and i have the time date sensor integration. i dont know if im barking up the wrong tree, but i would have thought this should be a popular easy to use node, but im really struggling to find examples.
i have noticed that my helper has time format 00:00:00 but my sensor.time has format 00:00
I am a noob thanks in advance


Screenshot 2022-01-18 170528

Here is an example:

This gives me 260 seconds to get out of bed.
As long as the binary sensor is “on”, it counts the time, if I get off it exits the node. If I stay in bed for 260 seconds then it goes on to the rest of the sequence.

Where it says az that is the state you want to wait for.

Is the idea to trigger on a specific time/input helper time.
Use the time node instead. It will trigger on the time of a sensor or input_datetime.

The idea is to send at a certain time the trigger has already happened its a trigger from an email but i only want to be notified at a certain time

I have an email node it receives 2 email subject/topics but only one of those emails i want delayed until 20:30 hours

In that case you need to variable delay the message or save the parts of the message that is important in flow variables and use the time node to trigger at 20:30 and use the flow variables there.

[{"id":"db59c44c80f746c4","type":"inject","z":"91a80f99.6180e","name":"email","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":162,"y":2816,"wires":[["023e097cfce1e1ee"]]},{"id":"023e097cfce1e1ee","type":"switch","z":"91a80f99.6180e","name":"delay email?","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"","vt":"str"},{"t":"eq","v":"","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":326,"y":2816,"wires":[["93186024889481dd"],["dc3632e65a8990ec"]]},{"id":"93186024889481dd","type":"debug","z":"91a80f99.6180e","name":"no delay","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":508,"y":2816,"wires":[]},{"id":"dc3632e65a8990ec","type":"change","z":"91a80f99.6180e","name":"save email","rules":[{"t":"set","p":"payload","pt":"msg","to":"savedEmail","tot":"flow","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":518,"y":2864,"wires":[[]]},{"id":"c106fbd07165cda8","type":"ha-time","z":"91a80f99.6180e","name":"","server":"","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityId":"input_datetime.delay_to_deliver_","property":"state","offset":0,"offsetType":"num","offsetUnits":"minutes","randomOffset":false,"repeatDaily":false,"outputProperties":[],"sunday":true,"monday":true,"tuesday":true,"wednesday":true,"thursday":true,"friday":true,"saturday":true,"debugenabled":false,"x":262,"y":2912,"wires":[["2ffac8658d6d6a3a"]]},{"id":"2ffac8658d6d6a3a","type":"switch","z":"91a80f99.6180e","name":"email exist?","property":"savedEmail","propertyType":"flow","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":516,"y":2912,"wires":[["76fa611445b4b291"]]},{"id":"76fa611445b4b291","type":"change","z":"91a80f99.6180e","name":"fetch email","rules":[{"t":"set","p":"payload","pt":"msg","to":"savedEmail","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":694,"y":2912,"wires":[["9c4a3685d92830ad"]]},{"id":"9c4a3685d92830ad","type":"debug","z":"91a80f99.6180e","name":"do things","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":860,"y":2912,"wires":[]}]

Delete email after do things.
Else if no email comes tomorrow the flow will send yesterdays email

[quote=“Kermit, post:5, topic:381448”]

It looks like the easiest solution for the wait until node is to not use it :thinking:, i understand your suggestion but I am afraid I still cant get that to work
I stripped it down to the basics and still cant fetch
fetch

[{"id":"db59c44c80f746c4","type":"inject","z":"5bf89db1.49e974","name":"input","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"topictest","payload":"payloadtest","payloadType":"str","x":850,"y":1280,"wires":[["dc3632e65a8990ec"]]},{"id":"dc3632e65a8990ec","type":"change","z":"5bf89db1.49e974","name":"save email","rules":[{"t":"set","p":"topic","pt":"msg","to":"savedEmail","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":1280,"wires":[["6301434bf2cb795c"]]},{"id":"9c4a3685d92830ad","type":"debug","z":"5bf89db1.49e974","name":"do things","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1180,"y":1340,"wires":[]},{"id":"db996bdcc4aaf9f8","type":"inject","z":"5bf89db1.49e974","name":"Push","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":850,"y":1340,"wires":[["377ab3f6b1d19ce3"]]},{"id":"6301434bf2cb795c","type":"debug","z":"5bf89db1.49e974","name":"no delay","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1180,"y":1280,"wires":[]},{"id":"377ab3f6b1d19ce3","type":"change","z":"5bf89db1.49e974","name":"fetch email","rules":[{"t":"set","p":"payload","pt":"msg","to":"savedEmail","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":1340,"wires":[["9c4a3685d92830ad"]]}]

It’s because I had the save email values flipped. Should be setting the flow variable to msg.topic not the other way around.

You could use a wait-until node but you would have to trigger off of sensor.time because the input_datetime doesn’t change.

$substring($entities("input_datetime.delay_to_deliver").state, 0, 5)

image

Hey guys,

Trying to work out a similar thing. I have a trigger that might come though at outside a certain time. I then want it to wait till it is within that time and run a state check.

So that if my dishwasher finishes at 3am, it will start the empty reminder to start after 9:30

Thanks :slight_smile:

Since it’s a bad idea to delay automations for longer periods my advice is to use an input boolean that is set to on when the machine is done.
Then use an inject on repeat at 9:30 linked to current state node if boolean is on.
Or a poll state at 9:30 if boolean is on.

And when the machine is emptied you set this boolean to off again.

That way it will not fail even if HA restarts in the middle of the night.

2 Likes

The Boolean is a good idea thanks!

I just put a delay in there for now to circle round every 15m.

Other then restarting HA will break it, why is is so bad to delay automations?

As a performance thing?

That is the only reason it’s bad to have long delays as far as I know

1 Like

I’ve come up with my own solution to the ‘wait until’ node not doing what it’s supposed to using trafic lights. I just link any inputs that I want to start the waiting period into an ‘allow’ change message node and then when my desired trigger occurs the automation runs and returns a ‘stop’ message to the traffic light

Can you share that flow? My mind is stuck on stupid on how to format the traffic light. I am going to use it for lumination values like you also