FAQ
TL;DR: TY‑SJ‑01 (BK7231N) supports 86,400‑second deep sleep; “Successful MQTT connection required.” Use the OpenBeken autoexec to publish Channel 5 and sleep after 60 seconds. No buzzer; pair with HA/MQTT alerts. [Elektroda, divadiow, post #21097283]
Why it matters: This setup delivers battery‑friendly, local leak alerts without Tuya cloud lock‑in, ideal for DIY home automation.
Quick Facts
- Hardware: BK7231N on CBU board, model TY‑SJ‑01, 2×AAA power, no audio alarm. [Elektroda, divadiow, post #21097283]
- Sleep/wake: publishes Channel 5 (Water), waits for MQTT, then deep‑sleeps 86,400 s after a 60 s window; wakes on button or sensor. [Elektroda, divadiow, post #21097283]
- Battery config used: 2.0–3.0 V scale, factor 2.16, low 2.4 V, 12‑bit ADC 4096, sampled every 2 s. [Elektroda, divadiow, post #21097283]
- Edge fix: set DSEdge 0 to wake on dry→wet and wet→dry; one duplicate wake on wet was noted. [Elektroda, 0xlnz, post #21156555]
- Flashing help: follow the two CBU threads the author linked for this exact board. [Elektroda, divadiow, post #21144059]
What is the TY‑SJ‑01 leak detector, and what hardware does it use?
It’s a Tuya‑based water leak sensor using a BK7231N on a CBU module. The OpenBeken template targets this board and names it “Generic Flood Water Leak Detector – 2x AAA.” The original post includes photos, AliExpress listing, and boot logs confirming the platform. This unit is designed for low‑power battery operation and MQTT reporting under OpenBeken. [Elektroda, divadiow, post #21097283]
Does TY‑SJ‑01 have a built‑in audio alarm?
No. The thread explicitly addresses this unit as having no audio alarm. Boot logs also indicate alarm_type:0, and the recommended approach is to raise alerts via MQTT or Home Assistant automations. Plan notifications accordingly, such as push, email, or siren triggered by your hub. [Elektroda, divadiow, post #21097283]
How do I flash OpenBeken on the CBU/BK7231N in this sensor?
Use the CBU‑specific guides linked by the original author. They cover the exact board family used here and walk through the flashing process. Start by reviewing those threads, then apply the provided OBK template and autoexec after flashing. This approach matches what users followed for this device. [Elektroda, divadiow, post #21144059]
Why doesn’t my sensor wake again after a wet event?
A user observed this pattern: it wakes on 0→1, sends status, sleeps after 60 seconds, then does not wake on 1→0, and later misses the next 0→1. The device may only wake again after manual reset or a scheduled wake (e.g., 24 hours). This edge case stems from edge detection while sleeping. [Elektroda, 0xlnz, post #21153445]
How do I make it wake on both wet and dry changes?
Set DSEdge 0 in your OpenBeken configuration. A user validated that this makes the sensor wake on both wet→dry and dry→wet transitions. Add the command near the end of your autoexec so it persists across boots. This resolves missed wake issues reported earlier. [Elektroda, 0xlnz, post #21156555]
I’m getting two wakeups when it gets wet—what’s happening?
With DSEdge 0 applied, one user reported “wake up two times in a row” when transitioning to wet. Treat this as a duplicate event and filter it in your automation or MQTT processing. It did not occur on wet→dry in their tests, only on dry→wet. [Elektroda, 0xlnz, post #21156555]
What autoexec should I use to publish water state and manage sleep?
Use the author’s autoexec: enable powersave, configure Battery_Setup and Battery_cycle, label Channel 5 as Water, wait for MQTT, publish the water state, then delay 60 s and deep‑sleep 86,400 s. You can bind a long‑press to SafeMode. Add DSEdge 0 if you need both‑edge wake. [Elektroda, divadiow, post #21097283]
Do I need MQTT connected for the device to report?
Yes. “Successful MQTT connection required.” The device wakes from deep sleep on button press or sensor change but expects an MQTT session before publishing status. Ensure your broker is reachable and credentials are correct so the publish occurs before sleep. [Elektroda, divadiow, post #21097283]
How long does the sensor stay awake before going back to sleep?
By default autoexec, it waits one second after MQTT connects, publishes Channel 5, then delays 60 seconds before PinDeepSleep 86,400 seconds. You can tune these values to balance responsiveness and battery life. Keep a short window to finish publishing. [Elektroda, divadiow, post #21097283]
Which channel carries the water status, and how do I label it in HA?
Water status is on Channel 5. The autoexec labels it “Water,” publishes it once after boot, then sleeps. In Home Assistant, create an MQTT binary_sensor and map on/off to dry/wet if you prefer readable states. This keeps dashboards clear. [Elektroda, divadiow, post #21097283]
What battery thresholds should I use with this setup?
The shared configuration scales 2.0–3.0 V with factor 2.16, sets a 2.4 V low threshold, and uses a 12‑bit 4096 ADC. Battery_cycle 2 samples every two seconds during wake windows. Adjust thresholds to your cell chemistry if needed. [Elektroda, divadiow, post #21097283]
What battery reading should I expect in real use?
Example logs show about 2.733 V corresponding to roughly 73.4% state of charge in this calibration. That offers a practical mid‑pack reference for alerting and replacement planning. Use your own discharge curve if precision is required. [Elektroda, 0xlnz, post #21156675]
Which pins does the OBK template map for this board?
Pin 16 is the water input (Channel 5), pin 17 controls BAT_Relay, pin 20 is the button, pin 23 is BAT_ADC, and pin 26 is WifiLED_n. The JSON template and image link are included in the original post. [Elektroda, divadiow, post #21097283]
Any webapp or template updates I should know about?
Yes, the author linked a specific webapp commit for this device family. Review that change when setting up your build or web UI, as it may affect presentation or defaults. Keep firmware and webapp in sync. [Elektroda, divadiow, post #21097290]
Can the device remain awake when water is detected?
Not with the shared configuration. The author notes it “won’t currently stay awake if water is detected.” Use MQTT or Home Assistant to escalate alerts immediately during the 60‑second wake window. Consider tuning sleep if needed. [Elektroda, divadiow, post #21097283]
Was flashing this unit confirmed by other users?
Yes. A user reported success and said it was “was easy enough.” This validates the linked guidance and the OBK template for the CBU board. Proceed methodically and verify pads and power before flashing. [Elektroda, 0xlnz, post #21144478]