Wait until and variable entity_id

Hello,
In the “wait until” node I would like to use information from the msg.payload. Basically I need the wait until to use a variable.
The flow is an simple example to explain what I want to do. In a function I create the msg.payload using a variable and then I call “wait until”. In my example the cover.window_bedroom exists. If I use cover.window_bedroom in entity_id it works. Whatever I use based on empty entity_id (it works for current state), msg.payload, msg.payload.entity_id it fails and I have to wait the timeout.
So my question, is can entity_id in wait until be a variable (or based on a variable)?
I am using hass.io and the Node-Red add-on.
Thanks for helping.
GV

[{"id":"3d6158.e8db3ea8","type":"ha-wait-until","z":"3bc37295.bad07e","name":"","server":"d28c9492.f419c8","outputs":2,"entityId":"msg.payload.entity_id","property":"attributes.current_position","comparator":"is","value":"0","valueType":"num","timeout":"5","timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":false,"blockInputOverrides":true,"x":480,"y":480,"wires":[[],["56b488c5.3f09a8"]]},{"id":"d28c9492.f419c8","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

function node

msg.payload = {
  entityId = "cover.window_bedroom";
}

return msg;

Thanks for you answer, but, according to my system the syntax is not valid:

I am fairly new in nodered and js… But it looks like it is not correct!
GV

msg.payload = {
  entityId: "cover.window_bedroom"
}

return msg;

Great! It works. Now, I am trying to understand!!
I have before the wait until another node where I test the current_state.

Now I have for the function before current_state

msg.payload = {
  entity_id: "cover.window_bedroom"
}

And for wait until:

msg.payload = {
  entityId: "cover.window_bedroom"
}

With these two it works. The first one uses entity_id and the second entityId !
Is there a reason for the syntax to be different?
How can I figure which one to use?

GV

You can find what nodes take as inputs in the info panel in NR.

Current-state node:

Wait-until node:

The reason the syntax differs is that I am using camelcase on the new nodes I make and I just haven’t had a chance to update the older ones to match.

OK. Thanks for the explanation and your help.
NodeRed and HA integration is really fantastic!
GV

@greengolfer any chance you can share the full flow? This seems interesting and something im trying to implement thats similar but im getting totally lost

I have never really finished… This was for my velux covers. It was useful during summer, but, I couldn’t finish :frowning: in time.
So, I have parked this for the time being. I will go back to it (with 6 more months of experience) in spring.
I will share when (re)done nicely.
GV

can the timeout value from a variable (flow or global)?

According to the node help:

  • timeout
  • timeoutUnits

so msg.timeout and msg.timeoutUnits to be used. You can set these messages from a variable in a change node.

GV

Thanks! I was looking if in the “wait until” node itself we can use like {{flow.get(“abc”)}}. You suggest definitely works, just need to add a change node or function node before the wait until node.

It do not work for me (((

[{"id":"cf239ad9.c76598","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"7b200786.6e8a88","type":"inject","z":"cf239ad9.c76598","name":"","props":[{"p":"payload.timeout","v":"5","vt":"num"},{"p":"payload.timeoutUnits","v":"seconds","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":200,"y":210,"wires":[["ed6806b2.ea1bd8","88f77850.edce78"]]},{"id":"ed6806b2.ea1bd8","type":"debug","z":"cf239ad9.c76598","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":470,"y":135,"wires":[]},{"id":"bcf5d455.be4718","type":"debug","z":"cf239ad9.c76598","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":515,"y":285,"wires":[]},{"id":"1c399e9c.2c8f91","type":"function","z":"cf239ad9.c76598","name":"Cancellation Message","func":"msg.tts = {}\nmsg.tts.message = \"Действие отменено!\"\nmsg.tts.speaker = \"media_player.google_home_mini_livingroom\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":610,"y":195,"wires":[["ed6806b2.ea1bd8"]]},{"id":"88f77850.edce78","type":"ha-wait-until","z":"cf239ad9.c76598","name":"CANCEL Action","server":"63f11f83.adf4c","outputs":2,"entityId":"script.system_cancel_trigger","entityIdFilterType":"exact","property":"state","comparator":"is","value":"on","valueType":"str","timeout":"111","timeoutType":"num","timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":380,"y":210,"wires":[["1c399e9c.2c8f91","ed6806b2.ea1bd8"],[]]},{"id":"63f11f83.adf4c","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

It is a bug?
Here is a thread about with details desctiption and screenshots Wait until Node - Bug? Timeout definition

It works to you?