logo elektroda
logo elektroda
X
logo elektroda

How to Save and Restore Power Meter Values on BL937 Smart Plugs

blacksun2 60 2
ADVERTISEMENT
  • #1 21649449
    blacksun2
    Level 8  
    Hello,

    Since I have several smart plugs with BL937 chips for measuring power flow, I wanted to ask how to save and restore the measured values.

    I regularly create backups of the configuration by saving the autoexec.bat file.
    Suppose a socket breaks and I replace it with another one. Then I would be quite happy if the new socket simply continued counting from the meter it started.
    This is important because I use the devices as sensors and actuators in HomeAssistant. I use HomeAssistant to record various consumption values ​​over longer periods of time.
    Therefore, it is important to me that there are no major jumps in the recording.
  • ADVERTISEMENT
  • #2 21649452
    insmod
    Level 27  
    I would suggest using a HA helper instead.
    Use integral sensor, where input sensor is power and integration method is left riemann sum.
    If plug is replaced - just change input sensor to a new one.
  • #3 21649507
    blacksun2
    Level 8  
    insmod wrote:
    I would suggest using a HA helper instead.
    If plug is replaced - just change input sensor to a new one.


    Using a meter helper would be one option.
    I use HomeAssistant to collect as much raw data as possible over the longest possible period of time. The goal is to build the largest possible data pool. Therefore, I have all possible entities enabled.
    The goal is to be able to access the raw data when I want to analyze something spontaneously.
    If I use a consumption meter, I have the history of calculated consumption, but not the meter readings.
    A question like "what was the meter reading on day x" can then no longer be answered.

    A good example is the meters from utility companies. They don't ask for consumption, but rather for meter readings.


    I would therefore like to be able to save and restore the values.

    In addition to switching devices, it would be useful to consider the traditional purpose of a backup to ensure that you don't suffer any data loss.
    Just yesterday, for no apparent reason, the entire configuration was lost while updating a smart plug. Fortunately, the measured values ​​were retained. The files, such as the autoexec.bat, also happened to be preserved.

    In any case, things like this demonstrate once again how important it is to create regular backups. After all, that's one of the basic rules of information technology.
ADVERTISEMENT