Choose no action -> Error?

If I use the choose action and end up with no actions in my action block, will this generate an error / warning?

I currently have conditions in the condition block to prevent this, but wonder if it is necessary.

- alias: 'Get Deck Tone Level'
  trigger:
  - platform: state
    entity_id: sensor.deck_bass_level
  - platform: state
    entity_id: sensor.deck_treble_level
  condition:
  - condition: or ### Do I need this? ###
    conditions:
    - condition: template
      value_template: "{{ states('sensor.deck_bass_level') != states('input_number.deck_bass_level') }}"
    - condition: template
      value_template: "{{ states('sensor.deck_treble_level') != states('input_number.deck_treble_level') }}"
  - condition: template
    value_template: "{{ states('sensor.deck_bass_level') not in ['Unknown', 'None', 'Unavailable'] }}"
  - condition: template
    value_template: "{{ states('sensor.deck_treble_level') not in ['Unknown', 'None', 'Unavailable'] }}"
  action:
  - choose:
    - conditions:
      - condition: template
        value_template: "{{ states('sensor.deck_bass_level') != states('input_number.deck_bass_level') }}"
      sequence:
      - service: input_number.set_value
        data:
          entity_id: input_number.deck_bass_level
          value: "{{ states('sensor.deck_bass_level')|float }}"
  - choose:
    - conditions:
      - condition: template
        value_template: "{{ states('sensor.deck_treble_level') != states('input_number.deck_treble_level') }}"
      sequence:
      - service: input_number.set_value
        data:
          entity_id: input_number.deck_treble_level
          value: "{{ states('sensor.deck_treble_level')|float }}"

99% sure nothing happens and no errors. It’s like an if statement without an else. The only thing this would guard against is populating the last_triggered.

Also, if you’re using templates it would probably be better if you put them in 1 templaet:

    - condition: template
      value_template: >
        {% set bass = states('sensor.deck_bass_level') %}
        {% set treble = states('sensor.deck_treble_level') %}
        {% set user_bass = states('input_number.deck_bass_level') %}
        {% set user_treble = states('input_number.deck_treble_level') %}
        {% set unknown = ['Unknown', 'None', 'Unavailable'] %}
        {{ (bass != user_bass or treble != user_treble) 
            and bass not in unknown
            and treble not in unknown }}
1 Like

So send one template to the sandbox for evaluation rather that doing it piecemeal.
Always done it that way but never actually thought about it.
Good rule of thumb
:+1: