hacs_waveshare_ups_hat icon indicating copy to clipboard operation
hacs_waveshare_ups_hat copied to clipboard

SMA filtering, batteries count

Open odya opened this issue 1 year ago • 0 comments

  • Simple moving average is applied for INA219 measurements by default with window size 5. Could be changed with sma_samples param

  • batteries_count parameter for 12.6V UPS Hat versions with 3 batteries in series. Used in SoC calculations

  • Doubled window size is used for calculation of SoC, Remaining Battery Capacity and Remaining Time to provide even more smoothing

  • Filtering of the INA219 measurements implemented in wrapper class

  • Due to sensor readings count and memory optimisations, actual measurement and storing values to buffers moved to separate method. It may be additionally sampled if needed (for example on every HA update read INA219 data 5 times with 100ms intervals and count additional mean on every single value)

odya avatar Jul 01 '23 20:07 odya