Alternative control html page for TOMPD-63-WIFI
This way you can also do rounding in the any way you like.
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tam
ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 0, product_information_valid=0, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=0
//starte TuyaMCU
startDriver TuyaMCU
tuyaMcu_defWiFiState 4
tuyaMcu_setBaudRate 9600
//starte set ip to NTP
startDriver NTP
ntp_setServer 172.20.48.1
ntp_timeZoneOfs 2
setChannelType 1 temperature_div10
setChannelLabel 1 "Water temperature"
linkTuyaMCUOutputToChannel 8 val 1
addRepeatingEvent 15 -1 publishFloat temperatur $CH1/10 0 2
setChannelType 2 temperature_div10
setChannelLabel 2 "High temperature alarm value"
linkTuyaMCUOutputToChannel 102 val 2
addRepeatingEvent 15 -1 publishFloat temperatur_max $CH2/10 0 2
//set value to Channel 102 TuyaMcu
//set virtual button temp max
setChannelLabel 20 "Temp max"
setChannelType 20 Toggle
setChannel 20 0
setChannelType 3 temperature_div10
setChannelLabel 3 "Low temperature alarm value"
linkTuyaMCUOutputToChannel 103 val 3
addRepeatingEvent 15 -1 publishFloat temperatur_min $CH3/10 0 2
//set value to Channel 103 TuyaMcu
//set virtual button temp min
setChannelLabel 21 "Temp min"
setChannelType 21 Toggle
setChannelType 4 Ph
setChannelLabel 4 "PH Aktuell"
linkTuyaMCUOutputToChannel 106 val 4
addRepeatingEvent 15 -1 publishFloat ph $CH4/100 0 2
setChannelType 5 Ph
setChannelLabel 5 "Warning pH value higher than set"
linkTuyaMCUOutputToChannel 107 val 5
addRepeatingEvent 15 -1 publishFloat ph_max $CH5/100 0 2
//set value to Channel 107 TuyaMcu
//set virtual button ph max
setChannelLabel 22 "PH max"
setChannelType 22 Toggle
setChannelType 6 Ph
setChannelLabel 6 "Warning pH value lower than set"
linkTuyaMCUOutputToChannel 108 val 6
addRepeatingEvent 15 -1 publishFloat ph_min $CH6/100 0 2
//set value to Channel 108 TuyaMcu
//set virtual button ph min
setChannelLabel 23 "PH min"
setChannelType 23 Toggle
setChannelType 7 Tds
setChannelLabel 7 "TDS value"
linkTuyaMCUOutputToChannel 111 bool 7
addRepeatingEvent 15 -1 publishFloat tds $CH7 0 2
setChannelType 8 Tds
setChannelLabel 8 "Warning TDS value higher than set"
linkTuyaMCUOutputToChannel 112 val 8
addRepeatingEvent 15 -1 publishFloat tds_max $CH8 0 2
//set value to Channel 108 TuyaMcu
//set virtual button tds max
setChannelLabel 24 "Tds max"
setChannelType 24 Toggle
setChannelType 9 Tds
setChannelLabel 9 "Warning TDS value lower than set"
linkTuyaMCUOutputToChannel 113 val 9
addRepeatingEvent 15 -1 publishFloat tds_min $CH9 0 2
//set value to Channel 113 TuyaMcu
fakeTuyaPacket 55AA03070008710200040000000088
//set virtual button tds min
setChannelLabel 25 "Tds min"
setChannelType 25 Toggle
setChannelType 10 Orp
setChannelLabel 10 "ORP value"
linkTuyaMCUOutputToChannel 131 val 10
addRepeatingEvent 15 -1 publishFloat orp $CH10 0 0
setChannelType 11 Orp
setChannelLabel 11 "ORP high alarm value"
linkTuyaMCUOutputToChannel 132 val 11
addRepeatingEvent 15 -1 publishFloat orp_max $CH11 0 0
//set value to Channel 132 TuyaMcu
//set virtual button orp max
setChannelLabel 26 "Orp max"
setChannelType 26 Toggle
setChannelType 12 Orp
setChannelLabel 12 "ORP low alarm value"
linkTuyaMCUOutputToChannel 133 val 12
addRepeatingEvent 15 -1 publishFloat orp_low $CH12 0 0
//set value to Channel 1133 TuyaMcu
//set virtual button orp min
setChannelLabel 27 "Orp min"
setChannelType 27 Toggle
tuyaMcu_sendQueryState
delay_s 120 // first start wait values
again:
delay_s 15
// temperature values check set temperatur_max or temperatur_min Buttom to on or off
if $CH1>$CH2 then setChannel 20 1
if $CH1<$CH2 then setChannel 20 0
if $CH1<$CH3 then setChannel 21 1
if $CH1>$CH3 then setChannel 21 0
// Ph value check set ph_max or ph_min Butt
//starte TuyaMCU
startDriver TuyaMCU
tuyaMcu_defWiFiState 4
tuyaMcu_setBaudRate 9600
//starte set ip to NTP
startDriver NTP
ntp_setServer 172.20.48.1
ntp_timeZoneOfs 2
setChannelType 1 temperature_div10
setChannelLabel 1 "Water temperature"
linkTuyaMCUOutputToChannel 8 val 1
addRepeatingEvent 15 -1 publishFloat temperatur $CH1/10 0 2
setChannelType 2 temperature_div10
setChannelLabel 2 "High temperature alarm value"
linkTuyaMCUOutputToChannel 102 val 2
addRepeatingEvent 15 -1 publishFloat temperatur_max $CH2/10 0 2
//set value to Channel 102 TuyaMcu
//set virtual button temp max
setChannelLabel 20 "Temp max"
setChannelType 20 Toggle
setChannel 20 0
setChannelType 3 temperature_div10
setChannelLabel 3 "Low temperature alarm value"
linkTuyaMCUOutputToChannel 103 val 3
addRepeatingEvent 15 -1 publishFloat temperatur_min $CH3/10 0 2
//set value to Channel 103 TuyaMcu
//set virtual button temp min
setChannelLabel 21 "Temp min"
setChannelType 21 Toggle
setChannelType 4 Ph
setChannelLabel 4 "PH Aktuell"
linkTuyaMCUOutputToChannel 106 val 4
addRepeatingEvent 15 -1 publishFloat ph $CH4/100 0 2
setChannelType 5 Ph
setChannelLabel 5 "Warning pH value higher than set"
linkTuyaMCUOutputToChannel 107 val 5
addRepeatingEvent 15 -1 publishFloat ph_max $CH5/100 0 2
//set value to Channel 107 TuyaMcu
//set virtual button ph max
setChannelLabel 22 "PH max"
setChannelType 22 Toggle
setChannelType 6 Ph
setChannelLabel 6 "Warning pH value lower than set"
linkTuyaMCUOutputToChannel 108 val 6
addRepeatingEvent 15 -1 publishFloat ph_min $CH6/100 0 2
//set value to Channel 108 TuyaMcu
//set virtual button ph min
setChannelLabel 23 "PH min"
setChannelType 23 Toggle
setChannelType 7 Tds
setChannelLabel 7 "TDS value"
linkTuyaMCUOutputToChannel 111 bool 7
addRepeatingEvent 15 -1 publishFloat tds $CH7 0 2
setChannelType 8 Tds
setChannelLabel 8 "Warning TDS value higher than set"
linkTuyaMCUOutputToChannel 112 val 8
addRepeatingEvent 15 -1 publishFloat tds_max $CH8 0 2
//set value to Channel 108 TuyaMcu
//set virtual button tds max
setChannelLabel 24 "Tds max"
setChannelType 24 Toggle
setChannelType 9 Tds
setChannelLabel 9 "Warning TDS value lower than set"
linkTuyaMCUOutputToChannel 113 val 9
addRepeatingEvent 15 -1 publishFloat tds_min $CH9 0 2
//set value to Channel 113 TuyaMcu
fakeTuyaPacket 55AA03070008710200040000000088
//set virtual button tds min
setChannelLabel 25 "Tds min"
setChannelType 25 Toggle
setChannelType 10 Orp
setChannelLabel 10 "ORP value"
linkTuyaMCUOutputToChannel 131 val 10
addRepeatingEvent 15 -1 publishFloat orp $CH10 0 0
setChannelType 11 Orp
setChannelLabel 11 "ORP high alarm value"
linkTuyaMCUOutputToChannel 132 val 11
addRepeatingEvent 15 -1 publishFloat orp_max $CH11 0 0
//set value to Channel 132 TuyaMcu
//set virtual button orp max
setChannelLabel 26 "Orp max"
setChannelType 26 Toggle
setChannelType 12 Orp
setChannelLabel 12 "ORP low alarm value"
linkTuyaMCUOutputToChannel 133 val 12
addRepeatingEvent 15 -1 publishFloat orp_low $CH12 0 0
//set value to Channel 1133 TuyaMcu
//set virtual button orp min
setChannelLabel 27 "Orp min"
setChannelType 27 Toggle
tuyaMcu_sendQueryState
delay_s 120 // first start wait values
again:
delay_s 15
// temperature values check set temperatur_max or temperatur_min Buttom to on or off
if $CH1>$CH2 then setChannel 20 1
if $CH1<$CH2 then setChannel 20 0
if $CH1<$CH3 then setChannel 21 1
if $CH1>$CH3 then setChannel 21 0
// Ph value check set ph_max or ph_min Butthttps://limewire.com/d/NhWMf#aX2izbbfUSTL;DR: With a 2MB backup and the right baud rate, the PH-W218 can be moved to OpenBeken; as one expert put it, "fakeTuyaPacket simulated TuyaMCU" and should not be used to write real thresholds. This FAQ helps Home Assistant and OpenBeken users flash the CB3S module, confirm TuyaMCU communication, and map pH, ORP, TDS, EC, and temperature correctly. [#21146899]
Why it matters: The thread shows that most PH-W218 failures come from power, baud, UART traces, or wrong command choice, not from the sensor hardware itself.
| Option | Use it for | Worked result in thread | Main risk |
|---|---|---|---|
| 9600 baud | Normal TuyaMCU link on this device | Stable values reported after full setup | No data if the module is miswired |
| 115200 baud | Diagnostic retry when 9600 fails | Some users saw values, but also more errors | Noisy logs and unstable parsing |
fakeTuyaPacket |
Testing parser input only | Changes Wi-Fi-side values only | Does not write real MCU settings |
tuyaMcu_sendState |
Writing real dpID values to TuyaMCU | Correct method for thresholds | Can fail if sent too early after boot |
Key insight: OpenBeken replaces only the CB3S Wi-Fi module. The PH-W218’s secondary MCU still runs the measurement logic and keeps the built-in displays working, so success depends on reliable TuyaMCU serial communication, not on rewriting the whole device. [#21134253]
tuyaMcu_setBaudRate 9600, delay_s 120 on first start, and a 15-second loop for periodic checks and MQTT publishing. [#21203138]publishFloat gained a decimal-place argument, so publishFloat ph_aktuell $CH4/100 0 2 publishes 7.40 instead of 7.400000. [#21138792]TuyaMCU driver, set the baud, and map dpIDs such as 8, 106, and 111 to channels. 3. Check the Web App log and only then add MQTT or Home Assistant publishing. The thread’s working examples use tuyaMcu_defWiFiState 4, then channel mapping, then tuyaMcu_sendQueryState. [#21131597]setChannelType, setChannelLabel, and linkTuyaMCUOutputToChannel [dpID] val [channel] to map them. [#21131505]TuyaMCU, save the config, and power the whole device fully off and on. 2. In the log, look for heartbeat or state lines such as cmd 0 (Hearbeat) or cmd 7 (State). 3. If needed, run tuyaMcu_sendQueryState and verify that the MCU actually answers. A console OK only means the command was accepted, not that the MCU replied. [#21202813]tuyaMcu_setBaudRate 9600, while 115200 produced values for one user but also “a lot of errors.” If neither speed shows TuyaMCU messages after a full power cycle, suspect flags, broken traces, or lost UART connection instead of firmware logic. [#21203138]tuyaMcu_sendState, not with simulated packets. The maintainer’s example was a short boot sequence such as delay_s 1, then tuyaMcu_sendState 103 2 2300, then another delay before the next dpID. He also warned that addRepeatingEvent 15 -1 tuyaMcu_sendState ... sends forever every 15 seconds, which is usually wrong for fixed alarm limits. [#21147072]fakeTuyaPacket is the wrong tool because it only simulates packets arriving from the MCU to the Wi-Fi module. It can change what OpenBeken displays or publishes, but it does not write real settings into the PH-W218 controller. Use tuyaMcu_sendState [dpID] [dpType] [value] whenever you want the actual TuyaMCU to receive a threshold or setting and calculate the checksum automatically. [#21146899]publishFloat formatting. The thread shows pH published as $CH4/100 0 2, so a raw value like 740 becomes 7.40; temperature used /10, while ORP was often published with 0 decimals. For PH specifically, the maintainer added a decimal-place argument, so publishFloat ph_aktuell $CH4/100 0 2 fixes outputs like 7.400000 and publishes 7.40 instead. [#21138792]unit_of_measurement: Ph together with device class ph. In the thread, a fix was proposed so the PH channel type stops publishing unit_of_meas, and the maintainer later said current releases should not send it for PH. If the error returns, remove the device and re-pair through Home Assistant discovery so stale discovery data is cleared. [#21645909]