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
128 stars 21 forks source link

[Bug?] Set temps don't restore on HA boot if a preset is set when HA restarts #184

Closed T3chArmy closed 6 months ago

T3chArmy commented 6 months ago

Defaults to my min and max range of thermostat. This error also gets thrown. I'm guessing there is an issue restoring settings correctly at startup.

This error originated from a custom integration.

Logger: custom_components.dual_smart_thermostat.hvac_device.cooler_fan_device
Source: custom_components/dual_smart_thermostat/hvac_device/cooler_fan_device.py:163
integration: dual_smart_thermostat (documentation, issues)
First occurred: 22:55:56 (19 occurrences)
Last logged: 22:57:50

Invalid HVAC mode: None

Here's my config:

climate:
  - platform: dual_smart_thermostat
    name: Hallway Thermostat
    unique_id: hallway_thermostat
    heater: switch.thermostat_controller_l1
    cooler: switch.thermostat_controller_l2
    fan: switch.thermostat_controller_l3
    target_sensor: sensor.average_house_temperature
    openings:
        - binary_sensor.office_window_contact
    min_temp: 60
    max_temp: 85
    fan_hot_tolerance: 0.5
    heat_cool_mode: true
    min_cycle_duration:
      seconds: 60
    keep_alive:
      minutes: 3
    away:
      target_temp_low: 68
      target_temp_high: 77
    home:
      target_temp_low: 71
      target_temp_high: 74
    precision: 0.1
    target_temp_step: 0.5

If HA is restarted in Preset None, then temperatures are restored correctly.

FredericMa commented 6 months ago

I'm seeing the same thing after a restart although I'm seeing a different message in the logs: 2024-05-08 09:27:46.054 WARNING (MainThread) [custom_components.dual_smart_thermostat.managers.temperature_manager] Undefined target temperature range, falled back to 7-7-35

Config:

  - platform: dual_smart_thermostat
    name: living_room
    heater: switch.heater
    cooler: switch.ac
    target_sensor: sensor.temperature_living_room
    heat_cool_mode: true
    cold_tolerance: 0.3
    hot_tolerance: 0.6
    precision: 0.1
    target_temp_step: 0.5

image

Let me know if these are two different issues so I don't hijack this one :-)

swingerman commented 6 months ago

@FredericMa It's not an issue because there is no configured temperature range in your config. But I guess the thermostat should have been restored to the last used target temperatures.

FredericMa commented 6 months ago

Correct, I expected the previous targets to be restored instead of the warning. This has always worked fine before.

swingerman commented 6 months ago

Please check v0.9.6.beta-8

FredericMa commented 6 months ago

~~I've tested it and restarted twice. First time it went fine, the second time (30 seconds later) it failed. I see this warning again in the log: 2024-05-08 18:44:19.711 WARNING (MainThread) [custom_components.dual_smart_thermostat.managers.temperature_manager] Undefined target temperature range, falled back to 7-7-35~~

Update: Ignore the above, although I selected beta 8 in HACS is installed beta 7. Now I've updated to beta 8 and it works like a charm! Thanks a lot!