Request: Top-level conditions for 'Choose' action

Right now, the ‘Choose’ action selects between several options, each with their own set of conditions. Often in a automation, I’ll want each of those options to include the same condition (e.g. “disable=no”).

It would be much easier if each ‘Choose’ action had an “And if (optional)” section (like automations do) which apply to each of the options in that action, but none of the other actions in the automation/script.

You can do that with an if then though?

- if:
  ... condition
  then:
    choose:
    - ...

You can do that with a condition in the And If section (or whatever it’s called)

And you can define variables before choose which encapsulate logic that multiple branches inside choose will need.

My choose blocks pretty much contain only the evaluation which determines if it’s going to execute, and then 1-2 actions (beyond 2 actions is usually a script).

By the time my choose blocks get hit, 75-80% of the business logic is known

In addition to what Petro said

If it applies to all the actions you just put it in the main automation conditions block.

You can also put conditions in the actions, but they will stop everything afterwards if false. So put your choose action last.

actions:
  - action: blah.blah
.
.
.
  - action: blah.blah
  - condition: state
    entity_id: sensor.foo
    state: bar
  - choose:
.
.
.