logo elektroda
logo elektroda
X
logo elektroda

Teardown and OpenBeken Configuration for DYGSM DY-SQ400B Water Leak Sensor with T1-U-HL Module

chmieleckimikolaj 78 0
ADVERTISEMENT
📢 Listen (AI):
  • 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 :D)

    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.

    Teardown and OpenBeken Configuration for DYGSM DY-SQ400B Water Leak Sensor with T1-U-HL ModuleTeardown and OpenBeken Configuration for DYGSM DY-SQ400B Water Leak Sensor with T1-U-HL ModuleTeardown and OpenBeken Configuration for DYGSM DY-SQ400B Water Leak Sensor with T1-U-HL ModuleTeardown and OpenBeken Configuration for DYGSM DY-SQ400B Water Leak Sensor with T1-U-HL Module

    Pins configuration:
    Code: Text
    Log in, to see the code

    I created startup script autoexec.bat:
    Code: Text
    Log in, to see the code

    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
    Log in, to see the code


    Thank to this, I can easily monitor water leakage sensor connectivity:
    Teardown and OpenBeken Configuration for DYGSM DY-SQ400B Water Leak Sensor with T1-U-HL Module
    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
    About Author
    chmieleckimikolaj
    Level 3  
    Offline 
    chmieleckimikolaj wrote 4 posts with rating 1. Been with us since 2025 year.
  • ADVERTISEMENT
📢 Listen (AI):
ADVERTISEMENT