Hey everyone,
I’ve got a pretty heavy Aqara setup running through Home Assistant and wanted to share what happened when I paired Claude AI (via the HA MCP server) with a full config audit session. In one evening, we knocked out 23 real fixes — all live-tested and git-committed as we went. I was skeptical at first but after a few hours I was super impressed with the capabilities and gained trust in what Claude Code was doing. I’m posting here because almost all of my sensors are Aqara devices. (Claude Code actually generated the list of Aqara devices in the below blurb).
My Aqara Hardware Stack
For context, here’s what’s running in the house:
- Hubs: Aqara Hub M2 (hallway) + Hub M3 (server room) — both via Matter
- Doorbells: 3x Aqara Video Doorbell G4 (CH-C11E) — Game Room, Patio, Scuba Shop — via HomeKit
- Cameras: Aqara Camera Hub G5 Pro (CH-H03) + Camera Hub G3 (CH-C07E) via HomeKit
- Presence: 6x Aqara FP2 (PS-S02E) via HomeKit + 4x Aqara Presence MultiSensor FP300 via Matter
- Locks: 4x Smart Lock U100, 2x Smart Lock U300, 1x Smart Lock U400 — all via Matter
- Sensors: ~15 Door/Window sensors + 3 Water Leak sensors via Matter
- Lighting: Multiple LED Bulb T2 and LED Strip T1 devices via Matter
- Plugs: 6 Aqara Smart Plug US devices via Matter
That’s 299 Matter entities and 91 HomeKit entities in HA — complex enough that the config had quietly accumulated a lot of tech debt.
What Claude Fixed
The workflow: Claude connected to my HA instance over SSH, read the YAML, proposed before/after diffs, I approved, it wrote and reloaded. Every change was git-committed with a meaningful message. No manual editing.
Highlights of what we tackled:
Doorbell linger detection — Migrated all 3 G4 doorbell automations from basic *_person_detected_occupancy to the Matter *_linger_occupancy entities. Much better signal-to-noise. Also added iOS fallback notifications during quiet hours — previously those events were silently dropped when Alexa was suppressed.
Lock & security automation cleanup — The security arming/disarming scripts had a 4-variable “quiet hours” computation block copy-pasted across 4 different files. Collapsed all of them to a single is_state(‘binary_sensor.house_quiet_hours_active’, ‘on’) reference.
Water leak alert fix — Removed a dead active_sensor_names variable from the repeat-alert automation and added a logbook entry when quantity would go negative and gets clamped to 0.
Alexa TTS overhaul — Replaced a staggered for_each loop (1-second delays between 7 Alexas) with a single notify.alexa_media call to all targets simultaneously. Faster and cleaner.
Dead code removal — Deleted an empty automation file, stripped dead label branches from motion automations, and removed an orphaned input_datetimes file that nothing referenced.
Secret hygiene — Moved hardcoded Nabu Casa audio URLs (NWS alert tone, siren MP3) out of automation YAML into secrets.yaml.
iOS notification threading — Fixed security notifications from static tags (replace behavior) to dynamic tags that stack into threads on iPhone.
Bottom Line
If you’re running a dense Aqara + HA setup and your config has been growing organically for a couple years, this kind of AI-assisted audit is worth doing. Claude understood the YAML, the Jinja templates, the Matter entity naming patterns — all of it. It didn’t just suggest changes, it made them, reloaded, and confirmed they worked.
Happy to answer questions about any of the specifics.