ScratMan / HASmartThermostat

Smart Thermostat with PID controller for HomeAssistant
336 stars 48 forks source link

Handling of heater control device connectivity issues - Heater controller stays on #196

Open papadi opened 6 months ago

papadi commented 6 months ago

I have the feeling that when the thermostat attempts to turn off the heater when it is unavailable (e.g. because of a connection issue) then it will leave it on forever. Is there a way, or perhaps shouldn't there be a way for the thermostat to ensure that the heating controller is at the correct on/off state periodically?

I noticed this problem recently when I moved my WiFi router and my heating controller (Sonoff 4CHPRO) connection became unreliable. Of course, this is a problem I have fixed already. However, I remember that my heating controller stayed on for hours two or three times in the past as well.

semxx commented 3 months ago

I have the same problem. When the switch has been unavailable for some time, thermostat will stay ON and state will no change when temp set target bellow threshold. It's abnormal any way. When I try to turn off my switch manual then HAS thermostat service set turned on thermostat after few seconds (triggered by service Home Assistant Core Integration: Generic turn on)

UPD The problem has been solved after apply clear integral value:

service: smart_thermostat.clear_integral
target:
  entity_id: climate.smart_thermostat_ilia

Btw the problem is present. If device (switch) lost connectivity, PID collect in DB incorrect value and apply it for a long time... After that thermostat stay in ON mode. I think in some cases it may be dangerous.

Chupaka commented 3 months ago

Did you try to debug using pid_N sensors? I suspect that can be because of control_output is stuck at 100% like I described in https://github.com/ScratMan/HASmartThermostat/pull/151. When you cleared pid_i, that decreased control_output, so pid_i can now change again.