Can I store entities to a variable?

Really new to this, so pardon me if the solution is obvious (or even obviously not possible), but is there a way to assign an entity_id to a variable such that I could simply use that in place of the entity_id throughout Node Red?

I use Z-Wave switches and sensors and have set up a few automations in Node Red, but one of my switch relays failed on me a few months ago.

So that got me thinking - if that were to happen to a switch for which I’ve already created several Node Red flows for, I’d have to comb through all my flows and replace all instances of my old entity_id with its replacement entity, when a static variable storing the entity_id could have made my job easier with just 1 change to the variable’s value.

Hope that make sense, and thanks in advance for any advice.

No, you can’t use variables in that fashion, but you CAN rename the device from Home Assistant and keep the same name as the device it replaced.

Ah right, didn’t think of it that way. Thanks, that works too!