Declare Automation Variables at top level?

In an automation, i can declare variables in the action block as in:

actions:
  - variables:
      local_debug: false
...

But these are only available within the actions block. Is there a way (or a plan) to be able to declare variables at the top level so they are available for both conditions and actions? Essentially do this:

triggers:
  ... my triggers here ...
variables: 
  ... declare variables here ... 
conditions:
  ... conditions here using variables ....
actions:
  ... actions here using variables ....

I know i can use templates to accomplish this, but this seems like a logical place to be able to declare variables.

Quick guide to variables in automations

1 Like


thank you! thank you! thank you!

1 Like