How do I automate my Keen vents to work with Ecobee Thermostat?

Hello Home Assistant community, I started my transition from SmartThings to Home Assistant a couple of years back but have been forced to finally move some of my most critical automations over when SmartThings killed their Groovy APIs at the start of this year. For the most part, the transition has been relatively straightforward but I am facing one major challenge - how do I automate my Keen smart vents to work in tandem with my Ecobee Thermostat and keep the temperature around my house relatively even. I looked for existing blueprints that could adjust the vents in each room but wasn’t able to find any so I instead tried to create my own automation and got struck 10 seconds in. I want to build an automation that worked as follows…

When my thermostat starts heating or cooling OR the temperature in the room changes DO the following:
IF heating, set the vent in the room as follows:

  • Temp in room is less than thermostat setting - 1F → 100%
  • Temp in room is between thermostat setting - 1F and thermostat setting + 1F → 50%
  • Temp in room is is greater than thermostat setting + 1F → 10%

IF cooling, set the vent in the room as follows:

  • Temp in room is greater than thermostat setting + 1F → 100%
  • Temp in room is between thermostat setting + 1F and thermostat setting - 1F → 50%
  • Temp in room is is greater than thermostat setting - 1F → 10%

However, I didn’t see any option to trigger an automation based on Ecobee thermostat state changing:

What am I missing? Is this a limitation of Home Assistant’s automations, the Ecobee integration, or the underlying Ecobee API?

P.S. Triggering automations based on my Ecobee Thermostat state changing is possible in SmartThings so I was very surprised to find that functionality missing in Home Assistant:

I think I finally figure it out. I was able to use the state trigger with the fan attribute of my Ecobee thermostat. It’s still a work in progress but this is what my automation looks like now:

alias: Bedroom vent control
description: ""
trigger:
  - platform: state
    entity_id:
      - climate.hallway_thermostat
    attribute: fan
    to: "on"
  - type: temperature
    platform: device
    device_id: 1afcd718ae8e379d925b903acaaa2457
    entity_id: sensor.bedroom_meter_temperature
    domain: sensor
    above: 68
  - type: temperature
    platform: device
    device_id: 1afcd718ae8e379d925b903acaaa2457
    entity_id: sensor.bedroom_meter_temperature
    domain: sensor
    above: 70
  - type: temperature
    platform: device
    device_id: 1afcd718ae8e379d925b903acaaa2457
    entity_id: sensor.bedroom_meter_temperature
    domain: sensor
    below: 68
condition:
  - condition: state
    entity_id: climate.hallway_thermostat
    attribute: fan
    state: "on"
action:
  - if:
      - type: is_temperature
        condition: device
        device_id: 1afcd718ae8e379d925b903acaaa2457
        entity_id: sensor.bedroom_meter_temperature
        domain: sensor
        above: 70
    then:
      - type: turn_off
        device_id: 71a8a1f635f6d9ef63c957cd00ca1c1a
        entity_id: light.bedroom_vent
        domain: light
    else:
      - if:
          - type: is_temperature
            condition: device
            device_id: 1afcd718ae8e379d925b903acaaa2457
            entity_id: sensor.bedroom_meter_temperature
            domain: sensor
            above: 68
        then:
          - service: light.turn_on
            data:
              brightness_pct: 50
            target:
              device_id: 71a8a1f635f6d9ef63c957cd00ca1c1a
        else:
          - if:
              - type: is_temperature
                condition: device
                device_id: 1afcd718ae8e379d925b903acaaa2457
                entity_id: sensor.bedroom_meter_temperature
                domain: sensor
                below: 68
            then:
              - service: light.turn_on
                data:
                  brightness_pct: 100
                target:
                  device_id: 71a8a1f635f6d9ef63c957cd00ca1c1a
mode: single

I still want to:

  1. Turn it into a blueprint so it can easily be applied to all the rooms in my house
  2. Use offsets from the thermostat setting instead of fixed numbers for the temperature thresholds
  3. Add safety protections to prevent pressure build up and vent overheating