jmcollin78 / versatile_thermostat

A full featured Thermostat for Home Assistant: presets, window, motion, presence and overpowering management
MIT License
329 stars 34 forks source link

Make EMA parameters configurable #244

Closed jmcollin78 closed 11 months ago

jmcollin78 commented 11 months ago

Auto window open detection use the EMA calculation introduced for regulation.

Because some configuration need more smoothing into the EMA calculation, the default parameter should be easily updated. Because the VTHerm configuration process is aleady complex, we need to add this parameters into the optional configuration.yaml introduced with auto regulation feature.

The parameters are:

  1. MAX_ALPHA: a parameter that limits the alpha influence (ir the weight of a measurement point depending of its delay vs the previous one),
  2. halflife: the length of the period in which we consider the old values
  3. precision: the number of digits of precision
jmcollin78 commented 11 months ago

Example of configuration (which correspond to the default configuration):

versatile_thermostat:
    auto_regulation_expert:
        kp: 0.4
        ki: 0.08
        k_ext: 0.0
        offset_max: 5
        stabilization_threshold: 0.1
        accumulated_error_threshold: 50
    short_ema_params:
        max_alpha: 0.5
        halflife_sec: 300
        precision: 2