ScratMan / HASmartThermostat

Smart Thermostat with PID controller for HomeAssistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cant update PID values

dawiduniec opened this issue · comments

I can't update pid values thru config. I even tried to remove addon and add it again, configuration values are ignored.

Gains from configuration file are only used at first boot with the thermostat or when HA database crashes.
You need to use the smart_thermostat.set_pid_gains service to adjust them. Once you have found the optimum values, you can then write them in the yaml so that it's saved in case of database crash.

OMG, thank you, it works now, wasn't aware about services. One more question, i did pid auto tuning, it did really fine, i got max 0.2 C differences with heater, but after couple days, (also higher temperature) it overshoots alot, it was to low temp for tuning, or there maybe some other issues? I mean when i set for example 40C, with pid values kp: 0.377, ki: 0.004, kd: 19.155) it get to 40, pass it, and still heating, even after reaching 58

How I can buy you a coffee?

There is something really strange going on, I've tried already alot of different pid values, right now even on 0.01/0/0 it overshoots, like it's ignoring the values I've set with the service.

  • platform: smart_thermostat
    name: SmartThermostatExample
    unique_id: smart_thermostat_example
    heater: switch.none_wedzarkanowa
    target_sensor: sensor.none_wedzarkanowa_ds18b20_temperature
    min_temp: 7
    max_temp: 105
    ac_mode: False
    keep_alive:
    seconds: 20
    away_temp: 7
    kp: 0.377
    ki: 0.004
    kd: 19.155
    pwm: 00:01:00
    outdoor_sensor: sensor.outdoor_temp

Thats my config, Im using sonoff th16 (tasmota, mqqt, 10 sec update) with 2300W 220V heater, with couple elements for greater thermal inertia.

How to delete all data related to smart thermostat from database to start all over again?

If you used the auto tune, make sure it stopped correctly and that the thermostat is working in PID mode. In the states development tools, the thermostat should show pid_mode: auto and not mention auto tune.

Everything was as you said, to be honest i dont know if auto tune finished correctly, as it took 8h to get those messages in logs:

climate.smartthermostatexample: Now running on PID Controller using rule no-overshoot: Kp=0.24884160483423373, Ki=0.0012093319880500442, Kd=34.1357294265802 5:05:00 PM – (WARNING) smart_thermostat (custom integration) climate.smartthermostatexample: Now running PID Autotuner with rule ciancone-marlin: Kp=0.37703273459732384, Ki=0.0040311066268334805, Kd=19.155852652401908 5:05:00 PM – (WARNING) smart_thermostat (custom integration) - message first occurred at 5:05:00 PM and shows up 7 times

After that i've stopped it.

Problem is solved by changing unique_id to new one, there was something wrong with db, thanks for your time.