ScratMan / HASmartThermostat

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

Compensate for other heat sources (instantly, without integral resettling) #190

Closed jasperweiss closed 4 months ago

jasperweiss commented 7 months ago

Is your feature request related to a problem? Please describe. My thermostat controls an electric 1200 Watt heater in my room. Usually the output settles to something like 8% or 100 Watt average over the 15 min interval. My computer and monitor consume about 90 Watts idle and 200 Watts under load. That changes the total heat output into my room significantly so the integral needs to resettle as my temperature shoots above the setpoint. Once my PC is turned off, it needs to climb up again.

Describe the solution you'd like Considering that there might be other devices with significant heat output, it would be nice if there was a way for the thermostat to adjust for that.

One solution would be a config option for a (template) sensor that gives an additional element of the PID that the user can setup themselves (so another value that is summed up along with p,i,d,e to give the final output). This seems the most flexible and also allows for other use cases.

Another solution would be to define nominal power output of the heater in watts in the config, and then define another power sensor (or multiple?) of the device you'd like to compensate for. Perhaps averaging it over the interval period would be necessary.

Chupaka commented 7 months ago

I think you need to increase your pid_p, so when the temperature jumps high, it significantly drops the output. When the room is cooling down, P will slowly decrease while I resettles. And vice versa.

I mean, just let PID do its job :)

ScratMan commented 4 months ago

Another option is to move the temperature sensor closer to the computer. Closer heat source means faster reaction from thermostat. You just need to find the best location for the sensor.