Generic Thermostat automatically turning off assigned switch when HVAC_MODE is 'off'

Hello everyone.

Until yesterday, I had a rather strange and unexplainable behavior in both my Home Assistant instances (TST/PRD), which was: everytime I would restart the instance, there were a couple of TP-Link switches which would be turned off by service homeassistant.turn_off (in case these were on when doing the restart).

As I had a spare switch, yesterday I did a test to check if it would happen to all of these plugs, but for the spare one, the issue did not happen. By the timing of the turn off behavior, it seemed to be happening during HA startup procedures.

I started wondering if this could be related to the fact that all the “affected” switches were assigned to climate generic_thermostat entities (as heater), like this:

climate:
  - platform: generic_thermostat
    name: Termostato Sala
    heater: switch.tomada_sala
    target_sensor: sensor.temperature_158d00012356d8
    min_temp: 18
    max_temp: 23
    min_cycle_duration:
      seconds: 5
    hot_tolerance: 0.5
    away_temp: 18

Activating debug log and triggering the behavior (in the meanwhile I found that UI reloading ‘Generic Thermostat Entities’ also did the trick), I found this warning message in the log:
WARNING (MainThread) [homeassistant.components.generic_thermostat.climate] The climate mode is OFF, but the switch device is ON. Turning off device switch.tomada_sala

This makes sense, if your switch is dedicated to the thermostat, which for me, is true but only on Winter time (I even have an automation to do this sync already).
Still then, outside that period, you may use the switch for other purposes (come on, heaters in generic_thermostat are not used for more than 2/3 months in a whole year).

I believe this behavior was brought by this PR.

Now my question here is: does anyone here have the same “issue”? If that’s the case, how do you circumvent it?

One idea suggested by @Soloam was to temporarily rename the switch entities, so they don’t match what is set in the climate entity, except during Winter time.

To avoid having to change manually the switch entity names every year (I didn’t find any way to automate it - neither python_script or appdaemon), I was hoping to find someone else with the same issue and any other workaround possible?

Does anyone have any (other) ideas to throw into the table?

Thanks in advance for any contributions.

Hi, I have the same issue. In my case it concerns my fishtank heater, so it’s about life quality of 33 tanganika fishes. I disabled generic_thermostat for this device and made setup in eWeLink App
Thanks for this post, whithout it, I was confused and didn’t know where to look for the problem.

1 Like

how to add a timer to the Generic Thermostat so that it works only at specific hours, e.g. 22-06 and 12-16