swingerman / ha-dual-smart-thermostat

The `dual_smart_thermostat` is an enhaced verion of generic thermostat implemented in Home Assistant. It uses several sensors and dedicated switches connected to a heater and air conditioning under the hood.
https://github.com/swingerman/ha-dual-thermostat
Apache License 2.0
122 stars 20 forks source link

Keep_alive not working #91

Open HappyPlotter opened 8 months ago

HappyPlotter commented 8 months ago

I have set the thermostat with keep_alive to control a shelly device. On the shelly I have set a timeout of 10 minutes and the keep_alive is set to 1 minute. The shelly device turns off after 10 minutes and then immediately turns on again. It seems like the keep_alive is not working which makes the heater cycle every 10 minutes

climate:
  - platform: dual_smart_thermostat
    name: House Underfloor Heater
    heater: switch.heater
    target_sensor: sensor.floor_temperature
    openings:
      - entity_id: binary_sensor.balcony_window
        timeout: 00:02:00
      - entity_id: binary_sensor.house_entrance_door
        timeout: 00:02:00
      - entity_id: binary_sensor.living_room_right_window
        timeout: 00:02:00
      - entity_id: binary_sensor.living_room_left_window
        timeout: 00:02:00
    min_temp: 16
    max_temp: 31
    precision: 0.1
    target_temp_step: 0.5    
    cold_tolerance: 0.1
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 10
    away_temp: 19
    home_temp: 20
    comfort_temp: 21
    keep_alive: 60
swingerman commented 6 months ago

Your scheduled turn-off triggers a cycle in the thermostat. The HVAC mode is strictly tied to the state of the switch entity you use. So when it is turned off after 10 minutes, the thermostat checks if the target temperature is reached and, if not, turn the switch back on. The keep alive is intended to check the need for heating or cooling and the act. The above state change triggers the same logic. So far, it works as intended. I suggest trying to control your switch only with the thermostat.

HappyPlotter commented 5 months ago

The problem with controlling only from thermostat, is that if HA goes down, the heater will continue to be turned on. That is the reason I added the timeout inside the shelly device. Keepalive works fine with the generic climate, it resets the 10 minute countdown. As a workaround I have made an automation that sends a "turn on" every minute to the shelly device and it is working fine