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
120 stars 20 forks source link

[bug] - hvac_action_reason empty after restart #266

Open swingerman opened 1 month ago

swingerman commented 1 month ago

I'm not sure if it is related (or helpful) but hvac_action_reason doesn't get set to anything at all after a restart until the thermostat takes some 'action' again.

So if it was target_temp_reached and you restart (or reload the YAML from Developer tools) then it remains as an empty attribute until something gets changed and causes an action to occur that would change it.

I've been trying to use it to determine if an AC has been turned off by the integration or manually from a control panel and the 'blank' value has caused some issues with the logic

Originally posted by @cyberkryten in https://github.com/swingerman/ha-dual-smart-thermostat/issues/245#issuecomment-2262824221

swingerman commented 1 month ago

@cyberkryten, @jacobw Could you share your configuration please?

jacobw commented 1 month ago
  - platform: dual_smart_thermostat
    name: Lounge Climate
    unique_id: lounge_climate
    heater: switch.lounge_heatpump_heat
    cooler: switch.lounge_heatpump_cool
    target_sensor: sensor.yz_666e_temperature
    sensor_stale_duration: 0:05
    heat_cool_mode: true
    min_temp: 15
    max_temp: 26
    target_temp: 21.5
    target_temp_high: 21.5
    target_temp_low: 19
    cold_tolerance: 0.5
    hot_tolerance: 0
    precision: 0.1
    target_temp_step: 0.5
cyberkryten commented 1 month ago

Here's what I have:

`

I'm not bothered about it being set the instant of restart (ie memory of what it was as I think that's hard in HA) - as I said, it also happens if you reload all YAML using Dev Tools, so just doing it after a full HA restart won't actually fix it.

I guess when making the 'do I do stuff' decision, checking if there's a value in there, and if not updating it to the current reason would fix both cases (and any others lurking).