How to run actions based on Heating/Cooling/Fan State of Climate Entity?

Hello, I am trying to turn Z-Wave plugs based on the current state of a thermostat/climate entity. In particular my climate entity is an ecobee4 smart thermostat with a working integration - using the climate dashboard, I can control this thermostat and see its current state represented.

Here is the YAML I have written. However, when the heater comes on or the fan turns on, this automation does not run. Any ideas?


alias: Turn on Duct Fans
description: ''
trigger:
  - platform: state
    entity_id: climate.entry_thermostat
    attribute: hvac_action
    to: heating
  - platform: state
    entity_id: climate.entry_thermostat
    attribute: fan
    to: 'on'
  - platform: state
    entity_id: climate.entry_thermostat
    attribute: hvac_action
    to: cooling
condition: []
action:
  - type: turn_on
    device_id: 8bb527ca22e69f92290cc583dcb97089
    entity_id: switch.smart_plug_1_channel
    domain: switch
mode: single

Any ideas for what I am missing here?

No ideas. I do the exact same thing, but only for the cooling cycle (baseboard heat.)

Here’s my automation, created using the GUI:

- id: DuctFanOn
  alias: Duct Fan On When Cooling
  description: Start duct fan when air conditioner starts
  trigger:
  - platform: state
    entity_id: climate.1st_floor
    attribute: hvac_action
    to: cooling
  condition: []
  action:
  - type: turn_on
    device_id: ce7c496b1d8b4aa192247f83d79e2255
    entity_id: switch.ikea_of_sweden_tradfri_control_outlet_fea61a64_1
    domain: switch
  mode: single

First, have you verified that the automation doesn’t run, vs. running and doing nothing?
Second, have you “Run Actions” on the automation to be sure the action works?
Assuming you have, the problem is probably with the trigger. You can verify the attributes are what you’re looking for in Developer Tools / States. Like, does hvac_action go to “heating” or “heat”? If you can watch the actions changing in Developer Tools, it’s got to be something really stupid like a typo somewhere.

Sorry I’m no expert, maybe someone else here will see something obvious I’m missing.

Thanks for sharing that and your thoughts. I realized the issue. It’s Ecovee’s extremely slow online updates - by the time it was sending the state change in this particular instance, the heat had turned back off again. I’ve noticed before that even in the Ecobee native app on my phones, it takes a half dozen forced refreshes for state changes to actually show up.

So I’ll need to figure out a different way to trigger the duct fans which is really annoying. I had a static pressure switch mounted in my supply plenum which has now quit working on me. Will have to think of something else fast as my duct fans are vital for even heating in the winter.

Does anyone know if Nest updates more reliably? I’ve been so extraordinarily disappointed with Ecobee.

Glad you solved it. My Honeywell thermostat API only updates every five minutes, so I also get the 2-1/2 minute (on average) delay. But the Honeywell also ensures that my air conditioner doesn’t short-cycle, so I’ve never had a case where it shut off before the fan kicked on. Then again, my duct fan is just a booster for a remote room, so it’s not especially critical.

I think what you want is some way to sense that the blower in the air handler is powered.

I’ve done this using relays (contactors). You can get a relay with a 24VAC coil and connect to the output of the thermostat, or a 120 or 240VAC relay and connect directly to the terminals which power the blower motor.

Once you have a relay which closes a set of contacts when the blower is powered, you can connect them to the GPIO pins of whatever you’re running HA on, or tweak a door sensor by replacing the reed switch with two wires to the relay contacts. I’ve done both, and they’ve been reliable. Much better than counting on some cloud-based API.

Can you tie it to the temperature sensor in ecobee? You know what your sensor range is so this can give you a trigger. This means a lot of automations. Also on my ecobee 3 heat, cool and heat/cool stay set so they may be redundant triggers.

My other thought is to get a ‘Shelly em’ and put it on your HVAC fan. When HVAC fan turns on turn on the duct fan. and vice versa.

1 Like

I’ve looked into relays but I think that’s just a step too far for me personally in terms of electrical DIY. Might take another look though.

Am I reading it correctly that you are able to get live data soon enough from your Ecobee that it is useful for home assistant trigger automations? Unfortunately in my use case I’m not sure I can use the temp range although it is exposed to homekit.

Had not seen the Shelly EM before. Looks possibly a little simpler than a relay.

Yes I get nearly live date - within 60 seconds

do you have Polling setup in the integration?

Screenshot from 2021-10-28 11-08-36

It finally registered with me that you are not using the ecobee integration. Have you considered it and letting homekit run in parallel (if that is possible)

I have the Ecobee integration, with Live Polling enabled for updates. Unfortunately for whatever reason my update period does seem to be longer than 60 seconds - I would guess 5 minutes but it’s tricky to be sure.

I just plotted my ecobee temperature and it is updating between 2 and 30 minutes. It looks like it only updates when it changes. When I installed it appeared was updating faster maybe due to it being and and temperature changing faster. Mea culpa.

This is just an idea.


alias: Turn on Duct Fans
description: ''
trigger:
  - platform: state
    entity_id: climate.entry_thermostat
    attribute: fan
    from: auto
    to: 'on'
condition: []
action:
  - type: turn_on
    device_id: 8bb527ca22e69f92290cc583dcb97089
    entity_id: switch.smart_plug_1_channel
    domain: switch
mode: single

Thanks, I’ll take a look at this too. I think I am seeing the same sort of random updates from the ecobee integration entities. I’m working from home today and have set the fan to run for 30 minutes out of the hour - i will listen and have added phone notifications to the automation to see how big the gap between ecobee calling for heat/fan and the integration seeing the call truly is. Was pretty desperate to get the duct fans working last night as I didn’t want the system to struggle with my night heating settings.

I was watching my ecobee in the developer tools. The fan is never changing from auto to ‘on’ it is always ‘on’.

This could be a bug.

Thanks

Oddly enough it works for me. I’m not tracking in dev tools, but using the Lovelace default Climate/Thermostat Dashboard Card. It shows “Idle” - “Fan” - “Heating” and it looks like it takes about 60 seconds for home assistant to get the latest polling.

Also, I keep getting this message in the log that tracks my duct fan automation that is the subject of this post. Anyone know why the automation becomes “unavailable”?

Here’s the problem. Ecobee API maximum allowable poll rate is 3 minutes. If the blower is only running for a 5 minute interval (which is common when you have the fan set to the “recirculate” setting and short intervals can definitely also happen with a gas-fired furnace blower) then theres a decent chance you miss half of the blower cycle pretty often.

So, final answer is the Ecobee integration is nice for gradual temperature information over time, but not for instant triggers based on system activity. If your system is based on gradual heating (baseboard heating, heat pump) not a problem. For me I’ll need to identify a different route. And there is no way around that because of Ecobee API limitations.

In the meantime, I’ll use this z-wave smart plug solution paired with the Ecobee cloud system status to run my duct fans as it is more reliable than my static pressure sensor switch has been. But will try to update this thread when I find a more permanent solution.