logo elektroda
logo elektroda
X
logo elektroda

[BK7231N][CBU] ZMAi-90 Smart Energy Meter Teardown and Flashing

thebeardeddragon 7200 74
ADVERTISEMENT
  • #61 20865042
    lionboy
    Level 10  
    p.kaczmarek2 wrote:
    Well, there is not much choice, when you look at the boad, there is CBU, there is that RN chip for power metering, and the only other big chip is for screen. It's just it's not marked in my piece, so it's hard for me to tell which chip it is.


    So do you know how i can publish this RN value in Home Assistant? because with MQTT not show

    Warn:EnergyMeter:V 1933333, C 2697 0, P 81222 0
    Info:MQTT:Publishing val 8.24 to zmai90/power/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic zmai90/power/get
    Warn:EnergyMeter:UA 0
    Warn:EnergyMeter:UA 0
    Warn:EnergyMeter:UA 0
    Warn:EnergyMeter:UA 0
    Warn:EnergyMeter:UA 216
    Warn:EnergyMeter:CRC OK
    Warn:EnergyMeter:V 1933333, C 2697 0, P 81222 0
    Warn:EnergyMeter:UA 29
    Warn:EnergyMeter:UA 211
    Warn:EnergyMeter:UA 5
    Warn:EnergyMeter:UA 230
    Warn:EnergyMeter:CRC OK
    Warn:EnergyMeter:V 1954565, C 2697 0, P 81222 0
    Info:MQTT:Publishing val 224.2 to zmai90/voltage/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic zmai90/voltage/get
    Warn:EnergyMeter:UA 0
    Warn:EnergyMeter:UA 10
    Warn:EnergyMeter:UA 111
    Warn:EnergyMeter:UA 100
    Warn:EnergyMeter:CRC OK
    Warn:EnergyMeter:V 1954565, C 2671 0, P 81222 0
    Warn:EnergyMeter:UA 0
    Warn:EnergyMeter:UA 0
    Warn:EnergyMeter:UA 0
    Warn:EnergyMeter:UA 220
    Warn:EnergyMeter:CRC OK
    Warn:EnergyMeter:V 1954565, C 2671 0, P 81222 0
    Info:MQTT:Publishing val 0.221 to zmai90/current/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic zmai90/current/get


    But nothing in Home Assitant

    Home Assistant user interface showing device, control, sensors, and logs cards.
  • ADVERTISEMENT
  • #62 20865119
    p.kaczmarek2
    Moderator Smart Home
    I will look into it, it may be not just enabled yet. The more important problem is that it seems you have the wrong current measurements as well, right? That means I need to look into the communication algorithm more. Something must be missing from my implementation.
    Helpful post? Buy me a coffee.
  • #63 20865141
    lionboy
    Level 10  
    Yes, there are some mismatches in current, but not so big. If you calibrate from current, it is okay. You can set the value exactly for power.

    Screenshot of the Zmai90 user interface showing voltage, current, and energy data.

    I will wait until the problem with MQTT is fixed because these three are not my zmai and I need to put Beken on them. After that, I need to use them on the neighbor's house. But for now, it is on a test to find a solution and fix this Zmai 90.

    Added after 16 [minutes]:

    And i think for display this is the chip:

    https://vi.aliexpress.com/item/10050060033570...1RO%21728730991%21&curPageLogUid=DtnE9WB4gctZ

    is exact same model with same 48 pin

    Added after 4 [minutes]:

    https://datasheet.lcsc.com/lcsc/2108251130_HTCSEMI-HT1621BRQZ_C2886391.pdf
  • #64 20865267
    p.kaczmarek2
    Moderator Smart Home
    The driver check was missing. I have added it now:
    https://github.com/openshwprojects/OpenBK7231...mmit/235a26ad2d466072bb20128e190e8b0bb9031609
    Can you start the driver now, then do Home Assistant Discovery, and then check are measurements getting discovered correctly?

    NOTE: Always start driver first, then do HASS discovery.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #65 20865336
    lionboy
    Level 10  
    It shows only current and voltage:

    Screenshot of MQTT interface showing device info, controls, sensors, and a logbook.


    Added after 7 [hours] 19 [minutes]:

    is work now with publish, but what is missing in HASS is Total Energy sensor

    Added after 12 [minutes]:

    Only you need to add to publish in HASS:

    Energy Total

    Because i saw for all device don't publish this total energy
  • #66 20866410
    p.kaczmarek2
    Moderator Smart Home
    Wait, so how did you fix missing Power?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #67 20866430
    lionboy
    Level 10  

    I pressed again on Start HASS Discovery and now it works after restarting the driver, but I don't understand why Total energy is not present in HASS.

    Screenshot of device panel for BK7231N by Beken Corporation showing sensor information.

    As you can see, there is no Total energy.

    Added after 32 [minutes]:

    What I saw when the switch is OFF, I have 0.010 amp with my meter (digital clamp meter) and on the web it is 0.033. After I switch on, I have both 0.051 on the meter and 0.051 on the web app.
  • ADVERTISEMENT
  • #70 20869247
    p.kaczmarek2
    Moderator Smart Home
    Can you provide some more information, are those two counters 'Unknown' for you all the time?
    Helpful post? Buy me a coffee.
  • #71 20869271
    lionboy
    Level 10  

    p.kaczmarek2 wrote:
    Can you provide some more information? Are those two counters 'Unknown' for you all the time?


    Only consumption_stats is always Unknown, the rest are okay with every update of stats.
  • #72 20869375
    p.kaczmarek2
    Moderator Smart Home
    I will check this when I have some time, today we are merging NTP Sunset/Sunrise events:
    https://github.com/openshwprojects/OpenBK7231...mmit/bc580f0d0acba49846b0d554e29a251b5c2f3679
    I will try to look into your question soon, sorry for the delay
    Helpful post? Buy me a coffee.
  • #73 20877493
    lionboy
    Level 10  

    Do you know RN8209 is supported in ESPHOME because I don't find any details related to this chip.

    Thanks
  • #74 20877626
    p.kaczmarek2
    Moderator Smart Home
    No, it's not supported, we are the first one to work on it.
    Helpful post? Buy me a coffee.
  • #75 20892254
    lionboy
    Level 10  
    any news regardig to chip for display?

    Thanks

Topic summary

The discussion revolves around the ZMAi-90 smart energy meter, which utilizes the BK7231N chip and has been modified from earlier versions that used the ESP8266. Users are seeking to flash the device with OpenBeken firmware to eliminate reliance on cloud services. Initial steps involve determining if the device is a TuyaMCU version and identifying the UART connections for flashing. Several users share their experiences with flashing, including challenges with communication and the need to desolder components like the RN8209C chip to facilitate the process. The conversation also touches on the power metering functionality and the integration of the device with Home Assistant, highlighting issues with current measurements and the need for calibration. Users discuss various methods for reading flash memory and the importance of ensuring proper connections to avoid damaging the device.
Summary generated by the language model.
ADVERTISEMENT