Hey guys.
I am desperate. I just spent 2 days configuring a generic thermostat but I keep getting stuck (and I am pretty sure that at some point in the past two days it was working … until I “fixed” something).
The situation:
I have a group of thermostats for my office radiators. The work fine as group in a climate entity (climate.kellerburo_group
). I then purchased an external temperature sensor (sensor.lumi_lumi_weather_temperature_2
) and wanted to combine it with said group. It is my understanding (but maybe I am wrong?) that I have to put climate and sensor together in a generic_thermostat (climate.kellerthermostat
) to have the climate entity use the external sensor as temperature reference (instead of the internal one). I also figured out that I would have to build a template switch (switch. toggle_heater_office
) to toggle between “heat” and “off” – because that is how the generic_thermostat works.
To further complicate things, I added a slider (input_number.slider_external_max
) for setting the max temperature via UI. But that does not seem to be the problem, as it works fine when trying everything in the dev tools.
The config:
switch:
- platform: template
switches:
toggle_heater_office:
friendly_name: "Toggle heating in office"
value_template: "{{ not is_state('climate.kellerburo_group', 'off') }}"
turn_on:
- service: climate.turn_on
target:
entity_id: climate.kellerburo_group
- service: climate.set_temperature
target:
entity_id: climate.kellerburo_group
data_template:
temperature: "{{ states('input_number.slider_external_max')|float }}"
hvac_mode: "heat"
target_temp_high: "{{ states('input_number.slider_external_max')|float + 3 }}"
target_temp_low: "{{ states('input_number.slider_min')|float }}"
turn_off:
- service: climate.set_hvac_mode
target:
entity_id: climate.kellerburo_group
data:
hvac_mode: "off"
- service: climate.turn_off
target:
entity_id: climate.kellerburo_group
climate:
- platform: generic_thermostat
name: Kellerthermostat
heater: switch.toggle_heater_office
target_sensor: sensor.lumi_lumi_weather_temperature_2
min_temp: 15
max_temp: 30
ac_mode: false
target_temp: 17
cold_tolerance: 0.3
hot_tolerance: 0.4
min_cycle_duration:
seconds: 5
initial_hvac_mode: "off"
away_temp: 16
precision: 0.1
comfort_temp: 24
The result:
For testing, I added a thermostat card for the climate_group, one for the generic_thermostat and a button for toggling the switch to the UI.
- The switch and the group work together just fine. When I toggle via button, the climate_group turns on (“heat”) and off just fine. Also: When I heat via the thermostat card, the toggle correctly represents the current on/off state.
- Turning off the group (and the toggle) via the generic_thermostat also works just fine.
- Turning on the group (and the toggle) via the generic_thermostat does not work though. When I paste the service call (“turn_on” section from the fake switch) from above in the home assistant dev tools, it turns the climate_group on as expected – but via the thermostat card in the UI, it fails. Turning on the generic_thermostat with the same service-call (I just replaced the group entity with the generic one) via dev tools also fails.
I just can’t get my head around what is happening here. There is no error entry in the logs, and the logbook also doesn’t help. Does anybody have an idea what’s going one here?