← all posts
// smart-home · water-leak

Detect water anomalies before asking an LLM

Flow thresholds, valve states, and occupancy provide strong signals for leaks with explainable behavior.

Small-board AI attracts two kinds of bad advice. One treats a Raspberry Pi or Orange Pi as if it were a tiny gaming PC. The other dismisses every workload that does not feel like a frontier chatbot. Both miss the useful middle: quiet, bounded jobs that run near the sensors, keep working without a cloud account, and consume little power.

For this problem, the main constraint is that urgent safety events need fast deterministic detection and clear escalation. Start from a local water meter and shutoff valve connected to the automation system. The board name matters less than the complete appliance around it: storage, supply, cooling, operating system, radio or accelerator support, and the service that consumes the result. A model that runs once from a shell is still several decisions away from a household feature.

Define one job before buying hardware

Write the event, input, output, and deadline in four lines. “Add AI to the camera” is not a job. “When a parcel remains inside the porch zone for twenty seconds, create one local notification with a thumbnail” is testable. It also reveals which parts do not need a model.

The first useful experiment is to learn normal ranges cautiously, combine hard thresholds, and require safe confirmation policies. Test with data from the actual room, microphone, camera angle, sensor, language, and network. Edge deployments amplify ordinary variation: evening light, television speech, a warm cabinet, a weak cable, or a busy Home Assistant database can change the result more than a model revision.

Keep a short field record:

board / OS / power supply / cooling
model artifact and runtime version
real input set and expected action
cold latency, warm latency, sustained rate
memory, temperature, wall power
false action, missed action, recovery path

For a four-minute household workflow, accuracy alone is not enough. Measure whether the system produces duplicate notifications, survives a reboot, reconnects after the network returns, and behaves safely when the inference service is unavailable. A feature used by other people needs visible state and a manual alternative. Nobody should have to know which container or quant is broken to turn on a light.

Keep AI out of the safety boundary

The common failure is waiting for a language model to interpret a stream while water continues flowing. Generative output can interpret a request, summarize history, or rank options. It should not be the only layer protecting a lock, heater, alarm, valve, battery, or person. Put ranges, permissions, timeouts, confirmations, and device interlocks in deterministic code. Treat camera text, calendar entries, webpages, MQTT payloads, and voice transcripts as untrusted data rather than instructions.

Privacy needs the same full-path thinking. Local inference prevents one upload, but recordings, event logs, thumbnails, backups, and remote dashboards may still leave copies. Decide what is collected, how long it remains, who can retrieve it, and what happens during debugging. The most private frame is the one the camera never captures; the next best is the one discarded immediately after a bounded decision.

Operate the appliance, not the demo

Use a service manager or a small, pinned container definition. Store configuration separately from replaceable model files. Add a health check that proves the intended function, not merely that a process owns a port. Back up the controller state, export model hashes, and keep a known-good storage image for nodes installed somewhere inconvenient.

Power and heat belong in the acceptance test. Run long enough for the enclosure to reach equilibrium and measure at the wall with normal peripherals attached. If the board throttles, swaps, corrupts storage, or monopolizes the home-automation host, the solution is not ready even if its best inference result looked good.

The durable rule is to detect and contain locally, then use AI to summarize evidence. Edge AI works best as a narrow layer above reliable sensors and below a clear household policy. When the model is unavailable, essential automation should become less clever, not stop working.

That standard keeps the project honest. The goal is not to prove that a cheap board can run a model. It is to build one small capability that remains useful after the benchmark window closes and the device disappears into a cupboard.

#water-leak#safety#smart-home