
I've created a moving average modification for OpenBeken (BL0942+BL0937) for power and current values. Thanks to this, you can smooth the fluctuating power and current values, so that they are more informative at first glance.
So, if you have energy measuring devices like these (having energy monitor):



You can use my mod based on a simple calculation, it averages the fluctuating power and current values .
Reason: I have multiple devices (heating) at home that change the power input in seconds PWM (this way it controls the temperature proportionally). Thus, the value in HASS and OBK too "jumps". This mod allows you to activate values averaging. The output is then smoother.
For example, if you have a device that has 1000W and that out of 10 seconds interval is 4 seconds on and 6 seconds off, you normally see the same thing on the website or in HASS. For 4 seconds is there 1000W, and for 6 seconds is there 0W. So it depends on when you look at the website.
When using this mod, you will see a value of 400W all the time. However, it will take a while for it to reach 400W, and similarly it will take a while for it to drop to 0. The speed depends on the setMovingAvg setting.
It is clearly visible in the attached graph and the values from the graph are in the table.

The grand total for a period of time is almost the same as the total without averaging (due to the averaging).
Use this guide to build, firmware can be built on Github:
https://www.elektroda.com/rtvforum/topic4033833.html
Set ENABLE_BL_MOVINGAVG in obk_config.h.
ENABLE_BL_MOVINGAVG is disabled by default. To make it working, it must be turned on for compilation in obk_config using ENABLE_BL_MOVINGAVG 1
And in autoexec.bat the appropriate setMovingAvg value:
- 2..20 to activate the average - higher value, slower changes
- 0 or 1 is disabled (default)
--------------------------------------------------------------------------------------------------------------------------------------
Important !!!
It only makes sense if the power interval has the same period. It must be basically the equivalent to PWM with "seconds" interval.
--------------------------------------------------------------------------------------------------------------------------------------
For BL0942 this does not affect the energy, the energy is calculated directly on BL0942.
For others (BL0937, CSE7766, RN8209) the energy is calculated from the averaged values (if setMovingAvg is set).
Value flow in time - sample values used in graph:

Cool? Ranking DIY