logo elektroda
logo elektroda
X
logo elektroda

Tuya Single Phase Energy Meter 6 In 1: CBU Chip Flashing & ESPHome Integration Issues

deanfourie 12252 96
ADVERTISEMENT
  • #91 20537263
    p.kaczmarek2
    Moderator Smart Home
    No hardware modifications are required if you are going to run BL0942SPI driver. All you need to do is:
    1. flash the firmware
    2. start driver BL0942SPI, probably in short startup command
    3. you should already get readings, but it's good thing to calibrate, VoltageSet, etc commands
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #92 20538825
    deanfourie
    Level 6  
    Sorry would I need to update the firmware since I last installed it for this to work.

    I'm looking at this now,

    Thanks
  • ADVERTISEMENT
  • #93 20538842
    p.kaczmarek2
    Moderator Smart Home
    Web Application -> OTA -> drag and drop proper RBL for your platform
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #94 20559984
    deanfourie
    Level 6  
    Great thanks, I've done that now on all units.

    Do you think you can walk me through calibration and MQTT setup for HA?

    Much appreciated!
  • #95 20559990
    p.kaczmarek2
    Moderator Smart Home
    Good job, no problem, I can tell you what to od next.
    First calibration: Take a reliable meter, plug 60W bulb, then open Web App, Tools tab, and in the fields for calibration, enter true Voltage/Current/Power readings from a reliable meter. Done.
    Then HA pairing:
    [youtube]
    https://www.youtube.com/watch?v=pkcspey25V4
    [/youtube]
    You can also take a glance here for general purpose tutorials:
    https://www.youtube.com/@elektrodacom
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #96 21328576
    alexlimbeck
    Level 3  
    Hi. I am trying a Tongou smartplug. (TuyaCBU + BL0942)
    Flashed and activated with the "startDriver BL0942SPI" command, all was fine, until reboot.

    Rebooted the smartplug, I don't receive any data about power consumption on my MQTT server.
    If I try again startDriver "BL0942SPI", I obtain errors, but finally I receive data on my MQTT server.

    This is the message:

    Info:EnergyMeter:Read ENERGYMETER status values. sizeof(ENERGY_METERING_DATA)=32
    Warn:EnergyMeter:Failed to read reg 1D: bad checksum FF wanted 8D
    Error:EnergyMeter:Failed to write reg 1D val 55: read 11
    Warn:EnergyMeter:Failed to read reg 19: bad checksum FF wanted 91
    Error:EnergyMeter:Failed to write reg 19 val 8F: read 11
    Info:MAIN:Started BL0942SPI.
    OK


    So I tryed "stopDriver BL0942SPI" and repeat "startDriver BL0942SPI" and the result is :

    Info:EnergyMeter:Read ENERGYMETER status values. sizeof(ENERGY_METERING_DATA)=32
    Error:CMD:command with name EnergyCntReset already exists!
    Error:CMD:command with name SetupEnergyStats already exists!
    Error:CMD:command with name ConsumptionThreshold already exists!
    Error:CMD:command with name VCPPublishThreshold already exists!
    Error:CMD:command with name VCPPrecision already exists!
    Error:CMD:command with name VCPPublishIntervals already exists!
    Error:CMD:command with name VoltageSet already exists!
    Error:CMD:command with name CurrentSet already exists!
    Error:CMD:command with name PowerSet already exists!
    Warn:EnergyMeter:Failed to read reg 1D: bad checksum FF wanted 8D
    Error:EnergyMeter:Failed to write reg 1D val 55: read 11
    Warn:EnergyMeter:Failed to read reg 19: bad checksum FF wanted 91
    Error:EnergyMeter:Failed to write reg 19 val 8F: read 11
    Info:MAIN:Started BL0942SPI.
    OK
  • #97 21328626
    p.kaczmarek2
    Moderator Smart Home
    Were measurements really correct? Reboot shouldn't break anything... is it still wrong after power off and on?
    Helpful post? Buy me a coffee.

Topic summary

The discussion centers on the Tuya Single Phase Energy Meter 6 In 1 featuring a CBU chip based on the BK7231N platform, focusing on challenges with flashing the firmware and integrating the device with ESPHome. Initial attempts to flash the device using common tools like bkWriter failed; the recommended method involves using the hid_download_py tool for flashing and backing up firmware via UART. The device uses a BL0942 power measurement chip operating in SPI mode, complicating direct UART communication. To enable easier integration, a hardware modification is proposed to reroute BL0942 from SPI to UART by cutting and reconnecting specific traces, including disconnecting the SEL pin from VDD to switch BL0942 to UART mode. Alternatively, recent firmware updates have introduced a BL0942SPI driver in OpenBeken, allowing native SPI support without hardware modifications. Calibration involves using a known power load and adjusting voltage, current, and power settings via the web interface. MQTT integration with Home Assistant is possible but requires manual YAML configuration due to limited autodiscovery support. The device measures current inductively via a non-invasive sensor coil, and the CBU module handles Wi-Fi connectivity and firmware management. Users report issues with duplicate MAC addresses and MQTT entities showing only as switches, which can be resolved by proper configuration and firmware updates. The community provides detailed guidance on flashing procedures, hardware probing, and software configuration to achieve stable operation and full sensor data reporting.
Summary generated by the language model.
ADVERTISEMENT