Run Dapple as a Home Assistant add-on (0.6.0) - #22
Merged
Merged
Conversation
Home Assistant's ingress serves an add-on at /api/hassio_ingress/<token>/, where absolute /api and /favicon paths miss. Standalone is unchanged: the page always loads from / (routing is hash-based), so api/ping is /api/ping. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Under the Supervisor, ask /services/mqtt for the Mosquitto add-on's address and login and save them on the Home Assistant tab, switched off. Only when no broker is set up yet, so a user's own settings are never overwritten. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
repository.yaml makes this repo an add-on repository; home-assistant/dapple runs the published afraley/dapple image under the Supervisor, in the sidebar via ingress, with Mosquitto's login offered through mqtt:want. The Supervisor treats every config.* file in the repo as an add-on and warns about the ones that don't validate, so the example config moves to docs/example-config.yaml. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Supervisor reads the add-on from the repo, so a version bump on main would reach Home Assistant minutes before its image is on Docker Hub. The release job now moves `stable` to the released commit once the image is pushed, and CI checks the add-on's version matches pyproject.toml. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
README gets an "On Home Assistant OS" install with the one-click repository link; HOME_ASSISTANT.md covers the pre-filled broker and reaching the app by hostname from rest_command; DEVELOPING.md covers the add-on, ingress and the stable branch. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reinstalling Mosquitto issues Dapple a new password, which the user never sees and so can't type in. On every start, while the saved broker's host, port and username are still the ones the Supervisor offers, take its current password. Anything else about the broker stays the user's, and a broker they set up themselves is still never touched. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The workflow's own token may not push a commit that changes .github/workflows/, and moving stable to the 0.6.0 merge does, so the step would have failed with the image published but no tag or release. The release job now creates the release first (skipping it if it exists, so a re-run can finish) and then pushes stable with STABLE_DEPLOY_KEY from the main-only `release` environment. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Dapple can now be installed from Home Assistant's App store on Home Assistant OS, and opens in the sidebar. Released as 0.6.0.
What's in it
repository.yamlplushome-assistant/dapple/: aconfig.yamlthat runs the publishedafraley/dapple:<version>image (no separate build), withDOCS.md, a store blurb and an icon. Validated against the Supervisor's ownSCHEMA_APP_CONFIG.api/...,favicon.svg, Vitebase: './'), so it works under/api/hassio_ingress/<token>/. Nothing changes standalone: routing is by#hash, so the page always loads from/.services: [mqtt:want],sync_mqttinapp/supervisor.pyasks the Supervisor for Mosquitto's address and login on every start:SUPERVISOR_TOKEN).8080/tcp: null), so it can't clash with another add-on on 8080. It can be turned on in the add-on's Network tab. From Home Assistant,rest_commandreaches it by hostname.stablebranch. The Supervisor reads the add-on from git, so readingmainwould offer 0.6.0 minutes before its image exists. Users add…/dapple#stable, and the release job moves it:STABLE_DEPLOY_KEYdeploy key from areleaseenvironment that only main can use. The workflow's own token may not push a commit that changes.github/workflows/, and this one does.stablefails, a re-run finishes the job.git push, andstableis excluded from branch builds.pyproject.toml.data.example/config.yamltodocs/example-config.yaml. The Supervisor treats everyconfig.yamlin the repo as an add-on and would have warned about it on every store reload.Already set up with
ghstablebranch exists at v0.5.1 (164164f). Creating it started a build onstableunder the old workflow, which I cancelled before it pushed an image.STABLE_DEPLOY_KEYsecret in the newreleaseenvironment, which is limited tomain. A dry-run push tostablewith it authenticated, and the move was a fast-forward.testandimagemust have passed.stable. GitHub refused a GitHub Actions exemption, since that's only allowed on organization repos, but a deploy-key exemption works on personal repos. It lives in its own ruleset so the key doesn't also get past the rules above.Tested
tests/test_supervisor.py. Frontend tests and the format checks pass./api/hassio_ingress/test/, in headless Chromium: the page, assets and every API call load under the prefix. At/, all the same files load too./data,SUPERVISOR_TOKEN, a fakesupervisorhost answering/services/mqtt): the broker was filled in withenabled: falseand the password not returned by GET./datafiles end up owned by 1000, and a restart doesn't fill it in again.Still to check on a real Home Assistant OS box
version: home-assistant-addon(steps in DEVELOPING.md): open it from the sidebar, check the pre-filled Mosquitto login connects, and check the add-on can reach the strands.<hash>-dapple:8080) forrest_command.gh api repos/andrewfraley/dapple/branches/stable --jq .commit.shaequals the merge commit. That merge is the first real run of the deploy-key push against the rulesets; the dry run can't check rules.🤖 Generated with Claude Code