logo elektroda
logo elektroda
X
logo elektroda

[Solved] Dewin RMDT-1PNL 63 Smart Circuit Breaker OpenBK7231 MQTT Setup

lubopetrov 2760 66
Best answers

How do I configure a flashed Dewin smart circuit breaker in OpenBK7231 so Home Assistant shows the on/off switch and power measurements instead of only generic device info?

You flashed the breaker correctly, but it still needs TuyaMCU setup in OpenBK; until you map the Tuya dpIDs, Home Assistant will only see generic info and no switch/power entities [#21566792][#21561187] Use an `autoexec.bat` that starts `TuyaMCU`, sets `tuyaMcu_defWiFiState 4`, maps dpID 16 to a toggle channel for the breaker switch, and maps dpID 6 as `RAW_V2C3P3` to channels 3/4/5 for voltage/current/power [#21574373][#21574681] For the total-energy reading, map dpID 1 to its own channel and use an energy-total channel type/scaling that matches the firmware; the thread notes dpID 1 is `total_forward_energy` in kWh and may need divider tuning [#21574926][#21589431] If the breaker is only powered from the USB programmer, you won’t get real measurements or proper switching, so disconnect the programmer and test it on mains [#21572371] If voltage/current/power need calibration, add offsets in the `RAW_V2C3P3` mapping and make sure you’re on a recent OBK build that supports VCP calibration [#21589836][#21589859] MQTT publishes on value changes by default; if you want periodic refreshes, enable flag 2 and set `mqtt_broadcastInterval`, though the default change-based updates are usually enough [#21590110]
Generated by the language model.
ADVERTISEMENT
  • #61 21589905
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12374
    Hmm interesting, the other user who requested calibration didn't report that, but again, maybe they used it only for voltage, which is never 0.

    I've added a fix that applies offset only if it's non-zero, it should be available in Release soon (like 15 minutes for Github to build)
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #62 21589988
    lubopetrov
    Level 2  
    Posts: 39
    I confirm that now everything looks OK. BTW how can I adjust MQTT refresh rate?
  • ADVERTISEMENT
  • #63 21590020
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12374
    For each dpID variable, the variable is resent via MQTT when the value changes. Do you want MQTT to broadcast values more frequently, even if there is no change?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #64 21590103
    lubopetrov
    Level 2  
    Posts: 39
    Yes. How can this be done?
  • #65 21590110
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12374
    You can enable flag 2:
    
    Flag 2 - [MQTT] Broadcast self state every N (def: 60) seconds (delay configurable by 'mqtt_broadcastInterval' and 'mqtt_broadcastItemsPerSec' commands)
    

    and to autoexec.bat add set of mqtt_broadcastInterval to lower value, like "mqtt_broadcastInterval 30" - every 30 seconds
    But why do you want it? If there is no change, there is no need to resend.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #66 21590670
    lubopetrov
    Level 2  
    Posts: 39
    you are rigth. I will leave it as default
  • #67 21590673
    lubopetrov
    Level 2  
    Posts: 39
    Everything is correct. Delta at idle was fixed. Thank you.

Topic summary

✨ The discussion focuses on integrating the Dewin RMDT-1PNL 63 Smart Circuit Breaker with Home Assistant using the OpenBK7231IN firmware without relying on the Tuya cloud. After flashing the device with OpenBK7231IN_QIO_1.18.102.bin, the user could add the breaker to Home Assistant but initially lacked power consumption data and ON/OFF control. It was identified as a TuyaMCU-based device requiring specific configuration, including enabling flags 46 or 47 and running the TuyaMCU driver with proper dpID mappings in autoexec.bat. Key dpIDs include 1 (total forward energy in kWh with scaling), 6 (Phase A voltage, current, and power in a raw 8-byte format), and 16 (breaker switch toggle). The user was guided to disconnect the programmer and power the device from the grid to obtain valid measurements. Configuration steps involved setting channel types for toggle, voltage, current, and power, and linking TuyaMCU outputs to channels with appropriate scaling and offsets to fine-tune readings. The toggle control was functional on one unit but not on the other due to a damaged board trace, which was resolved after repair. The user also inquired about renaming channels, adjusting measurement precision, refresh rates (suggested via addRepeatingEvent for periodic state queries), and MQTT integration with Home Assistant using HASS discovery. The discussion included troubleshooting logs, dpID data extraction, and firmware backup restoration. The final setup allowed accurate voltage, current, power, and total energy monitoring with toggle control via Home Assistant, fully independent of the Tuya cloud.
Generated by the language model.

FAQ

TL;DR: With 8-byte dpID 6 metering data and dpID 16 switch control, this breaker works once you configure TuyaMCU mapping after flashing. As one expert put it, "It will not work without this step." This FAQ is for Home Assistant and MQTT users who flashed OpenBK7231 but still lack ON/OFF control or power readings. [#21561187]

Why it matters: Flashing alone is not enough on this Dewin breaker; the usable result comes from correct TuyaMCU setup, dpID mapping, and current firmware.

Method Result on this breaker Best use
Template import Failed with “no meaningful pins data found” Not suitable here
TuyaMCU mapping in autoexec.bat Working toggle, voltage, current, power, energy Correct approach
BL0942 driver Wrong method here and may cause problems Avoid for this model

Key insight: This Dewin RMDT-1PNL 63 is a TuyaMCU breaker, not a simple direct-GPIO device. Map dpID 16 for the relay and dpID 6 for the 8-byte V/C/P packet, and the MQTT entities appear correctly. [#21574681]

Quick Facts

  • dpID 6 carries an 8-byte payload in big-endian format: 2 bytes voltage at 0.1 V, 3 bytes current at 0.001 A, and 3 bytes power at 0.0001 kW. [#21580392]
  • The working switch mapping used dpID 16 as a boolean toggle, while voltage, current, and power were exposed on channels 3, 4, and 5. [#21574681]
  • Total energy came from dpID 1 and was later treated as kWh with scale 2, so EnergyTotal_kWh_div100 matched the thread’s final setup. [#21589864]
  • The breaker reported no meaningful load data over USB-only power; measurements appeared only after connecting it to mains with a real load. [#21572371]
  • Calibration support for VCP offsets was added after June 17, which explains why older OpenBK7231 builds ignored voltage and power deltas. [#21589871]

How do I configure a Dewin RMDT-1PNL 63 smart circuit breaker in OpenBK7231 after flashing so the ON/OFF switch and power readings appear in Home Assistant over MQTT?

You must configure TuyaMCU mappings after flashing. Use this 3-step setup: 1. Start TuyaMCU and force paired Wi-Fi state in autoexec.bat. 2. Map dpID 16 as the toggle. 3. Map dpID 6 as RAW_V2C3P3 to channels 3, 4, and 5, then expose MQTT or HASS discovery. The working thread config used channel 2 as toggle, channel 3 as Voltage_div10, channel 4 as Current_div1000, and channel 5 as Power. Flashing alone only showed general info, not relay or metering entities. [#21574681]

Why does OpenBK7231 say "Sorry, no meaningful pins data found" when I try to import a template on this Dewin smart breaker?

It says that because this breaker is not controlled as a normal pin-template device. The board photos led to the conclusion that it is a TuyaMCU design, so importing a GPIO-style template did not produce usable pins data. In this model, the relay and measurements come through Tuya data points instead of direct pin assignments. That is why template import failed and the fix was to follow the TuyaMCU guide instead. [#21566792]

What is a TuyaMCU device, and how can I tell if my Dewin RMDT-1PNL breaker uses TuyaMCU instead of direct GPIO control?

"TuyaMCU" is a serial control subsystem that manages relay and sensor functions through data points, instead of exposing those functions as direct GPIO pins. You can identify it here by two facts: template import failed, and the board photos were recognized as a TuyaMCU design. Later logs also showed TuyaMCU heartbeats and state packets such as 55 AA 03 07 ..., which confirmed serial communication with the MCU. [#21566792]

What is a Tuya dpID, and how do dpIDs map to relay control, voltage, current, power, and total energy in OpenBeken?

"Tuya dpID" is a numbered data point that represents one device feature, such as a switch, energy counter, or raw measurement packet, and OpenBeken maps each dpID to a channel or parser. In this breaker, dpID 16 was the breaker switch, dpID 6 was the 8-byte Phase A packet, and dpID 1 was total forward energy. The successful mapping used dpID 16 for the toggle, dpID 6 for voltage, current, and power, and dpID 1 for total energy. [#21580392]

How can I start the TuyaMCU driver in OpenBK7231 and verify communication using heartbeats, baud rate, and tuyaMcu_sendQueryState?

Start TuyaMCU in autoexec.bat, then confirm heartbeats and state replies in the log. Use this 3-step check: 1. Add startDriver TuyaMCU and tuyaMcu_defWiFiState 4. 2. If needed, set the baud rate; this thread tested 9600. 3. Run tuyaMcu_sendQueryState and look for heartbeat packets and parsed states. The thread later showed valid replies, including heartbeat cmd 0 and multiple parsed dpIDs, which proved communication was working. [#21572159]

Where do I find the DP command output in OpenBeken, and how do flags 46 and 47 help with TuyaMCU debugging?

You get DP output by calling the device URL with cm?cmnd=DP. First enable flag 46, or optionally flag 47 for more data, then run tuyaMcu_sendQueryState, and open a URL like http://DEVICE_IP/cm?cmnd=DP. Flag 46 stores the last seen dpID values so OpenBeken can present them as JSON. That JSON is what you use to confirm whether ids like 1, 6, 16, 102, and 107 are arriving. [#21572288]

How do I map Dewin breaker dpID 16 to a working toggle and dpID 6 to voltage, current, and power channels in autoexec.bat?

Use channel 2 for the switch and channels 3 to 5 for metering. The working mapping was: setChannelType 2 toggle, linkTuyaMCUOutputToChannel 16 bool 2, setChannelType 3 Voltage_div10, setChannelType 4 Current_div1000, setChannelType 5 Power, and linkTuyaMCUOutputToChannel 6 RAW_V2C3P3 3. That made the UI toggle work and exposed volts, amps, and watts. One expert summary from the thread was simple: “set voltage, current, power channel types,” then map dpID 6 to 3, 4, and 5. [#21574681]

Why does the breaker show measurements only after being connected to mains power and not when powered only from the USB programmer?

It shows measurements only on mains because the metering side needs full line power and a real load. While the breaker was powered only from the USB programmer, the thread showed almost no useful load data, and the advisor explicitly said measurements would not appear until it was fully powered from the grid. After connecting mains and a bulb, voltage and later current and power values appeared. [#21572371]

What does the RAW_V2C3P3 format mean for TuyaMCU dpID 6, and how are the 8 raw bytes decoded into voltage, current, and power?

RAW_V2C3P3 means the 8-byte payload is split into 2 bytes voltage, 3 bytes current, and 3 bytes power. In this breaker, the format was decoded as big-endian with voltage in 0.1 V, current in 0.001 A, and active power in 0.0001 kW. For example, the packet 09 26 00 00 33 00 00 0E was interpreted as about 234.2 V, 0.051 A, and about 14 W, which matched a small LED bulb. [#21580392]

How can I remove an extra Toggle button from the OpenBK7231 web UI after testing different channel mappings?

Remove the test mapping and reset that channel’s type in the Web App. In the thread, an extra Toggle 1 appeared because channel 1 had been temporarily set as a toggle during testing. The fix was not just editing autoexec.bat; you also had to open the Web App and change that channel type back to default from the dropdown. That removes the leftover button from the UI. [#21574681]

Which is the right metering method for this Dewin smart breaker: TuyaMCU mapping or the BL0942 driver, and why?

TuyaMCU mapping is the right metering method for this breaker. The thread explicitly warned not to start the BL0942 driver because it could cause problems, and the working measurements were obtained entirely from TuyaMCU dpID 6. This breaker reports metering through the MCU’s raw data packet, not through a directly attached BL0942 energy chip interface exposed to OpenBeken. [#21574447]

How do I add total energy from dpID 1 in OpenBeken and convert it to the correct kWh scale for Home Assistant?

Map dpID 1 to a read-only energy channel and use a kWh-scaled channel type. The final thread config used setChannelType 1 EnergyTotal_kWh_div100 and linkTuyaMCUOutputToChannel 1 val 1. The device schema described dpID 1 as total forward energy in kWh with scale 2, and later tests showed the value rising from 9 after about 1 hour to 21 after about 2 hours on a 100 W bulb, which confirmed it was the cumulative energy register. [#21575291]

Why would two apparently identical Dewin RMDT-1PNL breakers behave differently after flashing, even with the same autoexec.bat?

They can behave differently because the fault may be physical, not logical. In this thread, the second breaker showed readings but the toggle did nothing, even though dpID 16 updates appeared and the UI button changed color. The root cause was later found to be damaged board trace(s) from soldering, not a different model or wrong config. Once the physical damage was identified and fixed, the issue was resolved. [#21580835]

How can I calibrate voltage and power in OpenBK7231 for a TuyaMCU breaker using linkTuyaMCUOutputToChannel deltas, and why did older firmware ignore the offset?

Calibrate by expanding the mapping line with delta parameters and using a recent firmware. The thread changed linkTuyaMCUOutputToChannel 6 RAW_V2C3P3 3 to a fuller form such as linkTuyaMCUOutputToChannel 6 RAW_V2C3P3 3 0 1 0 50, where later arguments add raw-value offsets. Older firmware ignored that because VCP calibration was added only after June 17. A later fix also stopped idle loads from showing the delta when real power was 0 W. [#21589905]

What is the best way to publish Dewin breaker measurements to Home Assistant through MQTT, and how do HASS discovery, flag 2, and mqtt_broadcastInterval affect refresh behavior?

Use normal MQTT state publishing first, then add HASS discovery if you want automatic entities. By default, this breaker republishes dpID-based values when they change, which is usually enough for Home Assistant. If you want periodic rebroadcasts even without change, enable flag 2 and set mqtt_broadcastInterval, for example 30 seconds. The thread recommended leaving defaults unless you specifically need repeat broadcasts, because unchanged values do not need extra traffic. [#21590110]
Generated by the language model.
ADVERTISEMENT