Need help on scheduling fan automation for Ecobee 3

I have my Ecobee 3 integrated with HA and would like to use HA to have the furnace fan turn on every hour for 15 minutes between the hours of 3 pm to 11pm. I found the service climate.set_fan_mode can be set to on or auto so I set up a test pair of automations to turn the fan on at 16:00 and back to auto at 16:15.
Is there a way to set it up so that one automation to run every hour for 15 minutes from 15:00 to 23:00?


alias: Ecobee Fan On
description: ''
trigger:
  - platform: time
    at: '16:00:00'
condition: []
action:
  - service: climate.set_fan_mode
    target:
      device_id: 50e42d24dd076c13aa4b3cf10887db27
    data:
      fan_mode: 'on'
mode: single

Something like this:

alias: Ecobee Fan On
description: ''
trigger:
  - platform: time_pattern
    minutes: 0
  - platform: time_pattern
    minutes: 15
condition:
  - condition: time
    after: '15:00:00'
    before: '23:00:00'
action:
  - service: climate.set_fan_mode
    target:
      device_id: 50e42d24dd076c13aa4b3cf10887db27
    data:
      fan_mode: "{{ 'on' if trigger.now.minute == 0 else 'auto' }}"
mode: single
1 Like

Just a small typo-

condition:
  - condition: time
    after: '15:00'
    before: '23:00'

Indeed, good catch. Edited.

Thanks @rccoleman so far it looks to be working. I’ll update here if any issues. Much appreciated!

Simplistic alternative (triggers only at the specified times):

alias: Ecobee Fan On
trigger:
  - id: 'on'
    platform: time
    at:
    - '15:00:00'
    - '16:00:00'
    - '17:00:00'
    - '18:00:00'
    - '19:00:00'
    - '20:00:00'
    - '21:00:00'
    - '22:00:00'    
    - '23:00:00'
  - id: 'auto'
    platform: time
    at:
    - '15:15:00'
    - '16:15:00'
    - '17:15:00'
    - '18:15:00'
    - '19:15:00'
    - '20:15:00'
    - '21:15:00'
    - '22:15:00'    
    - '23:15:00'
action:
  - service: climate.set_fan_mode
    target:
      device_id: 50e42d24dd076c13aa4b3cf10887db27
    data:
      fan_mode: "{{ trigger.id }}"

Hi @rccoleman I had to remake my HA installation and now this automation has the error message below. Any thoughts on how to resolve? Thanks

Error: Error rendering data template: UndefinedError: ‘dict object’ has no attribute ‘now’

I don’t see how setting up the system again would change anything in this automation. Can you show your code?

You could try changing the fan mode template to this:

fan_mode: "{{ 'on' if now().minute == 0 else 'auto' }}"

Yes here is the full yaml:

alias: Ecobee Fan On test
description: ''
trigger:
  - platform: time_pattern
    minutes: '0'
  - platform: time_pattern
    minutes: '15'
condition:
  - condition: time
    after: '15:00:00'
    before: '23:00:00'
action:
  - service: climate.set_fan_mode
    target:
      device_id: 0a610274af603e22634b6d42150ac6f1
    data:
      fan_mode: '{{ ''on'' if trigger.now.minute == 0 else ''auto'' }}'
mode: single

Your quotes are wrong. Either double quotes inside and single quotes ourside the template or vice versa. You are using two single quotes inside the template.

fan_mode: "{{ 'on' if trigger.now.minute == 0 else 'auto' }}"
mode: single

Thanks, actually your initial suggestion works perfectly