ScratMan / HASmartThermostat

Smart Thermostat with PID controller for HomeAssistant
345 stars 50 forks source link

precision not working #2

Closed mupsje closed 2 years ago

mupsje commented 2 years ago

Hi, great app, needed the PID All works great, but the "precision" is not. Cant operate in 0.1 steps. Only in 0.5 steps

- platform: smart_thermostat name: Woonkamer heater: switch.virtual_switch_virtual_vv target_sensor: sensor.average_woonkamer_temperatuur min_temp: 19 max_temp: 24 ac_mode: False target_temp: 20.4 keep_alive: seconds: 60 kp : 30 ki : 0.005 kd : -24000 pwm: seconds: 300 precision: 0.1 away_temp: 19.3 sleep_temp: 19.8 comfort_temp: 21

Please advice

ScratMan commented 2 years ago

Hi, I reproduced the issue. Working on a fix.

However, please note the derivative control is already multiplied by -1 internally, so you should use positive value in your settings to reduce your thermostat output pwm when temperature increases quickly.

Edit: I tried to remove the custom method that manages the precision to let the parent Climate class do it, but it doesn't help. Will need to digg a bit more in the code and in the HA core.

ScratMan commented 2 years ago

This issue was linked to an old change in HA backend, the precision parameter only sets the precision of the displayed sensor's temperature. With precision set to 0.5, if sensor's temperature is 21.2°C the thermostat will display 21, and if sensor's temperature increases to 21.3 the thermostat will display 21.5°C. The target temperature precision is set by another parameter that was missing in my implementation. This parameter is now added in release 2021.11.6, please use _target_tempstep in configuration file to set the adjustment step to your liking.