I have a Flood Water Leak Sensor and here are some info about it. It’s using a CBU BK7231N module and the model on the PCB is DP-WW001. It was running 1.0.11 firmware. It was bought from banggood (not available at the moment)



I couldn’t get the gpio pins from Tuya GPIO Config so I tried to find them manually. It seems it has the same pins with the other water leak sensors using the CBU module.
Here is the OBK config:
I flashed it using UART with BK7231 GUI Flash Tool.
I compared many other autoexec files from other posts to understand what is needed and I tried to keep it simple. In the future I want to improve it and go into sleep for 1 day if MQTT is not connected after a few seconds.
The water sensor is 0 when it detects water. If it changes from 1 to 0 and then back to 1 (dry) the sleeping/waking is working fine. There is an issue when it changes from 1 to 0 (waking up) and staying at 0 (wet) when it goes into sleep.
At the moment I have set DSEdge to 0 which seems to work better except the restart when it should go into sleep. I might need to investigate it further.






I couldn’t get the gpio pins from Tuya GPIO Config so I tried to find them manually. It seems it has the same pins with the other water leak sensors using the CBU module.
Here is the OBK config:
{
"vendor": "Tuya",
"bDetailed": "0",
"name": "Guudgo Flood Water Leak Sensor",
"model": "DP-WW001",
"chip": "BK7231N",
"board": "CBU",
"flags": "1024",
"keywords": [
"water",
"leak",
"flood"
],
"pins": {
"16": "dInput_NoPullUp_n;1",
"17": "BAT_Relay;4",
"20": "Btn;2",
"23": "BAT_ADC;5",
"26": "WifiLED;3"
},
"command": "",
"image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
"wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
}
I flashed it using UART with BK7231 GUI Flash Tool.
I compared many other autoexec files from other posts to understand what is needed and I tried to keep it simple. In the future I want to improve it and go into sleep for 1 day if MQTT is not connected after a few seconds.
// channels
// 1(pin 16) dInput_NoPullUp_n
// 2(pin 20) Btn
// 3(pin 26) WifiLED
// 4(pin 17) BAT_Relay
// 5(pin 23) BAT_ADC
PowerSave 1
// Battery config and measure every 2sec
Battery_Setup 2000 3000 2.03 2400 4096
Battery_cycle 2
// 0: wake up on rising edge
// 1: wake up on falling edge
// 2(default): state high - wake up on falling edge, state low - wake up on rising edge
// Second argument (optional) allows to set per-pin DSEdge
DSEdge 0 16
// button (pin 20) hold launch safe mode
addEventHandler OnHold 20 SafeMode
setChannelLabel 1 "Water Leak"
// wait for MQTT connection
waitFor MQTTState 1
delay_s 1
// publish water state
publishchannel 1
// wait and sleep
delay_s 20
PinDeepSleep
The water sensor is 0 when it detects water. If it changes from 1 to 0 and then back to 1 (dry) the sleeping/waking is working fine. There is an issue when it changes from 1 to 0 (waking up) and staying at 0 (wet) when it goes into sleep.
Spoiler:
If I set DSEdge to 0:
waking up, after delay_s 20 restarts, after delay_s 20 sleeping. if sensor changes 1 > 0 it’s waking up.
If I set DSEdge to 1:
waking up, after delay_s 20 restarts, after delay_s 20 sleeping. no waking up.
If I set DSEdge to 2:
waking up, after delay_s 20 sleeping. no waking up.
waking up, after delay_s 20 restarts, after delay_s 20 sleeping. if sensor changes 1 > 0 it’s waking up.
If I set DSEdge to 1:
waking up, after delay_s 20 restarts, after delay_s 20 sleeping. no waking up.
If I set DSEdge to 2:
waking up, after delay_s 20 sleeping. no waking up.
At the moment I have set DSEdge to 0 which seems to work better except the restart when it should go into sleep. I might need to investigate it further.