OBH-IoT Water Management System
Water Tanks
หัวข้อที่มีชื่อว่า “Water Tanks”| No | Location | Shape | Dimensions | FULL value (calibration) | Helper entity (adjustable) |
|---|---|---|---|---|---|
| 01 | บ่อเก็บน้ำใต้ดิน อ.หมอบริกส์ (Basement B) | ถังกลม (cylindrical) | Radius 11m | 340 cm | input_number.tank01_full_level_cm |
| 02 | บ่อเก็บน้ำใต้ดิน อ.หมอกัมพล (Basement K) | สี่เหลี่ยม (rectangular) | 10m x 10m | 197.05 cm (2026-11-10) | input_number.tank02_full_level_cm |
| 03 | บ่อเก็บน้ำดาดฟ้า อ.หมอกัมพล (Roof K) | สี่เหลี่ยม (rectangular) | 6m x 8m | 140 cm | input_number.tank03_full_level_cm |
| 04 | บ่อเก็บน้ำดาดฟ้า อ.หมอบริกส์ (Roof B) | สี่เหลี่ยม (rectangular) | 7.5m x 10m | 180 cm | input_number.tank04_full_level_cm |
Water Level Calibration (helper-based, since 2026-11-10)
หัวข้อที่มีชื่อว่า “Water Level Calibration (helper-based, since 2026-11-10)”The % of every tank = round(cm ÷ FULL × 100) where FULL is no longer
hardcoded in Node-RED — it lives in the four input_number.*_full_level_cm
helpers above (shown on the Debug dashboard → WATER tab). Each helper feeds
a Node-RED global (tankXX_full_cm) via a poll-state/change pair on the
Global 🔵 tab; the tank XX : % function reads it with a hardcoded fallback.
To recalibrate any tank (no restart, no code edit):
- Measure the real full level on site (dipstick) — never guess from charts
- Move the slider (HA UI or Debug→WATER card) to the measured cm value
- Done — the % scale changes within ~1 min; HA Logbook records who/when/from-to
- Verify next day: % reaches 100 at full and never exceeds 100
Tank 02 FULL history: 233 (Oct 2023) → 218 (2026-06-30, #1) → 200.6
(2026-07-31, #17 mitigation) → 197.05 (2026-11-10, owner decision = 7-day
observed max; dipstick validation still pending). Root cause of the sagging
ceiling remains open — see issue
2026-11-09-tank02-calibration-round2.md.
⚠️ Do not add initial: to these helpers in includes/input_number.yaml —
YAML helpers with initial: reset to it on every HA restart (incident
2026-11-10). Without it, slider values persist across restarts.
Pump Control System
หัวข้อที่มีชื่อว่า “Pump Control System”Pump 1 (คลังยา / Pharmacy)
หัวข้อที่มีชื่อว่า “Pump 1 (คลังยา / Pharmacy)”| Component | IP | Description |
|---|---|---|
| Controller | 194.1.1.121 | Pump relay control |
| Temp & Door | 194.1.1.122 | Cabinet temperature & door sensor |
| Mode Light | 194.1.1.131 | Status indicator |
Pump 2 (หมอกัมพล / K Building)
หัวข้อที่มีชื่อว่า “Pump 2 (หมอกัมพล / K Building)”| Component | IP | Description |
|---|---|---|
| Controller | 194.1.1.123 | Pump relay control |
| Temp & Door | 194.1.1.133 | Cabinet temperature & door sensor |
| Mode Light | 194.1.1.132 | Status indicator |
Control Logic
หัวข้อที่มีชื่อว่า “Control Logic”| Parameter | Pump 1 | Pump 2 |
|---|---|---|
| Pump ON threshold | Water level < 90% | Water level < 90% |
| Pump OFF threshold | Water level = 100% | Water level = 100% |
| Safety: WiFi disconnect | Power OFF (Tasmota rule) | Power OFF (Tasmota rule) |
| Safety: MQTT disconnect | Restart device (Tasmota rule) | Restart device (Tasmota rule) |
Notifications
หัวข้อที่มีชื่อว่า “Notifications”- Pump ON/OFF events
- Cabinet temperature > 30°C
- Cabinet door opened
- Overload magnetic trigger
- Timer safety valve WiFi disconnect
- Status ON/OFF logged to Grafana
Water Level Notifications
หัวข้อที่มีชื่อว่า “Water Level Notifications”Scheduled 3x daily: 8:00 AM, 12:00 PM, 4:00 PM
Entity Naming Convention
หัวข้อที่มีชื่อว่า “Entity Naming Convention”- Underground tanks:
xxxx_basement_b,xxxx_basement_k - Rooftop tanks:
xxxx_roof_b,xxxx_roof_k
Tasmota Pump Configuration (3P Pump)
หัวข้อที่มีชื่อว่า “Tasmota Pump Configuration (3P Pump)”# GPIO Pin AssignmentsD3 = switch1 = manual modeD1 = switch2 = timer modeD2 = switch3 = iot modeD5 = switch4 = overload
# Interlock (modes 1-3 mutually exclusive, overload independent)interlock 1,2,3poweronstate 3switchmode1 2
# Auto-restart on MQTT disconnectrule1 ON MQTT#Disconnected DO restart 1 ENDONRule1 1
# Power off on WiFi disconnectrule2 ON WIFI#Disconnected DO power off ENDONRule2 1Node-RED Water Tank Processing
หัวข้อที่มีชื่อว่า “Node-RED Water Tank Processing”The water tank monitoring system uses a Node-RED flow (136 nodes) to process sensor data:
Pipeline (per tank)
หัวข้อที่มีชื่อว่า “Pipeline (per tank)”- Home Assistant entity state change → Function nodes (calibration/conversion)
- Processed data published to MQTT topics
MQTT Topic Structure
หัวข้อที่มีชื่อว่า “MQTT Topic Structure”Each tank (wt-01 through wt-06) publishes 6 topics:
| Topic | Unit | Description |
|---|---|---|
water/tank/{01-06}/m |
meters | Raw distance measurement |
water/tank/{01-06}/cm |
cm | Centimeters |
water/tank/{01-06}/percent |
% | Fill percentage |
water/tank/{01-06}/capacity/L |
liters | Volume in liters |
water/tank/{01-06}/capacity/cubicM |
m³ | Volume in cubic meters |
water/tank/{01-06}/mm-lowpass |
mm | Low-pass filtered millimeters |
Node Composition
หัวข้อที่มีชื่อว่า “Node Composition”- 55 function nodes (calibration/conversion logic)
- 36 MQTT output nodes
- 10 HA state-change listeners
- 16 change nodes (global variable storage)
- 4 poll-state nodes, 4 debug nodes, 4 inject nodes
Known Issues
หัวข้อที่มีชื่อว่า “Known Issues”Nov 2026: Calibration round 2 (tank 02) — resolved by helper mechanism
หัวข้อที่มีชื่อว่า “Nov 2026: Calibration round 2 (tank 02) — resolved by helper mechanism”Daily max stuck at 98 % for 45+ days; ceiling sagged 201→197 cm as a smooth
drift since ~Sep 10 (noise signature unchanged — not sensor chaos; no discrete
steps; plateaued late Oct). Fixed 2026-11-10 by the helper mechanism above
(197.05, owner decision, chart-derived — dipstick still pending to validate).
Details: issues/2026-11-09-tank02-calibration-round2.md.
Nov 2026: Tank 01 unavailable for a few minutes after every Node-RED restart
หัวข้อที่มีชื่อว่า “Nov 2026: Tank 01 unavailable for a few minutes after every Node-RED restart”Tank 01’s MQTT sensors are availability-gated on water/tank/01/LWT, relayed
from tele/OBH-WATER-TANK-01_7422F8/LWT — the retired device topic (chip
swapped to tank 6, Dec 2024). After each Node-RED restart the tank shows
unavailable until the refresher + a value change bring it back (~1–9 min).
Fix someday: repoint the relay to the live device topic or drop the gate.
Same LWT-relay pattern exists for tanks 02–04 — their device topics should be
verified current.
Nov 2026: Daily Telegram water report silent (dead ≥ months)
หัวข้อที่มีชื่อว่า “Nov 2026: Daily Telegram water report silent (dead ≥ months)”Two stacked causes: ① the summary chain dies at a missing subflow
definition in Notify : Water (instance exists, definition gone since ≤
2026-07-31 — messages vanish silently, all 3 daily times), ② HA 2026.5 notify
schema rejects title in payloads (proven via On Test! 08:00 daily error and
pump-start photo alerts). Revival needs all three parts together: rewire past
the dead subflow + gate, guard the 1-second poll-state (telegram_notify),
remove title. Also broken by ②: the other 7 legacy platform: telegram
channels + telegram_bot.send_photo paths. Tracked in the round-2 issue doc §2b.
Nov 2026: Restart-transient dips are EXPECTED (no action)
หัวข้อที่มีชื่อว่า “Nov 2026: Restart-transient dips are EXPECTED (no action)”Around every Node-RED restart/deploy (±10 min), raw streams pick up brief
zero frames and the filtered % dips (observed as low as 32 % for ~2 min)
then slews back within ~5 min. Verified 3/3 restarts. Not a water event.
Triage: dip inside a deploy window = ignore · dip outside with normal raw =
recheck in 10 min · raw low/zero outside a deploy window = report
(details: issues/2026-11-09-tank02-calibration-round2.md §15).
Nov 2026: 2026-11-04 roof-tank sensor disturbance (watch)
หัวข้อที่มีชื่อว่า “Nov 2026: 2026-11-04 roof-tank sensor disturbance (watch)”2026-11-04 ~11:00–14:00 +07: tank 03 raw read 0 continuously (~3 h) and tank 04 raw showed erratic dips in the same window (both roof tanks; basement tanks clean). Pre-dates all Nov-10+ work. Not a drain (filtered 45.78 cm minimum inherited from the outage). Cause unknown — if it recurs outside a deploy window, inspect the roof sensors/bridges on site.
Dec 2024: Water Tank 03 Issue
หัวข้อที่มีชื่อว่า “Dec 2024: Water Tank 03 Issue”Tank K water levels showed anomalies. Grafana data: Basement K at 76-100% (mean 91.5%, 177-232cm), Rooftop K at 32-100% (mean 90.8%, 21.6-67.2 m³).
Dec 2024: Tank 1 ESP Replacement
หัวข้อที่มีชื่อว่า “Dec 2024: Tank 1 ESP Replacement”Replaced Tank 1 ESP chip with Tank 6’s chip, firmware updated. Tank 6 pending new ESP32 and sensor replacement.
Future Plans
หัวข้อที่มีชื่อว่า “Future Plans”- Digital flow meter (1.5 inch) for each pump
- 3-phase current measurement for pump peak monitoring
- Tap water emergency auto-fill system (already partially implemented)