logo elektroda
logo elektroda
X
logo elektroda

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

chmieleckimikolaj 684 2
ADVERTISEMENT
📢 Listen (AI):
  • Hello
    This is my first teardown article so please for understanding.

    Introduction
    I bought 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 ModuleT1-U-HL (BK7238) module on purple PCB with visible RESET button and capacitorsSQ400B-T sensor PCB with soldered wires and visible test points and component labels

    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:
    updateEpochTime chart with a communication drop marked by a red circle
    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 4  
    Offline 
    chmieleckimikolaj wrote 9 posts with rating 4. Been with us since 2025 year.
  • ADVERTISEMENT
  • #2 21797278
    gulson
    System Administrator
    Thank you! Where are you using this water leak sensor? Does he have battery power? I wonder how long the battery will last.
  • #3 21797412
    chmieleckimikolaj
    Level 4  
    I will use this sensor in my basement. Yes, it has battery slot. Battery model: CR123A
    Until now, I am at configuration phase, so it has stable power source.
    Power consumption:
    30 µA during deep sleep
    55 mA during wake up - while reporting data

    I will perform test on battery power source soon. I will tell you
📢 Listen (AI):
ADVERTISEMENT