Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamdivadiow wrote:I imagine the dpIDs have changed, different schema?
If you have a factory fw dump and it wasn't paired with Tuya first feel free to post file and I'll see if I can get the schema. or DM me file and I'll reset it and check.
yarik8117 wrote:>>21784898
Does your chip temperature also remain at 82 degrees after reflashing? Or is it just me? I haven't been able to start reading data yet. I think the firmware from BK7238 may not be entirely suitable for our T1-2S-NL. What specific firmware did you install?
clearIO
flags 0
SetFlag 46 1
startDriver TuyaMCU
tuyaMcu_setBaudRate 115200
startDriver NTP
ntp_setServer 150.214.94.5
ntp_timeZoneOfs 2
waitFor MQTTState 1
//tuyaMcu_defWiFiState 4
linkTuyaMCUOutputToChannel 1 bool 1
setChannelType 1 toggle
setChannelLabel 1 "Relay"
linkTuyaMCUOutputToChannel 139 bool 2
setChannelType 2 toggle
setChannelLabel 2 "Prepayment"
linkTuyaMCUOutputToChannel 141 bool 3
setChannelType 3 toggle
setChannelLabel 3 "Clr Prepaid Energy"
linkTuyaMCUOutputToChannel 123 val 4
setChannelType 4 EnergyTotal_kWh_div1000
setChannelLabel 4 "Total Energy"
linkTuyaMCUOutputToChannel 18 val 7
setChannelType 7 Current_div1000
setChannelLabel 7 "Current"
linkTuyaMCUOutputToChannel 10 val 6
setChannelType 6 Power_div100
setChannelLabel 6 "Power"
linkTuyaMCUOutputToChannel 20 val 5
setChannelType 5 Voltage_div100
setChannelLabel 5 "Voltage"
linkTuyaMCUOutputToChannel 124 val 8
setChannelType 8 TextField
setChannelLabel 8 "Leakage Current"
linkTuyaMCUOutputToChannel 132 val 9
setChannelType 9 Readonly
setChannelLabel 9 "Alarms"
linkTuyaMCUOutputToChannel 104 val 10
setChannelType 10 TextField
setChannelLabel 10 "Overvoltage limit"
linkTuyaMCUOutputToChannel 140 val 11
setChannelType 11 EnergyTotal_kWh_div100
setChannelLabel 11 "Remaining Prepaid Energy"
linkTuyaMCUOutputToChannel 142 val 12
setChannelType 12 TextField
setChannelLabel 12 "Recharge Prepaid Energy [kWh*100], i.e. 1kWh = 100"
linkTuyaMCUOutputToChannel 121 val 13
setChannelType 13 TextField
setChannelLabel 13 "Leakage threshold"
linkTuyaMCUOutputToChannel 134 val 14
setChannelType 14 PowerFactor_div100
setChannelLabel 14 "Power Factor"
linkTuyaMCUOutputToChannel 133 val 15
setChannelType 15 Frequency_div100
setChannelLabel 15 "Frequency [Hz]"
linkTuyaMCUOutputToChannel 105 val 16
setChannelType 16 TextField
setChannelLabel 16 "Overcurrent limit"
linkTuyaMCUOutputToChannel 106 val 17
setChannelType 17 TextField
setChannelLabel 17 "Power limit"
linkTuyaMCUOutputToChannel 119 val 18
setChannelType 18 TextField
setChannelLabel 18 "Undervoltage limit"
linkTuyaMCUOutputToChannel 125 val 19
setChannelType 19 TextField
setChannelLabel 19 "Refresh interval"
linkTuyaMCUOutputToChannel 126 bool 20
setChannelType 20 toggle
setChannelLabel 20 "Real Time"
linkTuyaMCUOutputToChannel 120 bool 21
setChannelType 21 Toggle
setChannelLabel 21 "Over-limit ctrl"
linkTuyaMCUOutputToChannel 113 bool 22
setChannelType 22 Toggle
setChannelLabel 22 "Clear acc. data"
linkTuyaMCUOutputToChannel 101 val 27
setChannelType 27 TextField
setChannelLabel 27 "Electricity price"
linkTuyaMCUOutputToChannel 102 val 28
setChannelType 28 ReadOnly
setChannelLabel 28 "Total electricity cost"
linkTuyaMCUOutputToChannel 143 val 30
setChannelType 30 TextField
setChannelLabel 30 "Low prepaid energy alarm value"
linkTuyaMCUOutputToChannel 137 val 31
setChannelType 31 TextField
setChannelLabel 31 "Overvolt recov. delay"
// test other Dpid - Ch 0
// linkTuyaMCUOutputToChannel 138 enum 0
// setChannelType 0 TextField
// setChannelLabel 0 "Test DpID 138 Pwr on status"
// NOTE: addRepeatingEvent [RepeatTime] [RepeatCount]
// code below will forever Send query state command every 5 seconds
// addRepeatingEvent 5 -1 tuyaMcu_sendQueryState
// Not needed in this device, since TuyaMCU sends everything when necessary
// we need it just first time to obtain initial status. Some dpIDs not reported without asking
tuyaMcu_sendQueryStatelinkTuyaMCUOutputToChannel 19 val 6
setChannelType 6 Power_div100
setChannelLabel 6 "Power"TL;DR: With 44 DpIDs and “flash OpenBeken on it,” this thread shows GR2P-WS owners how to replace Tuya cloud with OpenBeken, map TuyaMCU datapoints, and restore Wi‑Fi, MQTT, and Home Assistant reporting on both CB2S/BK7231N and newer T1-2S-NL variants. [#21142057]
Why it matters: This FAQ turns a long reverse-engineering thread into a fast, quotable setup guide for getting Atorch GR2P-WS energy breakers working locally.
| Variant | Wi‑Fi module / chip | TuyaMCU baud rate reported | Key flashing note |
|---|---|---|---|
| GR2P-WS, early | CB2S / BK7231N | 9600 | Needed RX/TX isolation; bk7231flasher 1.1.6 worked reliably |
| GR2PWSL | Different main MCU + same TuyaMCU-style mapping | Not highlighted as changed | Added leakage CT hardware and newer schema details |
| GR2P-WS, late | T1-2S-NL / BK7238-class handling | 115200 | Needed OpenBeken BK7238 path and corrected autoexec |
Key insight: GR2P-WS is not a simple standalone smart relay. It is a TuyaMCU design, so flashing OpenBeken only replaces the Wi‑Fi module; the device works correctly only after you map the right DpIDs and baud rate in
autoexec.bat.
autoexec.bat in LittleFS, paste the GR2P-WS TuyaMCU mapping, reboot, and run Home Assistant discovery. The original working map used startDriver TuyaMCU, tuyaMcu_setBaudRate 9600, and linked relay, voltage, current, power, and energy channels. [#21142057]autoexec.bat. [#21142057]e1kylf6c, confirming the same basic schema even on newer hardware. [#21784596]GR2PWS_Reset_BK7231N_QIO_2024-23-6-20-54-08.bin and saw the device appear in the router as a Tuya client again, which matched the expected behavior. The thread author clarified that the backup exists for rollback and analysis only. To run locally, you must flash a real OpenBK7231N build and then load the GR2P-WS autoexec.bat. [#21269095]autoexec.bat, paste the mapping, then use the Home Assistant Configuration page and press “Start Home Assistant discovery.” That produced MQTT entities such as current, voltage, power, total energy, frequency, and power factor. [#21264172]flags 0 in autoexec.bat clears all flags at boot, so removing that line is the safer fix if you want diagnostics in Home Assistant. The web page can still show local values even when MQTT entities remain unknown. [#21375420]192.168.4.1, enter the SSID and password, and reboot. This worked better than guessing Wi‑Fi and MQTT fields in the flasher. If needed, reflash again with only OpenBeken and add network settings later from the UI. [#21264172]autoexec.bat that incorrectly linked linkTuyaMCUOutputToChannel 10 val 6, which broke the power sensor. The fix was to restore the original mapping: linkTuyaMCUOutputToChannel 19 val 6, then setChannelType 6 Power_div100. After that change, the power value started working. This matches the earlier CB2S schema, where DpID 19 is cur_power and DpID 10 is not the live power datapoint. [#21787724]startDriver TuyaMCU, try tuyaMcu_setBaudRate 115200, and test tuyaMcu_sendQueryState; one user got OK only after fixing setup. 3. If nothing changes, restore the stock backup to prove the hardware still works, then reflash OpenBeken and correct the mapping. The thread also tested flag 26 for UART swap, but the durable fix was proper baud plus correct power mapping. [#21785449]wchisp info showed CFG_ROM_READ 0, which disables normal flash readout. That protection, plus possible encryption, stopped practical full dumping and easy reflashing. [#21568865]