Repository navigation
Home Assistant over MQTT: each array as a device with sensors and buttons - #33
Merged
Merged
Conversation
firsttris
force-pushed
the
claude/home-assistant
branch
from
October 9, 2026 11:19
287af4d to
e21699b
Compare
…tons MQTT discovery makes every array a device in Home Assistant: health, problem and job-running binary sensors, bad blocks, last sync and scrub, scrubbed share, temperature and fill level per disk, and buttons for sync and scrub. A sync from Home Assistant goes through the sync guard of new schedules. State comes from the same cached snapshot as the Prometheus metrics (now shared in array-snapshot.ts), so publishing never wakes a disk; it is sent on change, with a last will for availability, and discovery again when Home Assistant restarts. Set up under Automation, with a connection test. With unit and end-to-end tests (MQTT broker in the test) and documentation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JuXnquCPdbG5sBbDyin7yF
firsttris
force-pushed
the
claude/home-assistant
branch
from
October 9, 2026 11:22
e21699b to
772bd15
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Each array becomes a device in Home Assistant through MQTT discovery. Home Assistant's own MQTT integration picks the entities up, so there is no custom integration to install.
Entities per array (device SnapRAID <name>)
ok,errors,disk_missing,sync_incomplete,unknown)How
array-snapshot.ts, which both now use.snapraid-ui/statusreports online/offline through the MQTT last will, so the entities turn unavailable when SnapRAID UI is down.homeassistant/status). Entities of removed arrays are cleared.home-assistant.ts: pure functions (slugs, state, discovery, command parsing).home-assistant-service.ts: MQTT connection and settings, usingnpm:mqtt.routes/home-assistant.ts: GET/PUT settings with the password masked; settings are stored inhome-assistant.jsonwith mode 600. PlusPOST /test.home-assistant.jsonis now part of the backup. The docs table also lists the automation files.Tests
home-assistant.spec.tsstarts an MQTT broker (aedes) in the test, sets Home Assistant up in the UI, checks that discovery and state arrive, and presses the Scrub and Sync buttons over MQTT.automation.md(entities, guard, example automation), API rows inarchitecture.md,development.md,disks.md(backup), README.mkdocs build --strictpasses.This PR, #31 and #32 each add translation keys and a row to the E2E table in
development.md. Whichever merges later needs a rebase; I'll do it.🤖 Generated with Claude Code
https://claude.ai/code/session_01JuXnquCPdbG5sBbDyin7yF
Generated by Claude Code