Trigger smart plug when ecobee is running?

Hello all,

Just getting started in HA and so far it has been great but I am pulling my hair out on this one. I had to put an inline booster fan to one of my HVAC feeds but I would like to have that automatically turn on when the fan is running on my furnace or at least when actively heating or cooling via a smart plug I have. I can handle the rest, I just need some help triggering the automation or monitoring the state of hvac_action.

Best I can tell I should somehow monitor the hvac_action from my ecobee

Thanks!

In node-red this is just a matter of getting the thermostat entity property attributes for “HVAC on” or “fan on”. Then output… whatever.

I’m not very familiar with HA yaml programming, so I’m not sure how to do this automation for you. My Ecobee4 fan ON property attribute is “ data.attributes.fan” within my “climate.ecobee4_thermostat” entity

I’m sure someone will have a better response using native HA; but that’s the idea to do what you need

Thank you! There is a way to poll the ecobee with node red but it seems to only return “cooling” which doesn’t really help me. Is there something I’m not telling node red?

Well, in that case… this’ll help. Just change the Entity to your climate.ecobee name
The top sequence will output all your ecobee property attributes into a debug node. So you can use that to get property names, and trigger other events etc. (if you need help getting the attribute path (eg, * data.attributes.fan*) just let me know)

The other sequence just triggers when the fan turns on

When you just Poll the climate.ecobee it’ll just tell you its current HAVC mode. You need to specify its property attribute specifically

Heres the Node-Red flow import:


[{"id":"858850f8.d94488","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"52c73e97.af8e28","type":"trigger-state","z":"858850f8.d94488","name":"Trigger from FAN (ON)","server":"41c2e4cc.1954cc","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"climate.ecobee4_thermostat","entityidfiltertype":"exact","debugenabled":true,"constraints":[{"id":"am744octfc","targetType":"this_entity","targetValue":"","propertyType":"property","propertyValue":"data.attributes.fan","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"}],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":true,"state_type":"str","x":160,"y":300,"wires":[["51b61f9a.aac3f8"],[]]},{"id":"51b61f9a.aac3f8","type":"switch","z":"858850f8.d94488","name":"Grab & Output Fan (ON) Property","property":"data.attributes.fan","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":460,"y":300,"wires":[["d92c0a6e.364de8"],["539ac499.e951d4"]]},{"id":"53568538.44c624","type":"debug","z":"858850f8.d94488","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":510,"y":200,"wires":[]},{"id":"d31f5da9.43ff08","type":"api-current-state","z":"858850f8.d94488","name":"Get ALL Ecobee Attributes","server":"41c2e4cc.1954cc","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"climate.ecobee4_thermostat","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":300,"y":160,"wires":[["53568538.44c624"]]},{"id":"bfa8d3b.dc605b","type":"inject","z":"858850f8.d94488","name":"Inject","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":160,"wires":[["d31f5da9.43ff08"]]},{"id":"d92c0a6e.364de8","type":"debug","z":"858850f8.d94488","name":">> Turn AUX Fan Switch on.....","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":790,"y":260,"wires":[]},{"id":"539ac499.e951d4","type":"debug","z":"858850f8.d94488","name":">> Turn AUX Fan Switch off.....","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":790,"y":340,"wires":[]},{"id":"41c2e4cc.1954cc","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

EDIT: connect the “blocked” output from the trigger to the switch too. Otherwise it wont send “off” outputs

1 Like

I think I need help getting the attribute path also. After changing the entity ID to mine (climate.home) on the trigger and current status nodes I get the following:

constraint comparator: failed entity "climate.home" property "data.attributes.fan" with value undefined failed "is" check against (str) on

Sorry, that’s completely my fault (I should’ve tested it first). The trigger state node wont pass msg.data.attribute.fan. Heres a Poll (as you originally wanted) that will.

I try and avoid Polls running 24/7, but if you’re adding this to an existing flow, you could trigger it with a current state node and then add the switch after that.

But if you just want this to be looking for the fan to be on (every 60s) then this flow will work,


[{"id":"66093b3b.9510f4","type":"switch","z":"708e6065.155a58","name":"Grab & Output Fan (ON) Property","property":"data.attributes.fan","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":480,"y":300,"wires":[["9f00daf2.e4acb"],["652c0620.9fc4b8"]]},{"id":"9f00daf2.e4acb","type":"debug","z":"708e6065.155a58","name":">> Turn AUX Fan Switch on.....","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":810,"y":260,"wires":[]},{"id":"55a5a3a9.4c1acc","type":"poll-state","z":"708e6065.155a58","name":"Poll Ecobee Thermostat (60s)","server":"41c2e4cc.1954cc","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"climate.home","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":180,"y":300,"wires":[["66093b3b.9510f4"]]},{"id":"652c0620.9fc4b8","type":"debug","z":"708e6065.155a58","name":">> Otherwise...","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":760,"y":320,"wires":[]},{"id":"41c2e4cc.1954cc","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Keep in mind, the msg.payload will still be the current HVAC mode (eg, heat_cool, “cool”, “heat”) after the switch; but the switch will only allow the payload to continue if it detects msg.data.attributes.fan = on. Otherwise it spits out the payload to “otherwise” (aka. off). So you may need a change node payload after the switch; something like “set msg.payload to on” depending on how you flow goes.

Heres the flow with the change nodes…


[{"id":"66093b3b.9510f4","type":"switch","z":"708e6065.155a58","name":"Grab & Output Fan (ON) Property","property":"data.attributes.fan","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":480,"y":300,"wires":[["f0e498b1.8a9aa"],["9abb5a94.d98f4"]]},{"id":"55a5a3a9.4c1acc","type":"poll-state","z":"708e6065.155a58","name":"Poll Ecobee Thermostat (60s)","server":"41c2e4cc.1954cc","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":true,"entity_id":"climate.home","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":180,"y":300,"wires":[["66093b3b.9510f4"]]},{"id":"f0e498b1.8a9aa","type":"change","z":"708e6065.155a58","name":"Msg.payload >> on","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":260,"wires":[[]]},{"id":"9abb5a94.d98f4","type":"change","z":"708e6065.155a58","name":"Msg.payload >> off","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":340,"wires":[[]]},{"id":"41c2e4cc.1954cc","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

And if you want the specific property path for anything, run the inject node, and look here. This button will copy the attribute path.

Thank you so much, I was able to get it to work!!

Awesome. Glad it all worked out.

Just an update to this if anyone finds themselves here trying to run automations off the HVAC modes, or attributes through an ecobee thermostat.

Ecobee has a MINIMUM poll interval of around 3-5 minutes - There is no way around this. So if anyone is looking for an instant response when the HVAC turns on or off (or one of its attributes), you’re out of luck. But for automations like this one that just turns a booster fan switch on, or anything else that doesn’t need to be instant, it’ll work.

This has been a limitation of all ecobee thermostats for years, and to date, the only workaround is to get creative with a inline-switch of some sorts hooked directly up to the Fan or other trigger wires in your HVAC system itself that can independently send an “ON/OFF” signal to HA.

3 Likes

Thanks. I am doing exactly the same thing as in this thread, but am not using node-red. Now I know to stop trying to figure out why I have a delay of a few minutes.

For the “on” automation, I have this:

- alias: TurnOnOfficeFanSwitch
  trigger:
    platform: time_pattern
    minutes: '*'
  condition:
  - condition: template
    value_template: "{{ is_state_attr('climate.my_ecobee', 'fan','on') }}"
  action:
  - service: switch.turn_on
    entity_id: switch.fa483e1d878e29b7888iim
  id: f6243aa2b8da476bad607aa29daf5ae6

Is there any way to trigger this on the state of the fan attribute? Polling works ok, but offends me a bit.

I actually got creative and just grabbed one of those cheap magnetic door/window sensors and stuck it to a piece of paper by one of my vents in the basement. HVAC turns on… the air lifts the sensor. result = Fan on. Vents sop blowing air… sensor falls back down and shuts off the sensor. I discussed various ways to get this Ecobee on/off state instantly in another thread (i cant seem to find) by heres the initial concept of what im talking about. Its not pretty, but it works.

Door Window Mag Sensor to Trigger Ecobee ON/OFF state instantly

Another way would be to hook up a voltage sensor and an esp32 or NodeMCU to the fan wire directly on the furnace, and then send an mqtt message when the voltage goes high or low.

Out of curiosity, instead of using the Cloud-based ecobee integration for this purpose, has anyone tried it with the Local Push-based homekit_controller integration?

The HomeKit Controller integration communicates locally with the ecobee thermostat via the HomeKit protocol. This protocol is able to instantly report events so polling is not required.

I don’t have an ecobee thermostat but I do have several ecobee switches. They are supported by the homekit_controller integration which exposes each device as a switch and several sensors: temperature, light level, motion, and occupancy. All changes in sensor values are reported immediately. It’s fast enough to use motion detection as a trigger to turn on other lights.

Perhaps the thermostat’s fan mode is also reported instantly.

1 Like

Oh, most definitely. There’s probably 10 better ways to accomplish this immediate state change; but the mag sensor concept is just in the top list of “stupid-no-knowledge” solutions that can accomplish it.

FWIW, I’m doing this now. I have an Ecobee 3 Lite connected via HomeKit Controller. This gives me instant feedback from the thermostat instead of waiting the 3-5 minutes. I’m using the hvac_action state to trigger some smart plugs. Unfortunately, I do not see a fan state with the HomeKit Ecobee thermostat entity even though the Ecobee entity does have that. I was hoping to use that state but the hvac_action works well enough,

hvac_action represents what the HVAC system is currently doing as opposed to hvac_mode which is what the HVAC system is allowed to do.

For example, my thermostat’s hvac_mode is currently heat which means it is allowed to activate the furnace (when the ambient temperature falls below the target temperature). However, its hvac_action is currently idle because the furnace is not heating at the moment (ambient temperature is above the target temperature).

If you were to base it on the fan’s activity, it would report your HVAC system is operating even when just the fan is on (for air-circulation/ventilation purposes). Maybe you want it that way but I’m only interested when the furnace is actively heating and not whenever the fan is on.

Theoretically, you could create a History Stats sensor to monitor when the fan is running and the furnace is not heating (or the AC is not cooling). In other words, it would only track the time when the fan is running for air-circulation purposes only.