Wait until node

I have a question on the “wait until” node:

Idea is that a message goes in the wait until node and activates it. Now the node should wait until a binary sensor turns its state to true (on) and then it should pass the message.


That’s the idea- what’s your question?

Also, FYI right now the way your node is set it won’t trigger. First of all, you’re set to look for .payload IS (boolean, ‘FALSE’) not (string, ‘on’) The stuff in the Wait until must be an EXACT match.

The question is how I can get this node to work. Sure. Of course I tried this. I check the status of the binary sensor with a current state node and it is: "on"
So i configured the wait until node to wait until : msg.payload
is true. But the node always give me a timeout anyway.

There is a difference between a “true/false” and “on/off”.
Change it how NathanCu suggested and it should work

The binary sensor does not have a payload, it has a state that is false (or on/off, look in developer tools what the state is)

@AlmostSerious not if it set to boolean

@Hellis81 yes but if this is the current state of the entity:

Bildschirmfoto 2021-11-04 um 12.36.40

and the wait until node is configured like this:

it should pass the message, instead it goes to timeout…

Then set the wait until to state, and text “on”.

All states in Home Assistant is text

1 Like

You’ll have to disable the Check Against Current State option if you want to wait for a state change.

See Wait Until | node-red-contrib-home-assistant-websocket

I always have that option ticked.


And it works fine for me.

1 Like

I’m confused that your binary sensor has a state and a payload in its “current state”.
This is how it looks for me:
image

Payload is in the Object, and State is in the data field.
Maybe that is also where your issue comes from. Can you please post a screenshot with the data tab opened? As i believe this is where the wait node actually checks for the states.

Below is what I use for a wait node which works fine too.

2 Likes

Yep, bet money this is the problem for THAT example.

The first example was referencing msg.payload (which is a string - on or off according to your debug output) while the node was looking for boolean true or false.

The second example is referencing state - but state is encapsulated INSIDE the data field (msg.data.state) so as referenced (msg.state - bool true/false) it will never return true because it doesn’t exist there.

@terminus : Reference msg.payload, compare against (string, on / off) and it should work.

1 Like

msg.payload compared with string on/off didn’t work
msg.data.state compared with boolean true/false didn’t work

What really worked in the end is state compared with string true. This worked…

What a ride :slight_smile: Thank you all!