logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

TOMZN TOMPD-63-LW Wifi Multi Function (DIN) WB3S (BK7231T)

crash1912 31986 134

TL;DR

  • TOMZN TOMPD-63-LW 63A WiFi DIN power meter targets dual-line cutoff and uses a WB3S/BK7231T platform.
  • It supports remote on/off, live current, voltage, leakage current, and total kWh monitoring, plus timer control in the SmartLife Tuya app.
  • The configurable protections include 230V 50/60Hz operation, 140V-210V undervoltage, 225V-295V overvoltage, and 1A-63A overcurrent limits.
  • OpenBK compatibility remains unresolved, and no forum thread confirming this exact model working correctly was found.
Generated by the language model.
ADVERTISEMENT
📢 Listen (AI):
  • #31 20831201
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    Well, since you have a 2MB backup, maybe we can skip the UART capture process which is risky and requires isolation for USB to UART converter, and just try to flash OBK? In worst case you can always restore the backup.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #32 20836960
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    p.kaczmarek2 wrote:
    maybe we can skip the UART capture process which is risky and requires isolation for USB to UART converter, and just try to flash OBK?

    Hello again after an "intense" long weekend... Yes, that's probably the better option and I will do it as soon as possible, but I wanted to explore all the Tuya-related capabilities before flashing OBK.

    morgan_flint wrote:
    The rest of the hardware seems to be the same (I will add photos later on)

    Here are the photos:
    Close-up of an electronic component with copper wires and capacitors on a circuit board. Close-up of an electronic module with visible heat sinks, wires, and copper components. Close-up of an electronic board with wires and capacitors. Close-up of an electronic circuit with colorful wires and capacitors. Printed circuit board with electronic components and copper wires. Two green printed circuit boards with a display and buttons. Circuit board with WiFi module and integrated chip. Close-up of the interior of an electronic device with wires and components. Image of a green circuit board with various electronic components. Two green PCBs with electronic components. Display of the TOMZN multi-function protector device with WiFi functionality.

    And some screenshots of the App:
    Screenshot of an app displaying energy consumption. Screenshot of an energy expense management app with the prepayment switch turned off. Screenshot of an app showing temperature as NaN°C in four fields. Screenshot of an app showing settings for various electrical alarms. Screenshot of app settings showing a leakage alarm with a 30 mA threshold and control toggle enabled. Screenshot of an app with over-voltage alarm settings. Screenshot from an app showing device update information.

    I've also done a little bit of "reverse engineering" of the schematic; just for the sake of doing it, as it doesn't add much to making it work with OBK, but once I clean it up a bit I'll post it here.
  • #33 20836967
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    That's a lot of dpIDs. Have you tried to look up the full list of datapoints at Tuya developer website?
    Helpful post? Buy me a coffee.
  • #34 20837351
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    p.kaczmarek2 wrote:
    Have you tried to look up the full list of datapoints at Tuya developer website?

    Is it the attached listing (pdf)?

    If not, Where do I have to look?

    EDIT: I also copied the contents under "Standard Instruction Set" and "Standard Status Set" of this screenshot in another attachment (zip)
    Screenshot of the Central Europe Data Center interface with the device debugging panel.
    Attachments:
    • Tomzn3.zip (679 Bytes) You must be logged in to download this attachment.
    • Tuya IoT Platform_Tomzn_11.pdf (110.32 KB) You must be logged in to download this attachment.
  • #35 20837417
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    I am not sure but it doesn't look right, there are no dpId numbers there?

    Maybe try this method?
    https://www.zigbee2mqtt.io/advanced/support-new-devices/03_find_tuya_data_points.html
    Instructions for finding a data point using developer tools.
    Code: Javascript
    Log in, to see the code
    Helpful post? Buy me a coffee.
  • #36 20837470
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    Curiously, I was looking at the device logs, where you can find a dropdown menu called "Select DP ID":
    Dropdown menu with various options for selecting DP ID. Dropdown list with DP ID selection options. Screenshot of a dropdown menu with options like Switch, Alarm set1, Alarm set2, Breaker id, Voltage, Leakage current test, Current, and Chinese characters.
    (the first Chinese text translates as "Refresh report" and the second one as "Active Power")

    Of course, I would have never imagined a procedure like the one you found!! I followed the instructions you posted and got this:
    {"1":"Total forward energy","6":"Phase A","9":"Fault","11":"Switch prepayment","12":"Clear energy","13":"Balance energy","14":"charge energy","15":"Leakage current","16":"Switch","17":"Alarm set1","18":"Alarm set2","19":"Breaker id","21":"Leakage current test","101":"Clear Energy","104":"Power Factor","105":"Grid Frequency","106":"刷新上报","116":"Voltage","117":"Current","118":"有功功率"}

    20 DP IDs, if I'm counting well

    This would be the correspondence with the list of my previous post (pdf file), with also 20 entries (two first columns), and the new info (the other two)
    DP InstructionStandard InstructionDP IDDescription
    total_forward_energytotal_forward_energy1Total forward energy
    phase_aphase_a6Phase A
    faultfault9Fault
    switch_prepaymentswitch_prepayment11Switch prepayment
    clear_energyenergy_reset12Clear energy
    balance_energybalance_energy13Balance energy
    charge_energycharge_energy14charge energy
    leakage_currentleakage_current15Leakage current
    switchswitch16Switch
    alarm_set_1alarm_set_117Alarm set1
    alarm_set_2alarm_set_218Alarm set2
    breaker_idbreaker_number19Breaker id
    leakagecurr_testleakagecurr_test21Leakage current test
    clr_all_energy-101Clear Energy
    power_factor-104Power Factor
    supply_frequencysupply_frequency105Grid Frequency
    refresh-106刷新上报 (Refresh report)
    output_voltage-116Voltage
    output_current-117Current
    output_power-118有功功率 (Active Power)

    Also, in case it's of some help, I'm attaching some of the device log contents (TOMPD-63LW_logs.pdf)
    Attachments:
    • TOMPD-63LW_logs.pdf (227.52 KB) You must be logged in to download this attachment.
  • #37 20837702
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    I think we may also need to know the variable types, altough in most cases it should be very easy to guess them. Ok, so we are ready to flash OBK?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #38 20837808
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    p.kaczmarek2 wrote:
    I think we may also need to know the variable types

    Maybe this can be (at least, partially) extracted from the information in the first attachment here.

    It contains information for 14 of the 20 variables (all of those that have info in the second column (Standard instruction) of the table in my previous post, and the listing is in the same order, so easy to match.

    I'm transcribing it here so it's easier to read. This first table is for "Standard Status Set":
    DP IDCodeTypeValues
    1total_forward_energyInteger{
    "unit": "kW·h",
    "min": 0,
    "max": 99999999,
    "scale": 2,
    "step": 1
    }
    6phase_aRaw{}
    9faultBitmap{
    "label": [
    "short_circuit_alarm",
    "surge_alarm",
    "overload_alarm",
    "leakagecurr_alarm",
    "temp_dif_fault",
    "fire_alarm",
    "high_power_alarm",
    "self_test_alarm",
    "ov_cr",
    "unbalance_alarm",
    "ov_vol",
    "undervoltage_alarm",
    "miss_phase_alarm",
    "outage_alarm",
    "magnetism_alarm",
    "credit_alarm",
    "no_balance_alarm"
    ]
    }
    11switch_prepaymentBoolean"{true,false}"
    12energy_resetEnum{
    "range": [
    "empty"
    ]
    }
    13balance_energyInteger{
    "unit": "kW·h",
    "min": 0,
    "max": 999999,
    "scale": 1,
    "step": 1
    }
    14charge_energyInteger{
    "unit": "kW·h",
    "min": 0,
    "max": 99999,
    "scale": 1,
    "step": 1
    }
    15leakage_currentInteger{
    "unit": "mA",
    "min": 0,
    "max": 1000,
    "scale": 0,
    "step": 1
    }
    16switchBoolean"{true,false}"
    17alarm_set_1Raw{}
    18alarm_set_2Raw{}
    19breaker_numberString{
    "maxlen": 255
    }
    21leakagecurr_testBoolean"{true,false}"
    105supply_frequencyInteger{
    "unit": "Hz",
    "min": 0,
    "max": 1000,
    "scale": 1,
    "step": 1
    }


    And the second one for "Standard Instruction Set":
    DP IDCodeTypeValues
    11switch_prepayment Boolean "{true,false}"
    12clear_energy Boolean "{true,false}"
    14charge_energy Integer {
    "unit": "kW·h",
    "min": 0,
    "max": 99999,
    "scale": 1,
    "step": 1
    }
    16switch Boolean "{true,false}"
    17alarm_set_1 Raw {}
    18alarm_set_2 Raw {}
    21leakagecurr_test Boolean "{true,false}"
  • #39 20838423
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    This looks somewhat complete, altough I am not sure why dpID 9 is marked as bitmap and not as raw bytes data.
    Helpful post? Buy me a coffee.
  • #40 20838557
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    It's strange, so I checked it again:
    Screenshot of the standard status set containing various device-related alarms.

    I'm not very sure of the reliability of Tuya info; for example, there's one of the screenshots I posted from the App, acceded after clicking "Temperature" on the main screen for the device, that shows no info and makes no sense, as there aren't any temperature sensors in the hardware. I'm afraid product developers just customize some general kind of information without paying too much attention
  • #41 20839053
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    Do you need all of these data supported, or only the basic information like voltage, etc?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #42 20841322
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    Of course (and abusing your patience...), it would be ideal if we could support as many as possible, as the main appeal of this device is the amount of functions it performs...

    Maybe we could leave to the local keyboard the adjustment of the different protection thresholds, as these are values rarely changed but, for example, it would be interesting to know remotely which of the protections has acted.

    I'll flash OBK now to see what we can do with that, but I've just ordered the isolators to be able to capture traffic and, once they arrive, I could flash the original FW again if we need to see something there...

    BTW, I've also ordered one of the devices similar to this one but with just one relay (I found it at a very good price and couldn't resist...). I see coincidences in some of the DP IDs in that device's thread, so maybe between both devices, we will be able to decipher all of them.

    I've also compiled in the attached .pdf all the info on the previous tables, to make it easier to see all at a glance. I'm also attaching the "diagnostics" from the Tuya integration in Home Assistant, in case they can give new information. It seems to have contents relative to all the functions, although the device's page only shows a few of them:
    Control panel with a switch and unavailable sensor data.

    Thank you for all your help; I'm sorry I'm so noob on this subject :-(
    Attachments:
    • TOMPD-63LW_HomeAssistantTuyaDiagnostics.json.txt (9.29 KB) You must be logged in to download this attachment.
    • TOMPD-63LW_All.pdf (403.15 KB) You must be logged in to download this attachment.
  • #43 20841332
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    p.kaczmarek2 wrote:
    This looks somewhat complete, altough I am not sure why dpID 9 is marked as bitmap and not as raw bytes data.

    Regarding this, and looking at the combined table, maybe "bitmap" just means the DP reports the number of the alarm in the list:
    Table showing a list of alarms with assigned numbers and report statuses.

    If this is true, "0" in the reports would be no alarm, and "8" would be "self_test_alarm", which is the 8th in the list (I made some self-tests of the leakage current with the device by pressing the button labeled "T")
  • ADVERTISEMENT
  • #44 20842617
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    Yes, I also think we can now try flashing OBK and see how it goes.
    Helpful post? Buy me a coffee.
  • #45 20842982
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    morgan_flint wrote:
    If this is true, "0" in the reports would be no alarm, and "8" would be "self_test_alarm", which is the 8th in the list (I made some self-tests of the leakage current with the device by pressing the button labeled "T")

    I'm afraid I was wrong; I provoked 3 different alarms (overcurrent, leakage, and low credit, individually, not simultaneously) and got these values for this DP ID: 4,8 and 32768 (2², 2⁴ and 2¹⁵)
    So now "bitmap" makes sense: the activated alarms of the list of possible values are those that correspond with the "1" bits of the binary conversion of the decimal value of this DP ID:
    Screenshot of a list of alarms with corresponding binary values.

    I still have to figure out the meaning of the cryptic values of "Phase A", "Alarm set 1", and "Alarm set 2"
  • #46 20843011
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    Ah, sorry, now I understand! I may have been working too much. By Bitmap, they do not mean Bitmap as in "an image", but they mean what I usually call flags, where each bit (1 or 0) is a flag describing a state. Silly me. Now everything is clear. Thanks for pointing that to me!
    Helpful post? Buy me a coffee.
  • #47 20843435
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    morgan_flint wrote:
    I still have to figure out the meaning of the cryptic values of "Phase A", "Alarm set 1", and "Alarm set 2"

    Following the ideas in this post (specifically, base64 to hex conversion), I think the meaning of "Phase A" is now clear:
    Data table from the device event log showing various event codes in Phase A.
    Screenshot of a Base64 to hexadecimal converter with the input text CPAAH/4AB1M.

    08 F0 hex = 2288 dec = 228.8V
    00 1F FE hex = 8190 dec = 8.190 mA = 8,190A
    00 07 53 hex = 1875 dec = 1.868 W = 1,868 kW

    These coincide with the values I noted down at that time during tests I did yesterday with a heater connected as a load.

    I imagine the values for "Alarm set 1", and "Alarm set 2" are also base 64, but I'm afraid they are going to be more difficult to decode
  • #48 20845322
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    Finally flashed OBK and used the autoexec.bat from this post. These are the results:
    User interface with device status information from OpenBK7231N. Screenshot of the device configuration interface in OBK software. Screenshot of editing an autoexec.bat file with TuyaMCU configuration instructions.

    I also copied all the "TUYAMCU received" strings from the attached file "TOMPD-63LW_OBK_LOG.txt" to the also attached "TUYAMCU received.txt", and analyzed them with TuyaMCUAnalyzer:
    Screenshot of TuyaMCU Analyzer interface with various data packets.

    It shows up to 10 DP IDs in the brief time covered by the log, including those of Power Factor (104), Grid Frequency (105), Leakage Current (15), and the cryptic Alarm set 1 (17).

    Also, DP ID 13 (Balance energy), that must correspond with the remaining prepaid energy in 1/10 kWh (It shows 8, I programmed this with the minimum, 1 kWh, and have expended 0.2, ):
    55 AA 03 07 00 08 0D 02 00 04 00000008 2C
    HEADER VER=03 State LEN dpId=13 Val V=8 CHK

    BTW, there's a string in the logs (55 AA 03 07 00 10 12 00 00 0C 01 01 00 13 03 01 00 FA 04 01 00 D2 21) that gives an error in TuyaMCUAnalyzer:
    Screenshot of the TuyaMCU Explorer interface with an error message. Screenshot of log analysis from TuyaMCU.

    morgan_flint wrote:
    Following the ideas in this post (specifically, base64 to hex conversion), I think the meaning of "Phase A" is now clear:

    😥 Supid of me... I see the contents of this DP were already known and are well-decoded


    EDIT: Adding a screenshot from the device's page in Home Assitant:
    Screenshot of a device panel in Home Assistant showing details and logs for a BK7231N device by Beken Corporation.

    EDIT 2: Analyzing the link posted by @fakuivan here, in the last post there's a detailed description of "Alarm set 1":
    Code: JSON
    Log in, to see the code


    Unfortunately, "abilityId" (must be the same as DP ID) 104 and 105 have different meaning there.
    Attachments:
    • TUYAMCU received.txt (2.69 KB) You must be logged in to download this attachment.
    • TOMPD-63LW_OBK_LOG.txt (29.29 KB) You must be logged in to download this attachment.
  • #49 20845548
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    Good job! For a start, I can see you have numbers like "4" and "5" on your HA panel.
    Can you try to use:
    
    setChannelLabel 4 Something
    

    to get better names on UI? Try it out and let me know if it works

    See more info on our command docs page: https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md
    Helpful post? Buy me a coffee.
  • #50 20845842
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    Ok, thanks!

    Some progress here:
    Screenshot of OpenBK7231N interface with Relay and Prepayment functions enabled. Device configuration webpage for TuyaMCU driver with device settings.
    // start TuyaMCU driver
    startDriver TuyaMCU
    // always force 0x04 WiFi state (paired to cloud), otherwise TuyaMCU might skip some data points
    tuyaMcu_defWiFiState 4
    startDriver NTP
    
    // let's choose that channel 1 will be main relay state
    setChannelType 1 toggle
    // label it
    setChannelLabel 1 "Relay"
    
    setChannelType 2 Voltage_div10
    
    setChannelType 3 Power
    setChannelLabel 3 "Power"
    
    setChannelType 4 Current_div1000
    setChannelLabel 4 "Current"
    
    setChannelType 5 EnergyTotal_kWh_div100
    setChannelLabel 5 "Energy"
    
    setChannelType 7 toggle
    setChannelLabel 7 "Prepayment"
    
    // MF "power factor"
    setChannelType 10 PowerFactor_div1000
    setChannelLabel 10 "Power Factor"
    
    // MF "supply frequency"
    setChannelType 11 Frequency_div100
    setChannelLabel 11 "Grid Frequency"
    
    // link id 16 "switch" to channel 1
    linkTuyaMCUOutputToChannel 16 bool 1
    
    // link id 1 "total forward energy" to channel 5
    linkTuyaMCUOutputToChannel 1 val 5
    
    // TAC2121C VoltageCurrentPower Packet
    // This will automatically set voltage, power and current
    linkTuyaMCUOutputToChannel 6 RAW_TAC2121C_VCP
    
    // link id 11 "switch prepayment" to channel 7
    linkTuyaMCUOutputToChannel 11 bool 7
    
    // MF link id 104 "power factor" to channel 10
    linkTuyaMCUOutputToChannel 104 val 10
    
    // MF link id 105 "supply frequency" to channel 11
    linkTuyaMCUOutputToChannel 105 val 11
    
    // NOTE: addRepeatingEvent [RepeatTime] [RepeatCount]
    // code below will forever toggle relay every 15 seconds
    addRepeatingEvent 10 -1 tuyaMcu_sendQueryState 

    (BTW: ¿Why is NTP driver needed?)

    I could add power factor (correct) and frequency (shows 5.00 Hz and channel value is 500.00, but there's only "Frequency_div100" option for this type). I'm afraid the real resolution for this variable is 1-2 decimal at most; it's very difficult that the real frequency is 50,000 Hz

    Also, the Home Assistant screenshot:
    Screenshot of the Home Assistant interface displaying information about a Beken Corporation device.

    Some of the labels seem to be different to those in autoexec.bat and RSSI says "Desconocido" (Unknown)

    I will continue trying to add more things, but I'm afraid the Alarm Set 1 and 2 are beyond my possibilities 😢

    EDIT: Deleting previous edit about leakage current; there must be some error, I'll add later

    Added after 2 [hours] 17 [minutes]:

    Regarding leakage current, ff I add to autoexec.bat the following:
    setChannelLabel 12 "Leakage Current"
    linkTuyaMCUOutputToChannel 15 val 12

    But leave as "Default" or "Custom" the channel type, I get the following:
    Screenshot of the TuyaMCU interface displaying channel values like voltage, power, and frequency, with some values marked in red.

    Channel shows the same value as on the device's screen but nothing in the listing above (I imagine this is normal behavior). Then, if I change channel type to "Current_div100" I get:
    Screenshot from Home Assistant showing various data on voltage, current, energy, and other parameters.

    Correct value for the channel again and something coherent (apart from the rounding) shows in the listing. It should be 0,060 A or 60 mA, but I choose div100, so my fault...

    BUT, if I choose change channel type to "Current_div1000" then I get:
    Screenshot showing measurement data from a device with channels for voltage, power, current, energy, and other parameters.

    An invalid value, both in the channel and in the listing, that are now cloning the values for Current on channel 4. I imagine this is because you can't use the same channel type for 2 different channels. Is this intended or is a bug?

    Thank you for your patience, again!
  • #51 20846223
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    I will add Frequency_div10 for you, but in general, we may consider something more flexible in the future, of course, with backwards-compatibility included.

    NTP is just for current time, maybe previous config author used that.

    I think you need a leakage current channel type for leakage current.
    Helpful post? Buy me a coffee.
  • #52 20846290
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    p.kaczmarek2 wrote:
    I will add Frequency_div10 for you, but in general, we may consider something more flexible in the future, of course, with backwards-compatibility included


    Thank you! A possibility would be to separate the type and the scale (multiplier or divisor), but you'll know better what would be easier to implement

    p.kaczmarek2 wrote:
    I think you need a leakage current channel type for leakage current.

    But it doesn't exist yet, does it?

    On the other hand, if we had more than one current measurement (in a three-phase meter, for example), would it work well if you assigned the same type to more than one channel?
  • #53 20849043
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    Hello again!

    I did a deeper analysis of DPIDs 17 and 18. I started rewriting the JSON on EDIT2 here in a more legible way:
    Screenshot showing a JSON code snippet about alarm settings in an electrical circuit.
    Screenshot of a JSON fragment related to alarm settings.
    (I pasted it like an image because the tabulations get distorted if I publish it like code, but I'm also attaching the file, remove ".txt" after downloading)

    So, for example, for DPID 17:
    55 AA030700 08110000 040401001E49
    HEADERVER=03StateLENdpId=17RawLEN=4V=67174430CHK

    The "payload" 04010050 translates to:
    1st byte (indicating the presence of the alarm): 04
    2nd byte (when this alarm occurs, the circuit breaker control mode (0X01 trip, 0X00 no action, only alarm)): 01 (trips)
    3rd and 4th bytes: setting alarm threshold: 001E (HEX translates to DEC 30; corresponding to the 30mA which coincides with my setting of the leakage current threshold).

    For DPID 18 the analysis would be, for example:
    55 AA030700 10120000 0C01010013 030100FA 040100D2 21
    HEADERVER=03StateLENdpId=17RawLEN=12ValuesCHK

    The "payload" 01010013 030100FA 040100D2 translates to:
    01010013
    1st byte (indicating the presence of the alarm): 01 Could be the code for overcurrent 1st byte (indicating the presence of the alarm): 03 Could be the code for overvoltage (see 3rd and 4th bytes)
    2nd byte (when this alarm occurs, the circuit breaker control mode (0X01 trip, 0X00 no action, only alarm)): 01 (trips)
    3rd and 4th bytes: setting alarm threshold: 00FA (HEX translates to DEC 250; corresponding to the 19A which coincides with my setting of the overvoltage threshold).(see 3rd and 4th bytes)
    2nd byte (when this alarm occurs, the circuit breaker control mode (0X01 trip, 0X00 no action, only alarm)): 01 (trips)
    3rd and 4th bytes: setting alarm threshold: 0013 (HEX translates to DEC 19; corresponding to the 19A which coincides with my setting of the overcurrent threshold).

    030100FA
    1st byte (indicating the presence of the alarm): 03 Could be the code for overvoltage 1st byte (indicating the presence of the alarm): 03 Could be the code for overvoltage (see 3rd and 4th bytes)
    2nd byte (when this alarm occurs, the circuit breaker control mode (0X01 trip, 0X00 no action, only alarm)): 01 (trips)
    3rd and 4th bytes: setting alarm threshold: 00FA (HEX translates to DEC 250; corresponding to the 19A which coincides with my setting of the overvoltage threshold).(see 3rd and 4th bytes)
    2nd byte (when this alarm occurs, the circuit breaker control mode (0X01 trip, 0X00 no action, only alarm)): 01 (trips)
    3rd and 4th bytes: setting alarm threshold: 00FA (HEX translates to DEC 250; corresponding to the 19A which coincides with my setting of the overvoltage threshold).

    040100D2
    1st byte (indicating the presence of the alarm): 04 Could be the code for undervoltage in this DP(see 3rd and 4th bytes)
    2nd byte (when this alarm occurs, the circuit breaker control mode (0X01 trip, 0X00 no action, only alarm)): 01 (trips)
    3rd and 4th bytes: setting alarm threshold: 00D2 (HEX translates to DEC 210; corresponding to the 19A which coincides with my setting of the undervoltage threshold).

    So, more or less, everything is clear; the only thing that puzzles me is the different meaning of the alarm code in both DPs, but could be normal as can be deducted from the examples in the JSON

    Anyway, these DP IDs seem to be useful only for reading and setting the thresholds for alarms which, like I said before, can be done from the local interface and doesn't change frequently, so could be skipped in OBK (apart from the sake of completion...). More interesting would be to include DP ID 9, which is the alarm status, that is very interesting to have reported remotelly.

    morgan_flint wrote:
    BTW, there's a string in the logs (55 AA 03 07 00 10 12 00 00 0C 01 01 00 13 03 01 00 FA 04 01 00 D2 21) that gives an error in TuyaMCUAnalyzer:

    I opened an issue in Github related to this; I checked the string against Tuya specs for this command and the string seems correct, including checksum
    Attachments:
    • TOMPD-63LW_TuyaCloudCutter.json.txt (9.67 KB) You must be logged in to download this attachment.
  • #54 20852658
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    Hello again!
    I have changed/completed the autoexec.bat so now almost all DPIDs of interest are shown:
    Code: Java
    Log in, to see the code


    Screenshot of OpenBK7231N user interface showing various channels and their values.
    In red/green I've added the channel numbers. Some comments:

    All channels show correct values except for:

    - Channel 6: shows 0.28 kWh and the value in the display is 2.8 kWh. I'm using channel type "EnergyTotal_kWh_div100", so could be corrected if "EnergyTotal_kWh_div10" existed (or an alternative for divisors)

    - Channel 11: shows 5.00 Hz and the value in the display is 50 Hz. I'm using channel type "Frequency_div100", so could be corrected if "Frequency_div10" existed (or an alternative for divisors)

    - Channel 9 (power factor) shows the correct value but doesn't seem to recognize the label set in autoexec.bat. Am I doing something wrong?

    Other comments regarding channels:

    - I've set Channels 8 and 14 ("Clear Prepayment" and "Test Leakage") as "Toggle", and they work as intended, i.e., when "pushed", channel 6 sets to 0 (first case) and leakage alarm appears and switch trips (second case). The "problem" is that they stay green (0) and don't go back to red (0) by themselves, as could be expected. In these cases, a "momentary" button type would be a possible solution (or maybe include something in the autoexec for these channels that made them return to 0 a few seconds after toggling to 1?)

    - Channel 15 (Alarm set 1) shows in the textfield the correct decimal value for the expected hex value, according to the analysis in my previous post but, surprisingly, the value shown below for the same channels is different (67174490 vs 67174488.00). At that moment, I had the setting of the leakage current threshold in 90mA, which coincides with the last two digits in the textfield and, if I changed it to 30 in the device, the textfield would react accordingly. What doesn't work is the opposite: if I change the value in the textfield to 67174430 and hit "Set!", the value changes momentarily to this one but returns to 67174490 in a few seconds (and the value in the device's screen doesn't change). So, unfortunately, this isn't a way to set the thresholds from the web interface.

    - I tried a similar approach with "Alarm set 2", but it doesn't show any values (stays at 0). I'm afraid it's due to its length (similar to the exception in TuyaMCUAnalyzer).

    - Finally, channel 17 ("Fault") shows the correct decimal value for a given alarm, according to the analysis in this post. For example, 4 if I force an overcurrent or 8 during the leakage test. I don't know if there is a better way to treat these "bitmaps" in OBK

    Here are some more screenshots in different situations:
    OpenBK7231N control screen displaying various settings and DPID values. User interface displaying measurement data from a device managed by OpenBK7231N_TuyaMCU. Screenshot of the OpenBK7231N control panel showing various channels and values. Screenshot of OpenBK7231N interface showing various channel settings and values.

    And the screenshot from Home Assistant:
    Home Assistant user interface showing various sensor and relay settings

    The textfields are ignored, and the label for power is not the same; curiously, the label for power factor is correct here

    Apart from some details, all the interesting DPs are covered; the only thing I consider interesting that is missing is a better treatment for "Fault" signaling (knowing remotely what has been the protection that has acted: overload, overvoltage, undervoltage or leakage)
  • #55 20852685
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    Good progress, keep it on! I will try to add required channel types tomorrow.
    Helpful post? Buy me a coffee.
  • #56 20853227
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    p.kaczmarek2 wrote:
    Good progress, keep it on! I will try to add required channel types tomorrow.

    Thank you!

    Another curious fact about this device: It can detect negative (export) power:
    Display of TOMZN WIFI Multi-Function Protector showing negative power reading of -0.062 kW.

    To check this I simply inverted input and output. The problem is, as the device feeds itself from the input and the relay is open, it doesn't start, but if you temporarily bridge the input and the output (N to N and L to L, of course...) then the device starts and, once it closes the relay, you can remove the bridges and do the test.

    Unfortunately, it doesn't report the negative sign to the module, so it doesn't reflect on the web page. Also, despite power being negative, the energy counters continue to increase...
  • #57 20854635
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    >>20719315
    I'm also interested in this subject, as the third listing posted by @crash1912 here was the most informative for identifying the DP IDs of the device, and I have a different one in it's way home, so using this method could be the simplest way.

    I have tried accessing https://openapi.tuyaeu.com/v2.0/cloud/thing/xxxxxxxxxxxxxxx/model, replacing xxxxxxxxxxxxxxx with the "device id" that appears on Tuya platform for developers, but I get an error:
    Screenshot of an error showing an invalid token in a browser.

    It seems like a "token" is missing...

    I've asked @crash1912 privately, as I see he hasn't been around for a while but, just in case @fakuivan or somebody else knows the answer: What am I doing wrong? Is the "device id" the correct replacement for xxxxxxxxxxxxxxx?

    Thanks!

    EDIT: I continued searching on my own and I think I'm on the right way now. The link to look is this one:
    https://iot.tuya.com/cloud/explorer

    You have to have a Tuya Developer account and create a project (same as for this method).

    Still have to find there the query that includes /model, that gives the most complete info

    EDIT 2: Found. In https://eu.iot.tuya.com/cloud/device/, copy the "device_id":
    Screenshot of the Tuya IoT platform showing basic device information.

    Then, in the previous link, select Device Control -> Query Things Data Model:
    Screenshot showing the Tuya IoT platform with the Query Things Data Model function open.

    Then, hit "Copy" in the "response" and you get this:
    Code: JSON
    Log in, to see the code

    The interesting part is the one enclosed between quotation marks after "model": :
    Code: JSON
    Log in, to see the code


    The problem is that is all in one line (no carriage returns), so not very legible. This, joined to the fact that the word "model" didn't show well in the previous screenshot is what made it difficult to locate. To make it more legible, I pasted it into notepad++ and made the following substitutions:
    {\ -> {\n 
    ,\ -> ,\n
    \" -> "
    [{ -> [\n{
    }] -> }\n]
    ]} -> ]\n}

    With "extended" selected in search mode. Here's an example for the first substitution:
    Notepad++ text replacement dialog box
    (I recorded a macro for that)

    Then, after installing "JSON Viewer" plugin, select "JSON format":
    Screenshot showing a context menu in Notepad++ with the JSON Viewer extension selected.

    The results are like this:
    Code: JSON
    Log in, to see the code


    Much easier to read!!

    After that, a little bit of translation from Chinese and manual formatting is still needed to get what I attached here

    If @p.kaczmarek2 finds it interesting, I could open a thread with a tutorial for this
  • #58 20856455
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    Yes, please do, we can send you an Elektroda gadget for doing such tutorial. A guide from start to finish, how to get dpIDs.
    Still, keep in mind that it may be also possible to use online JSON formatters/beautifiers
    Helpful post? Buy me a coffee.
  • #59 20858019
    crash1912
    Level 4  
    Posts: 15
    Rate: 3
    Hello again! I was away for a long time, sorry.
    I am very impressed with the great progress!
    @morgan_flint Congratulations on your great work, you've worked hard!
    @p.kaczmarek2 As always, your help is amazing.

    I arrive very late and I see that they have solved practically everything, I don't know if I can contribute anything now... I can only repeat, wow! your work is incredible!
  • #60 20859565
    morgan_flint
    Level 14  
    Posts: 251
    Help: 4
    Rate: 60
    p.kaczmarek2 wrote:
    Yes, please do, we can send you an Elektroda gadget for doing such tutorial. A guide from start to finish, how to get dpIDs.
    Still, keep in mind that it may be also possible to use online JSON formatters/beautifiers


    Done!


    A bit long, but I hope it's useful. Anyway, please make any suggestions you may have to improve it. Thanks!
📢 Listen (AI):

Topic summary

✨ The discussion centers on the TOMZN TOMPD-63-LW Wifi Multi Function DIN power meter, specifically its compatibility and configuration with OpenBK firmware on the BK7231T platform. Users explored flashing the device with OpenBK, including safe UART data capture methods, backup procedures, and flashing techniques involving the TuyaMCU secondary MCU (HC89F0541). The device features dual relay switching for line and neutral, rated for 63A at 230V, 50/60Hz, with remote control, measurement of voltage, current, leakage current, power factor, and energy consumption, and configurable protection thresholds via the Tuya SmartLife app.

Key technical challenges included identifying UART pins, managing the TuyaMCU communication protocol, and mapping Tuya datapoints (dpIDs) to OpenBK channels. Users successfully extracted and analyzed dpIDs such as relay state (dpID 16), voltage/current/power (dpID 6), total energy (dpID 1), leakage current (dpID 15), alarms (dpID 9, 17, 18), and others. The community developed and refined autoexec.bat scripts to correctly interpret and display these datapoints, including handling raw data packets (RAW_TAC2121C_VCP), scaling factors, and channel labeling.

Firmware updates addressed issues like leakage current scaling, frequency display, and string termination for device identifiers. The device supports negative power detection (export), though the sign is not reported to the OpenBK interface. Users also discussed Tuya cloud API access for device shadow properties and the challenges of missing or write-only dpIDs (e.g., dpID 21, 101). The community contributed improved web interfaces and scripts for enhanced usability, including periodic state refresh commands (tuyaMcu_sendQueryState) to reduce data update latency from minutes to seconds.

Overall, the thread documents the collaborative reverse engineering, firmware customization, and integration of the TOMZN TOMPD-63-LW power meter with OpenBK, enabling local control and detailed monitoring beyond the original Tuya cloud ecosystem.
Generated by the language model.

FAQ

TL;DR: With a 2 MB flash backup first, this breaker can run OpenBeken reliably; as one expert put it, "It’s TuyaMCU". This FAQ helps TOMZN TOMPD-63-LW owners flash WB3S/CBU versions, decode dpIDs, fix slow updates, and restore full relay and metering behavior. [#20694223]

Why it matters: This thread turns a hard-to-flash Tuya DIN breaker into a documented OpenBeken target with known wiring, dpIDs, and working refresh tricks.

Option Best fit Main advantage Main drawback
OpenBeken TOMPD-63-LW with TuyaMCU Full local control, dpID mapping, custom UI Requires UART flashing and setup
ESPHome Users already on HA Familiar YAML workflow Thread did not map this model fully
Tasmota Users comparing ecosystems Popular tooling Thread provided no complete TOMPD-63-LW config

Key insight: The critical hurdle is not the Wi-Fi module itself. It is the secondary TuyaMCU link on UART, which must be isolated by reset or trace separation during flashing, then mapped correctly in OpenBeken.

Quick Facts

  • The breaker is rated 230 V, 50/60 Hz, up to 63 A, and the product description listed adjustable thresholds such as undervoltage 140–210 V, overvoltage 225–295 V, overcurrent 1–63 A, reconnect delay 1–500 s, and action time 1–30 s. [#20693422]
  • A successful flash path on the WB3S version used a full 2 MB backup, bk7231flasher_1.1.1, and OpenBK7231T_UA_1.17.221.bin; grounding pin 22 of the HC89F0541 reset line enabled UART read/write without permanent board cutting. [#20697176]
  • dpID 16 was confirmed as the main relay, dpID 6 carries the combined voltage/current/power packet, dpID 1 is total energy, and dpID 9 is the fault bitmap rather than a single numeric alarm. [#20697712]
  • The Tuya cloud model exposed at least 20 dpIDs on later units, including 104 power factor, 105 supply frequency, 106 refresh, 116 voltage, 117 current, and 118 active power, beyond the earlier basic set. [#20837470]
  • Default reporting was slow enough to frustrate users, but adding addRepeatingEvent 10 -1 tuyaMcu_sendQueryState produced practical refreshes every 10 s instead of waiting for the long factory interval. [#20702297]

How do you safely flash OpenBeken onto a TOMZN TOMPD-63-LW with a WB3S or CBU module, including backup, UART wiring, and handling the TuyaMCU connection?

Yes—make a full backup first, then flash over UART with the TuyaMCU isolated. 1. Connect 3.3 V, GND, TX1, RX1 to the WB3S or CBU pads and read a 2 MB backup. 2. Keep the mains side isolated and disable the secondary MCU, usually by reset or temporarily breaking its UART path. 3. Flash OpenBeken, reboot, then restore from backup if needed. On the WB3S unit, this worked with bk7231flasher_1.1.1 and OpenBK7231T_UA_1.17.221.bin. [#20697176]

What is TuyaMCU in the TOMZN TOMPD-63-LW, and how does it communicate with the WB3S or CBU Wi-Fi module?

"TuyaMCU" is a secondary control MCU that reads measurements, drives the front panel, and exchanges datapoints over UART with the Wi-Fi module. In this breaker, the Wi-Fi board is only one part of the design; the HC89F0541-class MCU handles protection logic and LCD tasks. OpenBeken talks through that UART link, so dpIDs come from TuyaMCU rather than directly from the relay hardware. That is why flashing and runtime mapping depend on the UART relationship between TuyaMCU and WB3S or CBU. [#20694223]

What is RAW_TAC2121C_VCP in OpenBeken, and how does it decode voltage, current, and power from dpID 6 on the TOMPD-63-LW?

RAW_TAC2121C_VCP is OpenBeken’s parser for the 8-byte Tuya raw packet on dpID 6. It splits one packet into voltage, current, and active power channels automatically. The Tuya model describes the format as 2 bytes voltage at 0.1 V, 3 bytes current at 0.001 A, and 3 bytes power at 0.0001 kW. The thread later confirmed the packet decodes exactly that way, which is why removing the mapping made channels 2, 3, and 4 fall back to zero. [#20707655]

Why do some TOMZN TOMPD-63-LW units need the HC89F0541 reset pin tied to GND before UART read/write will work?

They need it because the TuyaMCU shares the same UART lines used for flashing the Wi-Fi module. If the HC89F0541 stays active, it drives or listens on that bus and blocks clean UART read/write. One successful workaround grounded pin 22, the reset pin, during backup and flashing. That let UART access work without desoldering the resistor links between the TuyaMCU and the WB3S module. [#20694223]

How can I use tuyaMcu_sendQueryState or addRepeatingEvent to force faster refresh updates on a TOMPD-63-LW that otherwise reports very slowly?

Use tuyaMcu_sendQueryState directly, or schedule it with addRepeatingEvent. The working example was addRepeatingEvent 10 -1 tuyaMcu_sendQueryState, which polls every 10 seconds. That solved the complaint that power values updated only about every 2 minutes under the stock behavior. The command can also be triggered manually from the Web App command area when you want an immediate state dump. [#20702297]

Which dpIDs have been identified for the TOMZN TOMPD-63-LW, and what do dpIDs 1, 6, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 101, 104, and 105 mean?

The key dpIDs are known. 1 total energy, 6 phase A V/I/P raw packet, 9 fault bitmap, 11 prepayment switch, 12 clear prepaid energy, 13 balance energy, 14 charge energy, 15 leakage current, 16 relay switch, 17 alarm_set_1, 18 alarm_set_2, 19 breaker ID, 21 leakage test, 101 clear all energy, 104 power factor, and 105 supply frequency. Later cloud data also exposed 106 refresh, 116 voltage, 117 current, and 118 active power on newer units. [#20854635]

How do channels and dpIDs differ in OpenBeken, and how should linkTuyaMCUOutputToChannel be used correctly on a TuyaMCU breaker?

dpIDs are fixed Tuya datapoints; channels are OpenBeken variables you assign yourself. You can map any suitable dpID to any free channel, but the meaning and type of the dpID do not change. The correct syntax is linkTuyaMCUOutputToChannel [dpId] [varType] [channelID]. In practice, the thread used mappings like linkTuyaMCUOutputToChannel 16 bool 1 for the relay and linkTuyaMCUOutputToChannel 1 val 5 for total energy. [#20700864]

Why does dpID 9 on the TOMPD-63-LW behave like a bitmap, and how can its fault bits be mapped to alarms such as overload, leakage, overvoltage, undervoltage, or low balance?

dpID 9 is a bitmap because each bit represents one fault flag, not one numeric state. Testing showed values such as 4, 8, and 32768, matching single-bit alarms rather than sequential IDs. The Tuya model labels include overload, leakage current alarm, overvoltage, undervoltage, and no-balance alarm. For example, a leakage self-test produced 8, which matched the self-test or leakage-related bit position, while low balance matched a high-order bit. [#20842982]

How can I decode and use alarm_set_1 and alarm_set_2 raw packets from dpIDs 17 and 18 for protection thresholds on the TOMPD-63-LW?

Decode them as 4-byte records per protection: byte 1 = protection code, byte 2 = trip mode, bytes 3–4 = threshold. The thread decoded dpID 17 payloads like 04 01 00 1E as leakage protection enabled, trip-on-fault, threshold 30 mA. dpID 18 grouped three protections in 12 bytes, for example overcurrent, overvoltage, and undervoltage. These packets are mainly useful for reading or writing thresholds, but the actual active fault state still reports through dpID 9. [#20849043]

What is the best way to remove leftover buttons or fields from the OpenBeken web UI after changing or clearing autoexec.bat on this breaker?

Set the old channels back to Channel Type = none in the Web App. Clearing autoexec.bat alone does not remove previously stored UI channel types, so the empty controls remain visible. The fix was confirmed after manually resetting those channel types to default, which cleaned the main interface without a hard reset. If you change autoexec layouts often, clear channel types before assuming the script failed. [#20710443]

How do you get the full Tuya data model and dpID list for a TOMZN TOMPD-63-LW from the Tuya developer platform or cloud explorer?

Use Tuya Developer, not guesswork. 1. Create a Tuya developer project and bind the device. 2. Copy the device ID from the cloud device page. 3. In Cloud Explorer, run the Query Things Data Model request to return the full model JSON with abilityId, access mode, code, scale, and units. This method exposed items like dpIDs 104, 105, 106, 116, 117, and 118 that were not obvious from the early UART logs alone. [#20854635]

OpenBeken vs ESPHome vs Tasmota for a TuyaMCU-based DIN breaker like the TOMZN TOMPD-63-LW: which approach fits best and why?

OpenBeken fits best when the device is TuyaMCU-based and you want full local datapoint control. The thread began with users comparing OpenBeken, Tasmota, and ESPHome, but all concrete progress happened with OpenBeken: successful flashing, dpID discovery, custom autoexec files, fault decoding, and faster polling. One user did mention a similar breaker already flashed with ESPHome, but no equivalent TOMPD-63-LW mapping was developed there. For this exact model, OpenBeken is the only fully documented path in the thread. [#20693722]

Why can leakage current, current, and VCP-based channels interfere in some OpenBeken versions, and what changed with LeakageCurrent_div1000 and RAW_TAC2121C_VCP fixes?

They can interfere because older VCP handling wrote values into channels by channel type, creating race conditions when more than one current-like channel existed. That caused leakage current to mirror the main current or swap values unpredictably. The thread led to two fixes: a dedicated LeakageCurrent_div1000 type and later RAW_TAC2121C_VCP changes so multi-phase and shared-current cases behaved correctly. The maintainer explicitly merged a fix so VCP would only target the intended current channel. [#20871205]

What steps can bring the TOMPD-63-LW screen back if screen bright time was accidentally set to off and the display is no longer visible?

You can recover it blindly from the front keys. 1. Power-cycle the breaker so the menu state is predictable. 2. Long-press the set key, then press the up arrow about 10 times to raise screen bright time above zero. 3. Long-press set again to save. A flashlight may help on the older monochrome LCD, but the blind sequence alone was confirmed to restore a fully dark screen on this model. [#21615685]

How can the TOMZN TOMPD-63-LW be configured to stay off after power-up and only energize the relay after a web, MQTT, or API command?

The thread does not provide a finished power-up-off recipe for this breaker, so there is no confirmed TOMPD-63-LW startup command sequence here. What is confirmed is that relay state is exposed as dpID 16 and mapped in OpenBeken with a toggle channel, so any solution must act on that relay channel after boot. A later user asked for exactly this behavior, but no tested answer was posted in the thread. [#21740935]
Generated by the language model.
ADVERTISEMENT