Hello everyone!
I have been using Node-RED to configure home automations during these past two years.
One of the first and most complex automations is related to different sets of window blinds (or "covers") in my house. I have 6 covers, 3 in each room, and I wanted them to open or close in sequence. So I created a flow that receives a list of devices and activates the first one. After the current device reports its status change (i.e. cover1 closed), the next one is activated and so on.
To do this, I use a "wait until" node that waits until the cover in msg.device updates its data.event.new_state.last_updated property. This has been working fine for two years.
Since the last update in Node-RED (I am in v4.0.2, and previously I was on v3.1.9) the "wait until" node is getting stuck after the first cover. It receives the device name in msg.device and acts when the first cover finishes moving, and then when it has to do this with the next cover, it gets stuck and only sends the message after the timeout.
I had to create a workaround to match this incorrect behavior, but I want this automation to be scalable (the covers that are supposed to be activated come in a msg.devices string, and then there's a function node that sends each one in order in msg.device).
I already checked that the devices are reporting the data.event.new_state.last_updated properly, I tried extending the timeout to check if it wasn't a delay issue, and I tried sending a msg.reset=true to the node before each blind, but it doesn't seem to change anything.
I would like to get any recommendations on how to solve this and go back to the "one wait until node" solution that worked previously. And please help me understand if there are any errors on my side or if this is a bug that should be reported and fixed.
[{"id":"b684b87c36e2067d","type":"ha-wait-until","z":"b84e61f8ff473dab","name":"","server":"8a86b0cc.b2bac","version":3,"outputs":2,"entities":{"entity":["{{device}}"],"substring":[],"regex":[]},"property":"data.event.new_state.last_updated","comparator":"is_not","value":"0","valueType":"str","timeout":"23","timeoutType":"num","timeoutUnits":"seconds","checkCurrentState":false,"blockInputOverrides":false,"outputProperties":[],"entityLocation":"data","entityLocationType":"none","x":480,"y":1400,"wires":[["1af19f883221ba84"],["79808095d9f78bed"]]},{"id":"969f931f45f11f87","type":"inject","z":"b84e61f8ff473dab","name":"","props":[{"p":"payload"},{"p":"device","v":"cover.ns1","vt":"str"},{"p":"devices","v":"cover.ns2,cover.ns3,end","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":1380,"wires":[["b684b87c36e2067d"]]},{"id":"1af19f883221ba84","type":"debug","z":"b84e61f8ff473dab","name":"continue_with_next_cover","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":730,"y":1380,"wires":[]},{"id":"79808095d9f78bed","type":"debug","z":"b84e61f8ff473dab","name":"cover_timeout_error","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":720,"y":1440,"wires":[]},{"id":"a73079c1926af00a","type":"inject","z":"b84e61f8ff473dab","name":"","props":[{"p":"payload"},{"p":"device","v":"cover.ns3","vt":"str"},{"p":"devices","v":"cover.ns2,cover.ns1,end","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":1440,"wires":[["b684b87c36e2067d"]]},{"id":"90ba6791db56944d","type":"ha-wait-until","z":"b84e61f8ff473dab","name":"cover1","server":"8a86b0cc.b2bac","version":3,"outputs":2,"entities":{"entity":["cover.ns1"],"substring":[],"regex":[]},"property":"data.event.new_state.last_updated","comparator":"is_not","value":"0","valueType":"str","timeout":"23","timeoutType":"num","timeoutUnits":"seconds","checkCurrentState":false,"blockInputOverrides":true,"outputProperties":[],"entityLocation":"data","entityLocationType":"none","x":470,"y":1540,"wires":[["4bb37e549cce9a70"],["e8ada4ecc423e379"]]},{"id":"2749ebfaf117ec0a","type":"switch","z":"b84e61f8ff473dab","name":"","property":"device","propertyType":"msg","rules":[{"t":"eq","v":"cover.ns1_living","vt":"str"},{"t":"eq","v":"cover.ns2_bathroom","vt":"str"},{"t":"eq","v":"cover.ns3_bedroom","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":290,"y":1580,"wires":[["90ba6791db56944d"],["27484dd9e94786e5"],["692ad3e8e5e3bdd7"]]},{"id":"27484dd9e94786e5","type":"ha-wait-until","z":"b84e61f8ff473dab","name":"cover2","server":"8a86b0cc.b2bac","version":3,"outputs":2,"entities":{"entity":["cover.ns2"],"substring":[],"regex":[]},"property":"data.event.new_state.last_updated","comparator":"is_not","value":"0","valueType":"str","timeout":"23","timeoutType":"num","timeoutUnits":"seconds","checkCurrentState":false,"blockInputOverrides":true,"outputProperties":[],"entityLocation":"data","entityLocationType":"none","x":470,"y":1580,"wires":[["4bb37e549cce9a70"],["e8ada4ecc423e379"]]},{"id":"692ad3e8e5e3bdd7","type":"ha-wait-until","z":"b84e61f8ff473dab","name":"cover3","server":"8a86b0cc.b2bac","version":3,"outputs":2,"entities":{"entity":["cover.ns3"],"substring":[],"regex":[]},"property":"data.event.new_state.last_updated","comparator":"is_not","value":"0","valueType":"str","timeout":"23","timeoutType":"num","timeoutUnits":"seconds","checkCurrentState":false,"blockInputOverrides":true,"outputProperties":[],"entityLocation":"data","entityLocationType":"none","x":470,"y":1620,"wires":[["4bb37e549cce9a70"],["e8ada4ecc423e379"]]},{"id":"4bb37e549cce9a70","type":"debug","z":"b84e61f8ff473dab","name":"continue_with_next_cover","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":750,"y":1560,"wires":[]},{"id":"e8ada4ecc423e379","type":"debug","z":"b84e61f8ff473dab","name":"cover_timeout_error","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":740,"y":1620,"wires":[]},{"id":"3d9c20ba546e81dc","type":"comment","z":"b84e61f8ff473dab","name":"Before update this worked","info":"","x":170,"y":1340,"wires":[]},{"id":"08d787c15d87e3d5","type":"comment","z":"b84e61f8ff473dab","name":"After the update I had to do this, which I don't find acceptable.","info":"","x":280,"y":1500,"wires":[]},{"id":"c0b82d09a88b7a22","type":"inject","z":"b84e61f8ff473dab","name":"","props":[{"p":"payload"},{"p":"device","v":"cover.ns1","vt":"str"},{"p":"devices","v":"cover.ns2,cover.ns3,end","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":1540,"wires":[["2749ebfaf117ec0a"]]},{"id":"9ea2b5decc7186d4","type":"inject","z":"b84e61f8ff473dab","name":"","props":[{"p":"payload"},{"p":"device","v":"cover.ns3","vt":"str"},{"p":"devices","v":"cover.ns2,cover.ns1,end","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":1600,"wires":[["2749ebfaf117ec0a"]]},{"id":"8a86b0cc.b2bac","type":"server","name":"Home Assistant R","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
Thanks!
Rodrigo