Hi, I’m stumped on what I’m sure to many is a basic automation, but it’s kicking my butt and hoping you can help. I’ve tried reading the docs, searching, AI, etc and either I’m not getting it or this really is an odd trigger to locate.
I have HAOS installed on my own server (latest version updated), I’m trying to build an automation that turns on my dehumidifier when my AC fan is running (cooling or just the fan). I have a Midea dehumidifier connected with the “Midea AC LAN” integration (from HACS) and my Nest thermostat is connected via “Nest Legacy” integration (also from HACS). I can turn the dehumidifier on and off, that’s no issue - I just can’t find the trigger entity that shows when the HVAC fan is running.
There is a “fan.den_den_thermostat_fan” entity with these attributes:
preset_modes: null
percentage: 0
percentage_step: 100
preset_mode: null
attribution: Data provided by Google/Nest
supported_features: 49
but as far as I can tell I can only get it to turn the fan off/on manually (like a button) - it doesn’t appear to show feedback when it’s on from the “auto” built into the stat.
I also have the entity “climate.den_den_thermostat” with these attributes:
hvac_modes: off, heat, cool, heat_cool
min_temp: 48
max_temp: 90
target_temp_step: 1
fan_modes: auto, on
preset_modes: none, eco
current_temperature: 77
temperature: 78
target_temp_high: null
target_temp_low: null
current_humidity: 56
fan_mode: auto
hvac_action: cooling
preset_mode: none
attribution: Data provided by Google/Nest
supported_features: 411
Am I overlooking something entirely? I’ve tried/tested a lot but nothing seems to just reflect when the fan is running (AC or otherwise). All the other entities are basic things like temp, humidity, etc so nothing I can see that would correlate to this specific trigger.
So that’s not working. I can copy/paste it in YAML so it looks correct in the automation, but when the conditions occur (fan on) it’s just not triggering. I tried manually messing with it in the visual interface and there just isn’t an “on” of “off” attribute in the dropdown. They only have 3:
Any state (ignoring attribute changes)
Unavailable
Unknown
I can obviously create a custom attribute or code it in the YAML (which is how I determined it’s not triggering) but I don’t think it’s getting a “state update” from anything.
So I did that and it stays “off” even when the HVAC is running. It only changes when I turn the fan on/off manually. My nest is configured to (obviously) run to cool to temp, but to also run just the fan for circulation for 15 minutes every hour if the AC doesn’t need to run. The dehumidifier doesn’t do nearly as much without the circulation so I was hoping to tie them together for efficiency.
Am I looking at this with blinders? Should I consider trying to run the dehumidifier based on temp triggers from the climate entity instead?
Thank you for helping and teaching me troubleshooting along the way.
No. If I wasn’t clear, it’s my HVAC fan - the same one that runs for heating/cooling. The nest thermostat controls it (hardwired) for circulating the heated/cooled air, but it can also run just the fan itself without kicking on the compressor or heater for circulation. This is why it’s confusing to me too - fan entity seems to only serve as a manual on/off switch with no feedback. I can manually cycle it and get a state change but that’s it. The “automatic” fan control coming from the climate entity seems to be what I’m after, but the only state change tied to the climate entity itself is whatever the “hvac_modes” is set to (off, heat, cool, etc) and those are manual settings. Of the climate entity attributes (listed above), none seem to reflect the specific conditions I’m going for as a trigger.
And just in case I’m misunderstanding your question entirely, the dehumidifier is WiFi controlled. I can run it from the Midea app, the Google home app, or now (with the integration) the HA dashboard without issue.
Then that’s not the switch you are looking for if it’s not changing with the hardware.
What you describe sounds (to me) like it may be found under climate as you said that it is part of a thermostat…
You will likely need to set up a template binary sensor that combines data points to get a “is the HVAC blower running” sensor that covers all the bases. First, the fan entity’s state (in case someone just turns that on). Then from the climate entity… the hvac_action attribute having a value of cooling or heating, which normally means the blower is running since there is active heating or cooling happening. Last, the fan_mode attribute, which should have a value of on if you switch the thermostat into “fan_only” mode.
{{ is_state(`fan.den_den_thermostat_fan','on') or
state_attr('climate.den_den_thermostat','hvac_action') in ['cooling','heating'] or
is_state_attr('climate.den_den_thermostat','fan_mode','on') }}
These are helpers, right? I was reading about these last night and was waiting for another response before asking if it might help. I’m gonna dig into this a little more and see what I can figure. I think I’m gonna have to figure the attribute “states” for hvac_action because I see “cooling” and “idle”, I have to assume your “heating” is the other but since it’s 90+ outside I hadn’t checked.
In your experience do you just code these in the helper interface, or do you find it easier using an integration like “Template”
Thanks so much for the reply! I have coding and computer experience, but HA is new to me so I’m reading the docs and trying to get up to speed, but there’s still a lot of stuff I just don’t know exists yet!
A state-based Template binary sensor can be set up using the Helpers GUI, but they can also be created via YAML configuration. YAML configuration provides extended functionality, but really isn’t necessary for what I described previously.
The three values the attribute can have, other than “off”, are listed in the Climate integration docs… so there’s nothing for you to figure out.
The value idle means the thermostat mode is set to “Cool”, “Heat” or “Heat-Cool”, but isn’t actively heating or cooling. In most cases this means the blower fan is not running.
I use both, depending on the use case. In practice that means I have the majority of my state-based template entities set up through the Helpers GUI.
Thanks again for the response, especially the link to the climate docs - obviously very useful, and I should be ashamed I hadn’t seen that yet in my digging.
So I did a little digging and I’ve found another bump in the road - maybe someone can help me think this through further because I’m stuck again and maybe I’m missing something obvious. Here’s my thoughts based on your recommendation of setting up this specific template:
The “fan” entity is there to catch manual on/off, so that’s fine but doesn’t give me any autonomy (ultimately the goal, but this still makes sense to have) - so this doesn’t trigger anything
“hvac_action” works fine for heat/cool cycles, but during fan-only reports “idle” (not cooling/heating) so this doesn’t trigger anything
“fan_mode” is another manual change (set the fan to Auto or On) and doesn’t update when Nest is running the fan, so this condition fails to trigger also
Does my logic make sense?
I’ve been monitoring the other attributes off and on throughout the day and I see nothing in the fan or climate entities that can combine to give me what I need. If I need to settle for just the hvac_action, it’s better than nothing but definitely not ideal. I’m open to any suggestions or maybe a different way to achieve this if I’m having a “forest from the trees” moment.
The climate entity stays showing whatever you manually set the “hvac_modes” attr to, so “off, heat, cool, heat/cool”. So both of mine, running or not, just say “cool”. As for the temperature attr value, it appears to be whatever I set my target temp to, and it stays that unless I change it.
For the moment I used your idea from earlier to at least give me a trigger based on the HVAC running, I’m testing that out now - but I can already see it should trigger because I can see the state change history. It’s a start.