I asked what felt like an easy question: how many devices are in this house? Home Assistant said 130. NetAlertX, which scans the network, said 104. Both were right, and that was the problem.
The Pi rack had grown one useful tool at a time, and each tool kept its own list of what I own. The lists didn't share IDs, didn't agree on names, and had different ideas about what “down” means. It was the Holy Roman Empire with Wi-Fi: seven little kingdoms, each sure it was the one in charge.
So I borrowed the rule from Highlander. There can be only one. The registry is a single file that lists every device, service, and job in the lab, and it says which system owns each fact about them. Everything else is a copy, and a script checks the copies every night.
Last updated Dec 1, 2026
Before I wrote any code, I mapped what each system knew and who was allowed to change it. Every row below is one fact that lived in more than one place.
| Fact | Where it lived | How the copies stayed in step |
|---|---|---|
| Device name | Home Assistant, NetAlertX, Uptime Kuma, and the AT&T gateway | They didn't. Of the 64 devices in both Home Assistant and NetAlertX, about half had two different names. |
| Room | Home Assistant areas and NetAlertX locations | I copied them by hand, once. A room change in one never reached the other. |
| Server addresses | The gateway, the docs, the monitors, and 48 code and config files | By hand. Moving one Pi meant finding every copy. |
| Which devices matter | NetAlertX alert flags, Kuma's monitor list, and the daily page's rules | Each list was built on its own. |
| Is it down? | Five definitions, from one missed ping to “gone 30 minutes, then 5 more” | Each system decided for itself. A porch camera fell into the gap between two of them. |
| Who gets told | Email, Pushover, an iPhone push, and the desk monitor | One outage could reach me twice, at two different times. |
That's how many network devices shared an ID with Home Assistant. Another 34 were the same physical thing in both systems, matched only by my own guess at the name or model.
Renaming a lamp meant renaming it in up to four places, and I never once remembered all four. The systems drifted a little further apart with every change.
Every system worked. They just couldn't be trusted together, which is a harder thing to notice than something being broken.
A single source of truth can still be spread across several systems, as long as each fact has exactly one home and I know which one. Copies flow one way, from the owner out. If I edit a copy, the edit gets overwritten that night and shows up in a report.
| Fact | Owner | Why there |
|---|---|---|
| Online or offline, last seen, current address | NetAlertX | It measures them. A measured fact belongs to whatever measures it. |
| Sensor readings and device state | Home Assistant | Same reason. |
| Name and room, for devices in Home Assistant | Home Assistant | That's where I rename things anyway. The registry keeps a copy and the check refreshes it. |
| Name and room, for everything else | The registry | Nothing else knows about them. |
| Type, group, owner, role, how critical it is, and its alert rule | The registry | These are decisions, and decisions belong in a file with a history. |
| Reserved server addresses and what runs where | The registry | Code reads them from here. No address is typed into a script. |
| Automations | Home Assistant | I edit them in its UI. The repo keeps a copy of each, and the check flags a missing one. |
There's one list of rooms. If a row names a room Home Assistant doesn't have, the check flags it. Phones, watches, laptops, and tablets get a pass, since they wander.
Current address, online status, battery level, vendor, and model stay out of the registry. Another system already measures them, and a second copy would only be a second thing to go stale.
Room, then thing: Porch Switch. Or person, then thing, for personal devices. The Pis keep their stadium names.
Two scripts run back to back on libertybowl, the daily digest Pi. The sync pushes the owners' facts out. The check then reads everything back and writes down what still disagrees.
The sync changes NetAlertX and nothing else. It reuses a token the daily page already had, so the job needed no new access.
The sync writes nothing if the registry fails its own schema, if Home Assistant or NetAlertX can't be read, or if more than 25 values would change at once. A change that big usually means something upstream broke.
The sync and the check both call the same function to decide what NetAlertX should say. They can't disagree with each other, which felt like the least I could ask of a tool built to end disagreements.
Findings show up as one line on the daily page: “Registry check: 3 issues to review.” No push alert, and the spoken brief skips it. Drift is a chore, and chores can wait for daylight.
A device is something I can touch. A service is software that keeps running. A job runs on a schedule and stops. Services and jobs point at the device they run on, and a device points out to the systems that know it by another name.
Each row gets an ID I choose, like downstairs-kitchen-speaker. The row then carries the other systems' IDs for the same thing. That one row is the link the systems never had.
My thermostats each show up twice in Home Assistant, once per integration. Each is still one row, with two Home Assistant IDs on it. The first one listed supplies the name and room.
A field left out takes its default, so most rows are six or seven lines. A lamp nobody watches doesn't need to say so.
| Field | Required | Owner | What it means |
|---|---|---|---|
| id | Yes | Registry | Lowercase words joined by hyphens, taken from the name when the row is created. Permanent. Pis use their hostname. |
| kind | Yes | Registry | device, service, or job |
| name | Yes | Home Assistant if the device is in it, otherwise the registry | The display name |
| room | Devices, unless portable | Same as name | Must match a Home Assistant area |
| role | No | Registry | One line on what it's for: “Kitchen leak sensor” |
| critical | No | Registry | high if losing it risks safety or data, normal (the default), or low |
| down_class | No | Registry | Which definition of “down” applies. Default is not_watched. |
| watcher | No | Registry | The one system that raises the alarm: kuma, netalertx, home_assistant, or none |
| notes | No | Registry | Anything a person should know, like “Battery doorbell, sleeps its Wi-Fi” |
| Field | When it's set | What it means |
|---|---|---|
| mac | It's on the network | The link to NetAlertX. Left out for things with no address of their own, like Hue bulbs behind their bridge. |
| ha_devices | It's in Home Assistant | A list of Home Assistant device IDs. The link to Home Assistant. |
| type | Optional | What it is: Smart Plug, Thermostat, Raspberry Pi. Copied to NetAlertX. |
| group | It has a mac | One of ten groups, such as Lights and switches or Cameras and doorbells. Copied to NetAlertX. |
| owner | Optional | A person's name. Defaults to House. Copied to NetAlertX. |
| reserved_ip | Servers and the gateway | The fixed address. A script writes each one to a small file on every Pi, and code reads it from there. |
| logins | Pis only | Who can log in, and which SSH keys each login trusts. The check compares this with the Pi itself. |
| subnet | The gateway only | The home network's range. Exactly one row has it. |
| kuma_monitor | Kuma watches it | The monitor's exact name. Monitors are named exactly like the row they watch. |
| Field | Kind | What it means |
|---|---|---|
| runs_on | Both, required | The id of the device it runs on |
| code | Both | The repo folder that holds its one current copy |
| kuma_monitor | Both, if Kuma watches it | The monitor's exact name |
| url | Service | The address to open or check, if it has a web page |
| part_of | Job | The id of the service it belongs to, if any |
| schedule | Job, required | When it runs, in plain words: daily 03:30 |
| checkin_grace | Job, if Kuma watches it | How long after the schedule before a missing check-in counts as missed |
- id: downstairs-kitchen-speaker kind: device name: Downstairs Kitchen Speaker # from HA room: Downstairs Kitchen # from HA type: Smart Speaker group: Voice and displays mac: "aa:bb:cc:dd:ee:ff" ha_devices: [<HA device ID>]
- id: grafana kind: service name: Grafana runs_on: theforum url: http://<theforum>:3000 down_class: service watcher: kuma kuma_monitor: Grafana
- id: theforum-backup kind: job name: theforum backup runs_on: theforum schedule: daily 03:30 checkin_grace: 2h critical: high down_class: service watcher: kuma kuma_monitor: theforum backup
A server that misses a ping and a battery doorbell that naps between visitors shouldn't be judged the same way. Each row picks one class, and every screen and alert uses that same rule.
| Class | Down means | Rows |
|---|---|---|
| Always on | Missed by a network scan, and still gone 5 minutes later | 17 |
| Sleepy | Not seen for 30 minutes, and still gone 5 minutes after that | 7 |
| Service | Kuma's check fails, or a job misses its check-in window | 15 |
| Not watched | Never down. No alerts. | 148 |
Each watched row names exactly one: Kuma has 16, NetAlertX has 22, and Home Assistant has 1. One outage, one alert. The check flags a row that has a class with no watcher, or a watcher with no class.
Home Assistant's single row is heinzfield, the Pi that runs Kuma. Kuma can't very well report that its own Pi is off.
148 of 187 rows raise no alarm, on purpose. If a lamp drops off Wi-Fi, I'll find out the old way, by flipping the switch and saying a word.
The check never fixes anything. It reads, compares, and reports, and I decide what to do about it over coffee.
A required field missing, a field it doesn't know, a value off the allowed list, a duplicate ID, or a runs_on that points nowhere.
A device NetAlertX found that has no row yet. Or the reverse: a row whose address the network has never seen.
A copied name or room that no longer matches, a Home Assistant ID that's gone, or a Home Assistant device with no row.
Any NetAlertX value the sync had to overwrite that night. That's me, having changed a copy and forgotten the rule.
A Kuma monitor the registry doesn't list, or a row that names a monitor Kuma doesn't have.
An SSH key on a Pi that isn't in that Pi's row, or a listed key that's missing.
A Home Assistant automation the repo has no copy of, or a copy whose automation was deleted.
If the sync skipped the night or refused to write, the report says so and says why.
I rename a device in Home Assistant, and by morning the network scanner and the registry copy agree with it. Nobody copies anything by hand.
A Pi's address lives on its row. Deploys, installers, and scripts read it from there, so moving a server is one line in one pull request.
The registry is a file in git, so every change has a date and a reason. “When did we stop watching that?” has an answer now.
How many devices are in this house? 156, and I can show my work.