Climate - Generic Thermostat not working

I cannot replicate your results. In other words, I have a Generic Thermostat that successfully controls a switch entity.

Here’s the configuration. For this experiment, I used a switch that controls a bathroom exhaust fan (I don’t have a switch entity that controls a heater).

climate:
  - platform: generic_thermostat
    name: Office
    heater: switch.guest_fan
    ac_mode: false
    min_temp: 18
    max_temp: 25
    hot_tolerance: 0.5
    target_temp: 20
    away_temp: 2
    target_sensor: sensor.counter_light_temperature

Here’s the resulting card in the Lovelace UI:

Screenshot from 2020-10-24 12-00-30

You’ll notice the ambient temperature is 20.7 and the target temperature is 21.5. However, it is not currently heating because it is Off (notice the ‘flame’ icon is dimmed whereas the ‘power’ icon is bright).

After clicking the ‘flame’ icon to enable heating, the status changes from Off to Heating and the bathroom fan turns on (‘flame’ icon is red and the ‘power’ icon is dimmed).

Screenshot from 2020-10-24 12-00-43

Can others duplicate this behavior or does it not even get this far?

1 Like

It’s been a while since I tried it, and I have no inclination to conduct any further tests currently, but if I remember correctly setting the temperature of the thermostat to above the current ambient temperature in the ui did work. The problem was when the ambient temperature dropped below the desired temperature that was previously set and/or the thermostat mode was changed from off to heat.

As I said it was a long time ago, but it simply didn’t work and we would often find ourselves sat in a cold house with the generic thermostat in heat mode, the ambient temperature being below the desired temperature and the generic thermostat sitting idle.

1 Like

OK, that’s a plausible failure scenario. I’ll need to replace the temperature sensor entity with an input_number so I simulate the same conditions.

What perplexes me is why this failure scenario purportedly only manifests itself for a switch but not an input_boolean. The Generic Thermostat’s code simply use a turn_on/turn_off service so it should behave the same regardless of whether it’s a switch or an input_boolean (i.e. as long as the entity responds to turn_on/turn_off, it should work the same).

Anyway, I completely understand why, given that you already a reliable alternative, this quirk is no longer on your radar.

1 Like

I agree it makes no sense, but it’s a regular problem as evidenced above.

As you can imagine I did put a lot of work into it at the time but never found a solution, just people saying “works for me”, or saying “I had the same problem and never found a solution”.

All I can say is there’s definitely a bug somewhere, but it doesn’t seem to be ‘reproducible’ (in the sense of if I do this it works, but as soon as I do that…) - the whole thing either works for people or it doesn’t with no obvious cause. The only thing that appears to link the cases is the use of a switch domain, but many people use switches without issue, so in the words of the prophet…

:man_shrugging:

1 Like

As a data point, I was also unable to use a switch and thermometer, but changing to an input_boolean (that controls the switch through an automation) and input_number (that is update from an automation) makes the thermostat work.

The switch is an insteon 2663-222 outlet and the thermometer is off of an aeotec multi-sensor 6.

I do also want to acknowledge how difficult it is to troubleshoot so many different permutations of configurations that people can have and how all of those are abstracted into HA and appreciate how much effort has gone into making things work so well.

2 Likes

Hello,

Well I’m somewhere between, managed to create the thermostat.
If I click the buttons manually it turns on/off
It doesn’t work automatically.
image

1 Like

Like I told someone else in October 2020:

Because I can’t replicate other people’s failures, I can’t help them fix it.

This is funny (peculiar)
Like you, I have generic thermostats set up, the boiler one is set to run the actual boiler. The cooling one is set to control a fake switch (template) I then mirror the fake to fans (mainly extract) both of them work flawlessly.
Having said that I agree with @anon43302295 that having observed them in action, I could probably do just as well (or even better) with automations (maybe 4 but possibly just 2)
I leave both running 24/7 and just vary the set points (heating) for the conditions extant.
I just find the thermostats ‘convenient’
It’s intregueing that it ‘sometimes’ doesn’t work, I’ll try to wipe a test instance and try one from scratch.

Got it to work.
After 3 days :rofl: .
Honestly probably some typo somewhere and a big pile of stupid from my side.
One thing I can suggest is how to thermostat actually works, that could have saved me some time.
When I was pressing the flame icon I expected to turn on heating :blush: and it entered Idle mode, I didn’t understand why.
The flame icon it’s like master On switch for the thermostat. First you switch it on after that try working with it, to see if it’s heating/switching correctly.
The other suggestion instead of switch try the input_boolean, way faster for testing.

2 Likes

All of that is mentioned in this thread.


I have the same problems, the heating information does not appear. But physically everything works. I still give an error from the log, it looks like it does not receive information about the status of the head, but one of my automation works with him, so this information must be in the system.

Dark

I have this weird issue… The thermostat will control the relay appropriately when I manually adjust the temperature in thermostat card above/below current temperature, however it will not trigger automatically in background when actual temperature changes.

I had my thermostat setup and it was working as designed for couple of weeks. It is taking temperature from xiaomi BLE sensor and controlling a zigbee relay.

Not sure if this is related, but will say this anyway: I had some issues with my zigbee setup. I am running ZHA and wanted to try zigbee2MQTT. After enabling and quickly disabling that addon, all my zigbee devices were no longer “in range” in ZHA. So decided to restore a backup from a day ago. After this, HA has decided the database is corrupt and dumped it, starting fresh. I still had to re-add all zigbee devices manually. I believe all device and entity names remain the same. All other automations are still working, however thermostat function is broken.

What could have happened and how do I diagnose this?

Reviving an old thread here, hope that’s fine.

I appear to have the same issue as others in this thread describe. Take note that I am a COMPLETE noob and installed HA yesterday on a NUC. I can’t code or anything remotely like it. I’m not stupid though (I swear!).

I have a Tuya switch with a heater plugged into it. The switch iss controllable by lovelace I can confirm.
I have a Sonoff Zigbee temp and humi sensor connected to a zigbee bridge that is displaying on a card.

Now I want to use the generic thermostat platform and have entered the following into my configuration.yaml

climate:
  - platform: generic_thermostat
    name: Office Climate Control
    heater: switch.small_tuya_plug_1_socket_1
    target_sensor: sensor.sonoff_a480064461_temperature
    ac_mode: false
    target_temp: 25
    cold_tolerance: 0.3
    hot_tolerance: 0.5
    min_cycle_duration:
      seconds: 30
    precision: 0.1

But it does nothing. Currently the temp sensor is reading 21 C but the switch isn’t coming on.

Any assistance would be appreciated. I see above that users talk about using bolean instances or some such, I don’t know what they’re on about so if that is the work around if someone could point me in the right direction that’d be great.

Thanks in advance.

Hi,

I just had similar issue.
For me the issue seems to have been that my template switch did not like to toggle.
I changed it to a input_boolean ( You can create one with UI in helpers, they are called Toggles in there) and worked straight away.
You could than use that input_boolean state to control your switch.
Also make sure your sensor gives out a temperature.

does anyone know where hvac modes is set - especially how it is represented in lovelace???

Mine are all lower case - problem is that simple-thermostat takes the state case from the climate entity.

Other people are getting mixed case eg: “Heat” “Cool” “Off” and TBH I dont know where this comes from.

Im getting “heat”, “cool”, “off” (lowercase)

Actually simple thermostat takes them from the attributes of the climate entity. Those should be correct.

To give you an idea how it is represented in Lovelace:

…with the underlying code of:

type: custom:stack-in-card
mode: vertical
cards:
  - type: custom:simple-thermostat
    card_mod: null
    style: |
      ha-card {
        background: WhiteSmoke;
        --keep-background: true;
      }
    entity: climate.beanbag_zone_ac
    control:
      _headings: false
      hvac:
        'off':
          name: Aus
        cool:
          name: Cool
        dry:
          name: Dry
        fan_only:
          name: Fan Only
      fan:
        auto:
          name: Auto
          icon: mdi:fan-auto
        low:
          name: Low
          icon: mdi:fan-speed-1
        medium:
          name: Medium
          icon: mdi:fan-speed-2
        high:
          name: High
          icon: mdi:fan-speed-3
        powerful:
          name: Powerful
          icon: mdi:fan-chevron-up
        night: false
        lowMedium: false
        lowHigh: false
        mediumHigh: false
    hide:
      temperature: true
    icon:
      auto: mdi:autorenew
      cool: mdi:snowflake
      'off': mdi:power
    sensors:
      - entity: sensor.sonoff_snzb_02_temperature_sensor_beanbag_zone_temperature
        icon: mdi:home-thermometer-outline
      - entity: sensor.sonoff_snzb_02_temperature_sensor_beanbag_zone_humidity
        icon: mdi:water-percent
      - entity: sensor.temptrend_beanbag_zone
        icon: mdi:thermometer-lines
    step_size: '1'
    layout:
      mode:
        headings: false
  - type: entities
    card_mod: null
    style: |
      ha-card {
        background: WhiteSmoke;
        --keep-background: true;
      }
    entities:
      - entity: sensor.ac_beanbag_zone_cooling_time_today
        name: Kühldauer heute (Stunden)
  - type: entities
    card_mod: null
    style: |
      ha-card {
        background: WhiteSmoke;
        --keep-background: true;
      }
    entities:
      - entity: switch.pj_mini_zsw01_ac_beanbag_zone
        icon: mdi:lightning-bolt
        name: AC Beanbag Zone (Master Switch)
    state_color: true

Hope this helps to lead you to how it can be done.

Update: Solved

Two things I was missing - I needed to give the thermostat entitie a unique_id and then add it to a card in lovelace so it could be turned on/off or adjusted. That solved my issue

OK so I’ve created a helper toggle. But how do I link that helper to a switch?

Hi all, I also had a large amount of trouble getting generic_thermostat to work, controlling a simple fan. It would be all hooked up correctly, and in lovelace dashboard card I could see the live room temperature, and also could click to toggle on the fan manually. But the thermostat would never turn the fan on.

I eventually solved it by setting:
initial_hvac_mode: "cool"

Now the thermostat card is automatically turning the fan on and off. It seems setting
initial_hvac_mode: "off"
somehow stops it from ever turning the output switch on.