Resend value if entity is unavailable

All,

I’m “sending” a value out of a node-red calculation to an entity using the action node with a number.set_value action.

In rare occasions, the entity is unavailable for a short moment. If the action node is called in that moment, the value is lost. Is there a way to “resend” (or hold back) the set_value until the entity is available?

I was thinking that the wait_until node could potentially do this, but I couldn’t figure out to configure it to wait until the entity is available…

Any help appreciated. Thanks!

Stefan

Yes, a wait-until node is what you need. Set it to wait until the state is not unavailable.

Thanks a lot, sounds reasonable. Like this is correct?

grafik

Was unsure, as this checks the state of a number entity against a string, which seemed like a type mismatch to me…

When Home Assistant sends an entity’s state to a client, it always converts the state to a string. So all states in Node-RED are strings.

1 Like

Got it, now that makes sense.

Thanks a lot!