Choose automation keeps defaulting

Hi,

I’m trying to figure out why this automation keeps defaulting on trigger, for example if I manually change the numeric state of the sensor.windgust to 31 in the set state option for dev tools, it defaults as opposed to turning off the switch. Switch is on so initial conditions pass.

thanks

alias: Turn off Inflatables during high winds and time
description: Turn off inflatables during high wind and time scenarios
trigger:
  - platform: numeric_state
    entity_id: sensor.windgust
    above: 15
    for:
      hours: 0
      minutes: 1
      seconds: 30
    id: low gust
  - platform: numeric_state
    entity_id: sensor.windgust
    above: 30
    id: high gust
  - platform: time
    at: "23:00:00"
    id: off time
  - platform: time
    at: "06:00:00"
    id: on time
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - low gust, high gust, time off
          - condition: state
            entity_id: switch.front_outdoor_plug
            state: "on"
        sequence:
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.front_outdoor_plug
          - service: notify.mobile_app_sony_xperia_zx1
            data:
              message: >-
                The front lawn inflatables have turned off because the
                {{trigger.id}} condition has triggered.
              title: Inflatables
          - service: notify.mobile_app_iphone
            data:
              message: >-
                The front lawn inflatables have turned off because the
                {{trigger.id}} condition has triggered.
              title: Inflatables
      - conditions:
          - condition: trigger
            id: on time
          - condition: state
            entity_id: switch.front_outdoor_plug
            state: "off"
        sequence:
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.front_outdoor_plug
          - service: notify.mobile_app_sony_xperia_zx1
            data:
              message: >-
                The front lawn inflatables have turned on because the
                {{trigger.id}} condition has triggered.
              title: Inflatables
    default:
      - service: notify.mobile_app_sony_xperia_zx1
        data:
          message: Front Lawn Inflatables Error
          title: A trigger for the inflatables occurred, but no action was taken.
mode: single

The Trigger Condition can accept multiple id values but they must be presented as a list.

action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - low gust
              - high gust
              - time off
          - condition: state
            entity_id: switch.front_outdoor_plug
            state: "on"
        sequence:
2 Likes

thank you, sir! that was indeed it.

Cheers!

1 Like