logo elektroda
logo elektroda
X
logo elektroda

[Solved] OpenBeken Configuration for D52-2066 Energy Meter (BK7231N, TuyaMCU, CBU 2.01.01.103308)

TuyaChal 570 4
ADVERTISEMENT
  • #1 21601154
    TuyaChal
    Level 2  
    Hello, I am new to OpenBeken and trying to get a D52-2066 DIN-rail-mount energy meter working. In the Smart Life app it shows up as a "breaker" and it uses the bk7231n chip (model CBU, p/n 2.01.01.103308 and internal product id c3xogekcff60tlig ) I was able to use Tuya Cloud Cutter with the TAXNELE TVPS1-63LW Circuit Breaker v2.1.6 profile to flash OpenBeken. However, I'm not sure how to configure OpenBeken now.


    OpenBeken Configuration for D52-2066 Energy Meter (BK7231N, TuyaMCU, CBU 2.01.01.103308) OpenBeken Configuration for D52-2066 Energy Meter (BK7231N, TuyaMCU, CBU 2.01.01.103308) OpenBeken Configuration for D52-2066 Energy Meter (BK7231N, TuyaMCU, CBU 2.01.01.103308) OpenBeken Configuration for D52-2066 Energy Meter (BK7231N, TuyaMCU, CBU 2.01.01.103308) OpenBeken Configuration for D52-2066 Energy Meter (BK7231N, TuyaMCU, CBU 2.01.01.103308) OpenBeken Configuration for D52-2066 Energy Meter (BK7231N, TuyaMCU, CBU 2.01.01.103308)

    I've looked at these topics as they are similar

    https://www.elektroda.com/rtvforum/topic3928655.html

    https://www.elektroda.com/rtvforum/topic4000770.html

    There is basically no config data for this device in OpenBeken after I installed it.

    I tried template extraction as shown in this video but seems like I got no useful info:

    Sample screenshot of OpenBeken console showing raw 55 AA serial protocol messages after starting tuyamcu driver.

    As the chip appears to only be connected via RX, TX, GND, POWER, and RESET(CEN) I assume it is using tuyamcu to pass data.

    So, running 
    startdriver tuyamcu
    in the "app" console (http://192.168.4.1/app? logs tab) gives
    Info:CMD:[WebApp Cmd 'startdriver tuyamcu' Result] OK
    
    and then I seem to be getting some of the 55 AA console messages which I believe might be related to the tuyamcu energy data:

    Screenshot of the OpenBeken console showing raw serial “55 AA” messages after running the startdriver tuyamcu command.

    I also tried these commands (for channels 2-9) recommended in another post but the values just show up as zeros:

    setChannelType 2 voltage_div10
    setChannelLabel 2 "Voltage"
    linkTuyaMCUOutputToChannel 101 val 2
    etc, etc.



    If anyone can point me in the right direction that would be much appreciated.
    AI: Do you know which TuyaMCU protocol version your device is using, or have you been able to identify the DPIDs (Data Point IDs) that correspond to voltage, current, power, etc.?
    there are some info in tuya-cloudcutter/device-profiles/taxnele-tvps1-63lw-circuit-breaker-v2.1.6/device.json, for example schemas 000004x6ux, id:1, id: 9, id: 11 etc.
    AI: Could you provide a sample of the raw 55 AA serial messages (from the console logs) that appear after running startdriver tuyamcu? This might help in figuring out the correct channel mappings.
    yes they are included in the post
  • ADVERTISEMENT
  • #2 21601392
    divadiow
    Level 35  
    TuyaChal wrote:
    there are some info in tuya-cloudcutter/device-profiles/taxnele-tvps1-63lw-circuit-breaker-v2.1.6/device.json, for example schemas 000004x6ux, id:1, id: 9, id: 11 etc.


    I wouldn't rely on this schema and the dpID descriptions for taxnele-tvps1-63lw-circuit-breaker because it worked on your device. Firmware version is the most important thing to match in trying a cloudcutter profile to see if it works.

    You could work out the dpIDs:
    https://www.elektroda.com/rtvforum/topic4038151.html
    https://www.elektroda.com/rtvforum/topic3970199.html

    and/or post the tuya config file after extraction here and we can maybe get the dpIDs from Tuya. That should kickstart your journey
    OpenBeken Configuration for D52-2066 Energy Meter (BK7231N, TuyaMCU, CBU 2.01.01.103308)

    Added after 9 [minutes]:

    TuyaChal wrote:
    but seems like I got no useful info

    this is typically the extent of the extraction from TuyaMCU devices using Easy Flasher and is still useful
  • ADVERTISEMENT
  • #3 21601917
    TuyaChal
    Level 2  
    Thank you for the guidance.

    In the console I ran startdriver tuyamcu and was able to figure out the DPIDs from the hex responses.

    I can then run these commands in the console and get the data to show up:
    
    setChannelType 2 voltage_div10
    setChannelLabel 2 "Voltage"
    linkTuyaMCUOutputToChannel 116 val 2
    setChannelType 1 frequency_div10
    setChannelLabel 1 "Frequency"
    linkTuyaMCUOutputToChannel 105 val 1
    setChannelType 3 current_div100
    setChannelLabel 3 "Current"
    linkTuyaMCUOutputToChannel 117 val 3
    setChannelType 4 Power
    setChannelLabel 4 "Power"
    linkTuyaMCUOutputToChannel 118 val 4
    setChannelLabel 5 "Energy Total"
    setChannelType 5 EnergyTotal_kWh_div100
    linkTuyaMCUOutputToChannel 1 val 5
    setChannelLabel 6 "PowerFactor"
    setChannelType 6 PowerFactor_div100
    linkTuyaMCUOutputToChannel 104 val 6
    tuyaMcu_sendQueryState ( to populate data )
    



    Screenshot of a console with commands configuring TuyaMCU channels and assigning labels.

    The Channel Types seem to survive a reboot but the channel labels do not, nor do any of the linkTuyaMCUOutputToChannel commands.

    So, my Startup Command is currently this:

    backlog startdriver tuyamcu; linkTuyaMCUOutputToChannel 116 val 2; linkTuyaMCUOutputToChannel 105 val 1; linkTuyaMCUOutputToChannel 117 val 3; linkTuyaMCUOutputToChannel 118 val 4; linkTuyaMCUOutputToChannel 1 val 5; linkTuyaMCUOutputToChannel 104 val 6;


    I think I may need to add the setChannelLabel commands in there, too. Seems like I may also need to enable the script driver and set it to send the tuyaMcu_sendQueryState command periodically as from what I can tell the values are only updated when requested. I think I may also need to enable the NTP driver to have the correct time in order to get the energy use over time.

    Added after 2 [hours] 3 [minutes]:

    FWIW here's my final startup command.

    backlog startDriver NTP; startdriver tuyamcu; linkTuyaMCUOutputToChannel 116 val 2; linkTuyaMCUOutputToChannel 105 val 1; linkTuyaMCUOutputToChannel 117 val 3; linkTuyaMCUOutputToChannel 118 val 4; linkTuyaMCUOutputToChannel 1 val 5; linkTuyaMCUOutputToChannel 104 val 6; setChannelLabel 2 "Voltage"; setChannelLabel 1 "Frequency"; setChannelLabel 3 "Current"; setChannelLabel 4 "Power"; setChannelLabel 5 "Energy Total"; setChannelLabel 6 "PowerFactor"; tuyaMcu_defWiFiState 4; addRepeatingEvent 60 -1 tuyaMcu_sendQueryState


    The addRepeatingEvent does not work unless tuyaMcu_defWiFiState is 4. The 60 means request the update every 60 seconds.

    I'm not sure if NTP is needed but there are some other DPIDs that I'm not using 6 ( composite report w/ voltage, current, power ), and some unknowns 11, 13, 17, 18, 19 which may be affected by and/or need the time in order to work properly.
  • ADVERTISEMENT
  • #5 21607711
    TuyaChal
    Level 2  
    Thank you. It's working well enough for me with the details I shared earlier. Good luck to others.
ADVERTISEMENT