Thermostat with climate module

Hi,

I have a problem with the climate module in Home Assistant in order to do a thermostat for my bathroom heater.

I have a room temperature of 19.6°C and in order to test my setup, I have choose a target at 26°C, but nothing happen, the heater switch doesn’t turn on…

Here is my code :

sensor:
  - platform: mqtt
    name: "Salle de Bain  Température"
    state_topic: "tele/RadSDB2/SENSOR"
    value_template: '{{ value_json.SI7021.Temperature }}'
    unit_of_measurement: "°C"
    availability_topic: "tele/RadSDB2/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    id: 'sdb_temperature'

switch:
    - platform: mqtt
      name: "RadSDB1"
      command_topic: "cmnd/RadSDB1/power"
      state_topic: "stat/RadSDB1/POWER"
      qos: 1
      payload_on: "ON"
      payload_off: "OFF"
      retain: true
      id: 'RadSDB1'
    - platform: mqtt
      name: "RadSDB2"
      command_topic: "cmnd/RadSDB2/power"
      state_topic: "stat/RadSDB2/POWER"
      qos: 1
      payload_on: "ON"
      payload_off: "OFF"
      retain: true

# Thermostat Salle de Bain

climate:
  - platform: generic_thermostat
    name: 'Thermostat SDB'
    heater: switch.RadSDB1
    target_sensor: sensor.sdb_temperature
    min_temp: 15
    max_temp: 28
    ac_mode: false
    target_temp: 27
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 5
    keep_alive:
      minutes: 3
    away_temp: 16
    precision: 0.1

Do you have any idea of what I have done wrong ?

Thanks

Hi RD2,
I thinks the value of your sensor is not loaded right in the climate component. The temperature is usualy displayed in the center of the climate component.

Can you check if the id of your sensor is right in your configuration?

Hope it helps!

Thanks for your answer.

Where can I check my id sensor ? Because I thought it was defined at the end of my sensor configuration in my *.yalm file :

sensor:
  - platform: mqtt
    name: "Salle de Bain  Température"
    state_topic: "tele/RadSDB2/SENSOR"
    value_template: '{{ value_json.SI7021.Temperature }}'
    unit_of_measurement: "°C"
    availability_topic: "tele/RadSDB2/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    id: 'sdb_temperature'

Is there is another id to watch ?

Thanks

I’ve noticed with my own generic climate module that after I reboot home assistant it can take a few minutes for the temperature value to display on the thermostat control, as I believe it is waiting for a fresh update to come from the sensor. How often does the temperature sensor update, and can you force a refresh?

You can go to your-ha-ip:port/developer-tools/state and search for your sensor. Here you will see the excact name that HA is using to your sensor just to be sure.

Perfect, Thanks a lot, it is working now!