Well, I’ll try to keep it simple : see this thermostat as 2 components. It has a temperature sensor and a switch that controls the boiler. Let’s name those sensor and switch for the following. Those 2 can work together or not.
If you use only the thermostat alone, the sensor is the only thing that decides to turn on/off the switch. Something like sensor → switch.
Now, let’s put HA in this. HA controls the switch, the sensor isn’t directly needed. But the sensor can bring information to HA. So we get : sensor → HA → switch.
Now, let’s add more sensors : I want the bathroom to be hot when I wake up ? I put a thermostat in there, and HA does the work. And it goes : bathroom sensor → HA → switch.
Note that you don’t care about the temperature the thermostat brings.
You can add any temperature sensor that is compatible with HA, as much as it makes sense to you. Nice !
You can also have several devices to turn. A towel dryer in the bathroom, thermostatic valves that you can link to the main heating. It is now : sensor → HA → switch1/switch2…
But, there is one limit to the switching for this thermostat : even if you force the thermostat to “heating”, if it detects the temperature is already above the limit, it won’t start. So the switch won’t be to only turn to “heating” but also to set a high temperature to ensure it will work.
Something like :
action:
- service: climate.set_temperature
data:
entity_id: climate.thermostat
operation_mode: 'heat'
temperature: 27
- service: climate.set_operation_mode
data:
entity_id: climate.thermostat
operation_mode: 'heat'
Now, for monitoring reasons mostly, I created a sensor that calculates the reference temperature at home. It’s a mean between several sensors, giving more importance to one or another : I want the temperature sensors that are in the bathroom and in the living room to have more impact than the thermostat sensor that is in the basement. And I also increased the importance of the lowest value, to force the heating to start a bit earlier. That’s what I try to improve, using other inputs, like external temperature.
The sensor is like this :
temperature_maison:
friendly_name: "Température moyenne"
unit_of_measurement: '°C'
value_template: "{{ (([states.sensor.temperature_158d000227327d.state | float, states.sensor.temperature_158d00022880d3.state | float, states.climate.thermostat.attributes['current_temperature'] | float] | min + states.sensor.temperature_158d000227327d.state | float * 2 + states.sensor.temperature_158d00022880d3.state | float * 2 + states.climate.thermostat.attributes['current_temperature'] | float) /6) | round(2) }}"
Then the automation uses this value as one (of several) trigger. I use templates because I have an input_number to change the temperature I want at home easily.
As a basic example, this is the automation that stops heating if the mean temperature is 0.5° above the limit, or if a window is opened for more than 5 minutes :
- alias: 'A_ Chauffage central haut Stop'
trigger:
- platform: template
value_template: "{{ (states.sensor.temperature_maison.state | float) >= ((states.input_number.consigne_haut.state | float) + 0.5) }}"
- platform: state
entity_id: group.fenetres
to: 'on'
for:
minutes: 5
action:
- service: light.turn_off
data:
entity_id: light.gateway_light_7811dcb06b6b
- service: climate.set_operation_mode
data:
entity_id: climate.thermostat
operation_mode: 'off'
Note the light.turn_off : I’ve been testing this for months now, only adding the real thermostat last week. Heating is the kind of thing you’re not messing with if you don’t want complaints from wife and kids