Automation to Toggle Switch Depending on Fan State Not Working

Hi All,

I’m trying to create an automation that triggers my boolean helper to change state but it’s not functioning. Not sure why (boolean toggle works fine to trigger scripts to turn on and off my ecobee fan).

alias: Sync Ecobee Fan Mode with Helper
description: ""
triggers:
  - entity_id: climate.home
    attribute: fan_mode
    trigger: state
actions:
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ state_attr('climate.home', 'fan_mode') == 'on' }}"
        sequence:
          - target:
              entity_id: input_boolean.ecobee_fan_toggle
            action: input_boolean.turn_on
            data: {}
      - conditions:
          - condition: template
            value_template: "{{ state_attr('climate.home', 'fan_mode') == 'auto' }}"
        sequence:
          - target:
              entity_id: input_boolean.ecobee_fan_toggle
            action: input_boolean.turn_off
            data: {}
mode: restart

I test your automation with the fan mode on and off and it worked as expected

alias: Sync Ecobee Fan Mode with Helper
description: ""
triggers:
  - entity_id:
      - climate.living_room
    attribute: fan_mode
    trigger: state
actions:
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ state_attr('climate.living_room', 'fan_mode') == 'on' }}"
        sequence:
          - target:
              entity_id:
                - input_boolean.test
            action: input_boolean.turn_on
            data: {}
      - conditions:
          - condition: template
            value_template: "{{ state_attr('climate.living_room', 'fan_mode') == 'off' }}"
        sequence:
          - target:
              entity_id:
                - input_boolean.test
            action: input_boolean.turn_off
            data: {}
mode: restart

Have you tested each individual action? Does ‘on’ work and ‘auto’ fails?

Ensure you are referencing the correct fan modes by referencing the device in Developer Tools

That’s good news . . . means my logic was right at least…

Just tested both, neither worked. Used my phone Ecobee app to change fan mode, no change to my boolean toggle switch in HA


Resolved. Just wasn’t being patient enough. Takes about 45-75 seconds after the state change for the binary toggle to change. In triaging I did notice that the actual Ecobee app apparently doesn’t have this sync built in because often times it’s telling me the fan is on when it’s been turned off from HA. Maybe Ill ping their devs to encourage them to create a sync automation :wink: