Hello
This is my first teardown article so please for understanding.
Introduction
I bough water leakage sensor DYGSM DY-SQ400B from Aliexpress for 1$. I wanted to connect it directly to my HA instance (bypass Internet connection requirement, which could be a bottleneck during critical situation). I flashed it with great OpenBeken (great thanks for authors
)
There is a teardown of very similar device, but with different chip (CB3S)
My device has T1-U-HL Module (BK7238) and I didn't found ready configuration on this forum neither on this website
Teardown
So I performed reverse engineering. Below is my teardown.



Pins configuration:
I created startup script autoexec.bat:
Responsibilities of my autoexec.bat:
- DeepSleep configuration for battery saving,
- configuration of faster wakeup when MQTT connection failed and water leakage is detected,
- turns on buzzer when leakage is detected (label: enableSyrena),
- turns on AP mode on reset button hold event and keeps AP mode for 60 seconds (label: apLabel),
- workaround for problem with publishing battery state when MQTT connection is established with delay (after battery measure) (label: publishBatteryState).
Home Assistant integration
I connected this sensor to my local Home Assistant instance by MQTT protocol by default OpenBeken configuration. Additionally, I created template for sensor heartbeat monitoring:
Thank to this, I can easily monitor water leakage sensor connectivity:
The red circle shows the moment of disconnection
Next steps
1. Automation to turn off the main water source pipe in case of water leakage
2. Automation to send notification in case of lack of heartbeat for specific period of time and water leakage situation
This is my first teardown article so please for understanding.
Introduction
I bough water leakage sensor DYGSM DY-SQ400B from Aliexpress for 1$. I wanted to connect it directly to my HA instance (bypass Internet connection requirement, which could be a bottleneck during critical situation). I flashed it with great OpenBeken (great thanks for authors
There is a teardown of very similar device, but with different chip (CB3S)
My device has T1-U-HL Module (BK7238) and I didn't found ready configuration on this forum neither on this website
Teardown
So I performed reverse engineering. Below is my teardown.
Pins configuration:
Code: Text
I created startup script autoexec.bat:
Code: Text
Responsibilities of my autoexec.bat:
- DeepSleep configuration for battery saving,
- configuration of faster wakeup when MQTT connection failed and water leakage is detected,
- turns on buzzer when leakage is detected (label: enableSyrena),
- turns on AP mode on reset button hold event and keeps AP mode for 60 seconds (label: apLabel),
- workaround for problem with publishing battery state when MQTT connection is established with delay (after battery measure) (label: publishBatteryState).
Home Assistant integration
I connected this sensor to my local Home Assistant instance by MQTT protocol by default OpenBeken configuration. Additionally, I created template for sensor heartbeat monitoring:
Code: Text
Thank to this, I can easily monitor water leakage sensor connectivity:
The red circle shows the moment of disconnection
Next steps
1. Automation to turn off the main water source pipe in case of water leakage
2. Automation to send notification in case of lack of heartbeat for specific period of time and water leakage situation
Cool? Ranking DIY