Created a climate entity, and entity state not updating with manual changes

I recently added a Z-wave on/off relay to control a gas stove, and created a climate entity from that and a temperature sensor I have in the same room. It all works well.

Most of the time, I’ll be turning the stove on and off manually using that Z-wave switch, and not by setting the thermostat/setting the climate entity to “heat.” (see “solution” below) I’ve just clicked the switch, run the stove, and then shut it off… yet, the climate entity remains in state “heat,” despite the switch being off.

I can write an automation to set the hvac_state a few seconds after the switch changes state… but that seems a little janky. I’m wondering if I’ve missed something in my climate entity setup, or somewhere else:

climate:
  - platform: generic_thermostat
    name: Living Room Stove
    heater: switch.living_room_stove
    target_sensor: sensor.first_floor_motion_sensor_air_temperature
    initial_hvac_mode: "off"
    min_temp: 55
    max_temp: 80
    cold_tolerance: 1.0
    hot_tolerance: 1.0
    min_cycle_duration: 00:20:00
    precision: 0.1
    target_temp_step: 1.0

…or maybe I can’t do that. I tried “updating” the climate entity state depending on the state of the switch, but (I’m guessing) because the climate entity controls the switch itself, it just causes the switch to cycle… my automation is recursive. So, the climate entity doesn’t update its state with the switch on its own, and I’m not sure how to force it to.

EDIT: Well… the solution I came up with is, “don’t do that”:

I’ll be turning the stove on and off manually using that Z-wave switch

I replaced the switch controls on my dashboards with climate controls, and now the state matches up. I’m not sure I like that solution, since it requires I set a temperature, but I guess I’ll just goof it high if I want the stove on manually.

Hi, I’m in the same situation. I don’t think it’s the best solution. I was hoping that a change in the switch would be reflected in the thermostat. I have taken a major disappointment.

Does anyone know why when the AC switch is turned on (for example) the generic thermostat is not updated?

@petro Could you help us find an answer/solution or someone who can help us?

That’s by design. The hvac mode reflects what the thermostat is trying to do, not the state of the output.

Thanks for the reply. But working like this there are many possibilities of desynchronization. I was hoping that if the thermostat detected a switch activation it would also activate. I don’t see much sense.

There is a keep alive option that will force the thermostat to set the switch state to what it should be.

If you are looking for two points of control. Meaning the thermostat or a manual override then you need to rethink / redesign the automation.

Mmmmm… I understand what you’re saying and how to do it, but it doesn’t make me happy.