Generic thermostat - automation with input_boolean

Hi there,

I will use the generic thermostat to control my underfloor heating.
The generic thermostat should only be used if the input_boolean “Winterzeit” is on.

dont laught :smiley: but I asked Copilot to write me an automation :smiley:

I am not really aware if this code is correct or it will work…

Can anyone doublecheck and explain me if this will works:

automation:
  - alias: "Steuerung FuBoHz Esszimmer"
    trigger:
      platform: state
      entity_id: input_boolean.winterzeit
      to: "on"
    action:
      - service: climate.set_temperature
        data_template:
          entity_id: climate.fubohz_esszimmer
          temperature: "{{ states('input_number.heiztemperatur') | float }}"

what should I write in the "input_number.“heiztemperatur”?

in my config.yaml I added this:

climate:
  - platform: generic_thermostat
    name: FuBoHz-Esszimmer
    unique_id: fubohz_esszimmer
    heater: switch.fubohz_esszimmer
    target_sensor: sensor.temp_esszimmer_temperatur
    min_temp: 19
    max_temp: 22
    ac_mode: false
    target_temp: 21
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 5
    initial_hvac_mode: "off"
    #away_temp: 16
    precision: 0.1

  - platform: generic_thermostat
    name: FuBoHz-Wohnzimmer
    unique_id: fubohz_wohnzimmer
    heater: switch.fubohz_wohnzimmer
    target_sensor: sensor.temp_wohnzimmer_temperatur
    min_temp: 19
    max_temp: 22
    ac_mode: false
    target_temp: 21
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 5
    initial_hvac_mode: "off"
    #away_temp: 16
    precision: 0.1
´´´
1 Like
{{ state_attr('climate.fubohz-esszimmer', 'temperature') | float + 5 }}

But the entity_id shouldn’t be the generic thermostat, it should be the real thermostat or TRV.

And this should toggle the boolean

climate:
  - platform: generic_thermostat
    name: FuBoHz-Esszimmer
    unique_id: fubohz_esszimmer
    heater: input_boolean.winterzeit #####
    target_sensor: sensor.temp_esszimmer_temperatur
    min_temp: 19
    max_temp: 22
    ac_mode: false
    target_temp: 21
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 5
    initial_hvac_mode: "off"
    #away_temp: 16
    precision: 0.1

´´´

thanks!
but if I change the heater to the input_boolean.winterzeit the generic thermostat dont know which entity should heat the room, or do I not understand it correctly

The automation you got is utter (€*#)#/+(@ - it looks nice but does not do anything useful. Asking the community to fix it is a waste of everybodies time.

okay and how get a working code - if I didnt found anything here / reddit?

What do you want the heating to do when the generic thermostat is not used? Turn off completely, set to no frost mode to prevent freezing, something else?

There is a climate service called set_hvac_mode. use an automation to turn it off when that input boolean goes from on to off, and then use another automation to set it to heat when the input boolean goes from off to on

That is a good way, but leaves the question - why the input_boolean? If it is a manual control you could set the hvac mode manually as well. If it is set by an automation, let the automation control the hvac mode directly.

think I solved it…
easier than thought:

alias: FuBoHz einschalten
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.winterzeit
    to: "on"
condition: []
action:
  - service: climate.turn_on
    metadata: {}
    data: {}
    target:
      entity_id:
        - climate.fubohz_esszimmer
        - climate.fubohz_wohnzimmer
mode: single

I also added a second automation with “off”.
Looks like the entities are working :slight_smile:

(currently the shellys / FuBoHz entites are not plugged in)


That would do the trick, and if one input switches multiple thermostats, that too makes sense.

If you are interested, you can do both (on/off) with a single automation.

alias: FuBoHz einschalten
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.winterzeit
    to:
      - 'on'
      - 'off' 
condition: []
action:
  - service: 'climate.turn_{{ trigger.to_state.state }}'
    metadata: {}
    data: {}
    target:
      entity_id:
        - climate.fubohz_esszimmer
        - climate.fubohz_wohnzimmer
mode: single
1 Like

great!
I like that :smiley:
thank you!

1 Like

there is maybe one little improvement possible.
I just recognized that the automation doesnt work if I restart HA or do an update of the yamls (and the winter boolean is on).

I need to turn the winter boolean off and on again so the generic thermostat cards showing againt that they are heating…

Is it possible to improve the automation so that after restart of HA / update yaml the automation will be triggered again?

If restarting Home Assistant affects the state of the Generic Thermostats, that’s likely due to how the Generic Thermostats are configured and not because of any deficiency in the automation.

But is it possible to add a restart option to the automation so that it is triggered again?

Yes but that will only be bandaid and won’t prevent the issue from re-appearing elsewhere such as in other automations you create employing the thermostat.