Skip to content

A home that keeps company instead of watching

When an older adult living alone runs into trouble, family often finds out days later. I built a system that detects anomalies inside the home from water and power usage rhythms alone, with no cameras, and sends the family a one-line alert.

Client
Personal project
Role
Design, implementation, measurement
Stack
Python · river · MQTT · SQLite · Supabase · React
A home that keeps company instead of watching

By the numbers

Every figure is a measured value with a source. Values from the rebuilt environment are marked as such.

Injected anomalies detected · false alarms 0/11 days (mock 28 days)
3/3 days
  • Water sensor smoke test (mock 28 days)Reproducible measurement

    Injected anomalies detected on 3/3 days, false alarms on 0/11 days

    uv run solowatch smoke --db /tmp/sw.sqlite --out /tmp/sw.json (seed 42, threshold 0.995, 2026-11-02)

  • Full-chain ingestion, all 4 sensorsReproducible measurement

    32,256 published → 32,256 rows in SQLite

    tests/e2e/test_home_chain.py (mock 4 sensors × 28 days, MQTT QoS 1)

  • Feedback reflected in learning (usual morning water use)Reproducible measurement

    25.89 → 24.27 L

    uv run pytest tests/e2e/test_home_chain.py -q (test_feedback_round_trip)

  • Largest JS chunk in the web bundleReproducible measurement

    about 1.1MB → 564KB

    Development log (private), 2026-11-03

The pulse of a home

How this project works, redrawn as one machine. Left alone it tours itself; press or drag to take over.

How it was solved

01Problem

People refuse cameras or forget to charge wearables, and check-in calls are a burden on both sides.

02Principle

Looking out for someone is not the same as watching them. Use only data that already flows, process it inside the home, and send only the alert out.

Real screens

1. Situation

When something goes wrong for an older adult who lives alone, the family often finds out days later. People refuse cameras or forget to charge wearables, and check-in calls are a burden for whoever answers and whoever calls.

So I started from one idea: looking out for someone is not the same as watching them. A Raspberry Pi in the home learns the usage rhythm of 3 smart plugs and 1 water sensor, and when something differs from the usual pattern, it sends a single-line alert to the family app. The family makes the final call.

2. Scoping

I did not build automatic emergency calls, video or audio capture, wearables, or multi-household support. The point was to keep the machine from making the judgment. Instead I added a loop where a family member taps It was fine and that judgment feeds back into learning, plus an away mode that pauses both alerts and learning. So that people without the hardware could still see the whole chain, I built a separate demo that moves the entire in-home part into a virtual home inside a container. The demo reuses the same detection logic rather than a new version.

3. Build

CategoryWhatWhy
Reusedriver (online anomaly detection), Mosquitto (MQTT), SQLite, Supabase (RLS, Edge Functions), AppriseCombine proven parts instead of writing the statistics myself
FixedMinimum deviation condition, a missing grant, the broker queue limitTouched only the places that actually broke
BuiltIn-home daemon, feedback learning loop, family app, virtual home simulatorI needed control over what data leaves the home

4. What broke

All 11 normal days were flagged as anomalies. Evening usage in the mock data was identical every day, so the standard deviation was 0 and even a perfectly ordinary value got the top score. I left the threshold and seed alone and added one condition, "a difference from the usual of less than 5 L is not an anomaly," along with a regression test. False alarms went from 11/11 to 0/11, and detection held at 3/3.

32,256 messages were sent, but only 30,225 were stored. When the subscriber fell behind, the broker was dropping messages beyond its default per-client limit of 1000. I raised the limit in the development config only, and made replay start after the subscription is confirmed. Real devices send once every 5 minutes, so they never reach this limit.

The docs and the code said different things. The docs claimed "the only thing that leaves the home is the alert text," but in reality two per-window totals and a 24-slot rhythm summary were also going out. I read the sending code to confirm, then corrected the docs to match the code. The more central the promise, the more plainly it should be stated.

5. Results

MetricValueScopeSource
Water sensor smoke testInjected anomalies 3/3 days, false alarms 0/11 daysMock 28 days, 14 days of traininguv run solowatch smoke
Full-chain ingestion32,256 → 32,256 messagesMock 4 sensors × 28 daystests/e2e/test_home_chain.py
Feedback reflectedUsual morning water use 25.89 → 24.27 L1 It was fine tap, then 1 daemon ticktest_feedback_round_trip
Web bundleLargest JS chunk about 1.1MB → 564KBComponent library removedDevelopment log (private)

The detection numbers come from simulated assumptions.

6. If I did it again

There are no real sensors and no operating records from a real household. I could not measure the false alarm rate in a real home; the next step is to install it in an actual home following the setup runbook and rebuild the same table. The "0 false alarms on ordinary days" shown in the public demo was picked from several seeds, so it is not evidence of detection performance.

One It was fine tap lowers the score, but it does not guarantee the alert is suppressed. I would look at feedback weighting and repeated learning. I also have not confirmed web push delivery on a real phone.

There is currently no hosted DB project, so no live demo is running. It can only be checked through the repository README and test commands. If I did it again, I would settle from the start on a deployment setup that survives free-tier pausing and deletion.