Well in this case I need climate.basement_heat to change to whatever the climate.first_floor_heat is set to, which in this case is only heat or off.
If the thermostat on the first floor has more modes than just heat
and off
, and all you want is to focus on those two modes, change trigger
so it only activates for state-changes to heat
or off
.
#Thermostat Automation - Turn on basement if first floor turns on
- alias: Set basement thermostat
trigger:
- platform: state
entity_id: climate.first_floor_heat
to: 'heat'
- platform: state
entity_id: climate.first_floor_heat
to: 'off'
action:
service: climate.set_hvac_mode
entity_id: climate.basement_heat
data_template:
hvac_mode: "{{ trigger.to_state.state }}"
If the first floor thermostat only has two modes, heat
and off
, then pnbrucknerâs example is all you need to get the job done.
Thatâs one possibility. Another could be if the âsourceâ could be off, heat or cool, and the âtargetâ should be heat when the source is heat, but off if the source is off or cool, then that would be implemented differently. Hence the request for clarification.
But, it seems, the simple implementation is what is wanted.
I actually made a mistake. I need to look at the hvac_action state insated of hvac_mode. The idea is if the first floor in âheatingâ then set basement to heat mode.
This is what I have now, but it doesnât work:
#Thermostat Automation - Turn on basement if first floor turns on
- alias: Set basement thermostat
trigger:
platform: state
entity_id: climate.first_floor_heat
action:
service: climate.set_hvac_mode
entity_id: climate.basement_heat
data_template:
hvac_mode: >
{% if state_attr('climate.first_floor_heat', 'hvac_action', heating) %}
heat
{% else %}
off
{% endif %}
Because you did not quote heating
. Without quotes there would have to be a variable named heating
, which there isnât.
{% if state_attr('climate.first_floor_heat', 'hvac_action', 'heating') %}
Only set the basement thermostat to heat
mode when the first floor thermostat is actively heating?
Weird.
I can understand syncing the modes of the two thermostats at all times but not limited to when one is actively heating. Anyway, your automated house, your automations.
Yeah, I just answered how without thinking about why. Iâve played with the climate component in newer versions, but my main system is still running 0.95.4 (for many reasons), so I wasnât sure why heâd want to use that attribute vs the state (or even what that attribute actually meant.) Maybe he shouldnât be.
I can see how this could throw you off a bit. My basement is pretty much warmer than the rest of the house. I have radiant heat on all three floors. I didnât want to heat the basement by itself not to waist energy. For that reason I want to heat the basement only when the first floor is actually heating, not just in heat mode.
Iâd counter with âheat risesâ so whatever heating that occurs in the basement isnât wasted, it also warms (at the very least) the floor above it.
The arrangement youâve proposed (between the basement and first floor thermostats) simply means the first floor thermostat is the primary controller for both the first floor and basement. If the area being heated on both floors is nearly identical then allâs well. However, if the basement is larger, it means its temperature is likely to remain less than on the first floor (more volume to heat, less time allotted to heat it). Conversely, if the basement is smaller then its temperature will be higher than the first floor (less volume to heat, more time allotted to heat it).
Let us know if the arrangement works well for you.
If youâre concerned about non-essential heating of the basement, and youâre not a proponent of âheat risesâ, then just set the basement temperature to the barest livable minimum. Use an automation to turn up the temperatre
I see your logic. Iâll set the basement temp to a comfortable number. When the first floor is set to heat and the basement room temp is the same or above the set temp it wont heat the basement. I ended up using the modified original code, which works just fine.
#Thermostat Automation - Turn on basement if first floor turns on
- alias: Set basement thermostat
trigger:
platform: state
entity_id: climate.first_floor_heat
action:
service: climate.set_hvac_mode
entity_id: climate.basement_heat
data_template:
operation_mode: >
{% if is_state('climate.first_floor_heat', 'heat') %}
heat
{% else %}
off
{% endif %}
The code with hvac_mode: â{{ trigger.to_state.state }}â doesnât work. It doesnât trigger the basement thermostat.
Which version of Home Assistant are you using?
Climate integrations underwent a major change a few versions ago and no longer support operation_mode
(replaced with hvac_mode
). If operation_mode
works for you, then youâre not using a recent version (and when you upgrade, youâll need to modify your automation otherwise it will fail).
I am using v0.100.3. I updated my code with hvac_mode, which works, but the code you wrote up doesnât work.
#Thermostat Automation - Turn on basement if first floor turns on
- alias: Set basement thermostat
trigger:
- platform: state
entity_id: climate.first_floor_heat
to: 'heat'
- platform: state
entity_id: climate.first_floor_heat
to: 'off'
action:
service: climate.set_hvac_mode
entity_id: climate.basement_heat
data_template:
hvac_mode: "{{ trigger.to_state.state }}"
Redacted.
EDIT
OK, so a copy-paste error was the culprit. Glad to hear my example works for you.
Actually I stand corrected. Your code does work. I copied it wrong the first time. I apologize. Itâs definitely better than my code.
In my prviouse post I pasted the wrong version of the code. My apologies again. I am a mess today. This is the code that works. Both your code an my modified code with hvac_mode work, but your code is much cleaner and shorter.
#Thermostat Automation - Turn on basement if first floor turns on
- alias: Set basement thermostat
trigger:
- platform: state
entity_id: climate.first_floor_heat
to: 'heat'
- platform: state
entity_id: climate.first_floor_heat
to: 'off'
action:
service: climate.set_hvac_mode
entity_id: climate.basement_heat
data_template:
hvac_mode: "{{ trigger.to_state.state }}"
Whew! This thread is getting confusing because what you posted above isnât my example.
Whatever youâre using, I hope it serves you well.
Good luck!