#Calling variables within an automation

1 messages · Page 1 of 1 (latest)

wraith trout
#

So I know that HA doesn't support global variables, and that's fine. I've read though that variables defined within an automation only apply to the level they were defined in, and changes made to those variables at a different level actually define a new variable and don't change the value of the one you thought you were changing.

Eg I define a "test "variable as "value A" at the very start of an automation, then try updating that "test" variable inside a choose function to "value B", it will actually create a new variable that resides entirely inside of the choose function.

Firstly, is this true or have I fundamentally misunderstood variables inside automations/blueprints etc? Secondly, if this is true is there a way around it without having to create input_selects, input_texts etc?

brave canopy
#

If you have a test that variable will be available in a choose sequence, but if you change it in the choose sequence, that changed value will only be available in that sequence. But it doesn't create a new variable.

You can use this as a work around so you don't have to create input-helpers for every variable

viscid void
#

Since this is a blueprint that you presumably want to share with others I either make them create a helper or I create a variable using MQTT and use that.
Having people create a vadiable is easier to explain that The template.
For my personal stuff I'm not sharing as a blueprint, I use this as well. but when working with general population getting them to add a helper is hard enough.

wraith trout