Error in hvac_mode, state and current_temperature with generic_thermostat

Hi,

So I made a generic_thermostat heater points to an input boolean, sensor is an actual thermostat.
Two things bug me, quite essential ones, such as current_temperature stays null and I noticed that when I go to the lovelace card it shows off and greyed out heat, when I look at the status it says "off"which should be either heat or cool and the hvac_modes attribute shows heat, “off”, This is not something I have set myself. The original climate sensor shows hvac_modes heat, cool. And if I set the attribute it changes back to heat, “off” everytime an update is done.

So my question, how to, permanently set the hvac_modes to heat and cool and then state to only heat or cool depending on the input via frontend and have it get the temperature from the climate sensor.

generic_thermostat.yaml

- platform: generic_thermostat
  name: Kasten_C
  heater: input_boolean.thermostaat_kasten
  target_sensor: climate.kasten
  min_temp: 15
  max_temp: 25
  ac_mode: false
  target_temp: 19
  cold_tolerance: 0.3
  hot_tolerance: 0.3
  min_cycle_duration:
    seconds: 5
  away_temp: 16
  comfort_temp: 20 
  home_temp: 19
  sleep_temp: 17
  activity_temp: 18
  precision: 0.1  

Entity climate.kasten_c after any update

status:
off

attributes
hvac_modes:
  - heat
  - 'off'
min_temp: 15
max_temp: 25
target_temp_step: 0.1
preset_modes:
  - none
  - away
  - comfort
  - home
  - sleep
  - activity
current_temperature: null
temperature: 19
hvac_action: 'off'
preset_mode: none
friendly_name: Kasten_C
supported_features: 17

Expected to be the same as climate.kasten:

state:
heat

attributes
hvac_modes:
  - heat
  - cool
min_temp: 0
max_temp: 0
target_temp_step: 0.2
preset_modes:
  - auto
  - day
  - night
current_temperature: 19.9
temperature: 15.8
hvac_action: idle
preset_mode: night
friendly_name: Kasten
supported_features: 17

image

You need to create a template sensor that sets its state from the current_temperature attribute from climate.kasten and then use that template sensor as the generic target_sensor.

So I’m trying to do so with

- platform: template
  sensors:
    kasten_temp:
      friendly_name: "Temperatuur Kastenkamer"
      device_class: temperature
      unique_id: sens_kast_temp
      value_template: {{state_attr('climate.kasten', 'temperature')}}

When I try it in templates it returns the value, in sensors.yaml I get errors such as

Incorrect type. Expected "string".yaml-schema: http://schemas.home-assistant.io/integration-sensor
missed comma between flow collection entries

Single-line templates need to be in double quotes.

value_template: "{{ state_attr('climate.kasten', 'temperature') }}"

Thanks, could have sworn I tried that.

It fixes the current_temperature = null bit, showing the right temperature now.
Still the issues of the state and hvac_modes attribute, any clues?

:pray:

image

Hmm, yeah thanks, that however is not the issue. I’m using the GT purely for interfacing into my UI.
Unless you mean the GT can never do the switch between heat and cool…

In my setup the actual actuation of the floorheating is done via control units and since we have floor heating/cooling we have to take the mass and a lot of factors into account for which I’m setting up my own algorithm. So the GT only has to show actual temp, have a slider for setting the wanted temp and I\d like it to indicate heating or cooling mode. The fact it fires of an on/off signal is nice though not a prime element in the algorithm.
And why would it choose of…and not hot or cool?