Repository navigation
Dashboard as an ingress panel (development add-on) - #35
Conversation
Upstream batcontrol now serves a read-only dashboard, HTTP API and MCP server from the control-loop process. This exposes it as the Batcontrol entry in the Home Assistant sidebar. The manifest gains ingress on port 8080 with a panel entry, and an unmapped ports entry for the users who want to reach the API from outside Home Assistant. Ingress is authenticated by Home Assistant; a mapped port is not, which is why it stays unmapped by default and DOCS.md tells users to set auth_token before changing that. Two deliberate differences from the upstream defaults: api.enabled is true, because the sidebar panel needs it, and api.host is 0.0.0.0, because ingress connects from the supervisor - outside the container - so upstream's 127.0.0.1 default would make the panel unreachable. The development Dockerfile builds the dashboard in a dedicated node:24-alpine stage instead of installing nodejs into the Python stage: the Node version is pinned rather than inherited from the base image's package repository, and --platform=$BUILDPLATFORM keeps npm off QEMU for the aarch64 build. A separate source stage fetches the upstream zip once for both. The builder stage then runs the upstream wheel verification, so a wheel without a dashboard fails the build instead of surfacing as a hint page in someone's sidebar. New options: dashboard_enabled, docs_enabled (Swagger UI and OpenAPI schema, default off), mcp_enabled and the two tokens, mirrored from batcontrol's api: block. The stable add-on is untouched and needs no Node: it installs the released wheel, which carries the assets as package data. The port-batcontrol-change skill only knew how to port config parameters. It now also covers add-on surface changes - ingress, ports, map - with the two rules that are easy to get wrong: an ingress service has to bind 0.0.0.0, and a mapped port is not authenticated. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The development Dockerfile now pins alpine:3.23 for the source stage and node:24-alpine for the dashboard build. Only github-actions was tracked, so both would have rotted silently. The stable add-on has nothing to track: its Dockerfile only uses $BUILD_FROM, which comes from build.yaml and follows the Home Assistant base image cycle. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The multi-stage Dockerfile and ingress wiring depend on an unmerged upstream PR and require end-to-end Home Assistant validation that cannot be confirmed automatically.
1 open finding
What changed in this PR
This PR exposes the new upstream batcontrol read-only dashboard (MaStr/batcontrol#457) as a Batcontrol sidebar entry in the development add-on only, served through Home Assistant ingress. It wires up the manifest (ingress + optional unmapped port), adds the api: option/schema block mirrored from upstream, and reworks the development Dockerfile into dedicated source/frontend/wheel/final stages so the dashboard is built with a pinned Node toolchain and the wheel is verified to contain the dashboard. The stable add-on is intentionally left untouched.
Changes:
- Manifest:
ingress/ingress_port/panel_icon/panel_title, an unmapped8080/tcpport with description, newapi:options and matching schema, dev version bump0.10.0dev6 → dev7. - Dockerfile: new
source(alpine) andfrontend(node:24-alpine) stages pinned to$BUILDPLATFORM, dashboard overlaid into the wheel,verify_wheel_dashboard.pygate, andEXPOSE 8080. - Docs/ops: DOCS.md
apisection, CHANGELOG entry, translations group, CLAUDE.md + SKILL.md guidance, and a Dependabot entry tracking the dev add-on base images.
| File | Description |
|---|---|
| batcontrol-development/config.yaml | Adds ingress/panel/ports manifest keys and the api: options + schema; bumps dev version |
| batcontrol-development/Dockerfile | Splits build into source/frontend/wheel/final stages, builds dashboard with pinned Node, verifies wheel, exposes 8080 |
| batcontrol-development/DOCS.md | New api section documenting dashboard/API/MCP options (docs-site URL inconsistency flagged) |
| batcontrol-development/CHANGELOG.md | Development changelog entry for the dashboard + read-only API |
| batcontrol-development/translations/en.yaml | Adds the api top-level option group label/description |
| .github/dependabot.yaml | Tracks Docker base images for the development add-on |
| CLAUDE.md | Documents the dashboard/read-only API and the two deliberate upstream-default differences |
| .claude/skills/port-batcontrol-change/SKILL.md | Adds Step 4b for add-on manifest (surface) changes |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| Full documentation: [REST API](https://mastr.github.io/batcontrol/integrations/rest-api/), | ||
| [MCP server](https://mastr.github.io/batcontrol/integrations/mcp-server/) and | ||
| [Dashboard](https://mastr.github.io/batcontrol/features/dashboard/). |

Summary
Exposes the new batcontrol dashboard (MaStr/batcontrol#457) as the Batcontrol entry in the Home Assistant sidebar - development add-on only.
8080/tcpports entry is there for users who want to reach the API from outside HA; a mapped port is not authenticated by HA, so DOCS.md says to setauth_tokenfirst.api:block:enabled,host,port,dashboard_enabled,docs_enabled(Swagger UI + OpenAPI schema, default off),mcp_enabled,auth_token,mcp_auth_token.api.enabled: true(the panel needs it) andapi.host: 0.0.0.0(ingress connects from the supervisor, outside the container).node:24-alpinestage (--platform=$BUILDPLATFORM, so npm stays off QEMU for aarch64), and runs the upstream wheel verification so a wheel without a dashboard fails the build.port-batcontrol-changeskill now also covers add-on surface changes (ingress, ports, map).Merge order
Merge MaStr/batcontrol#457 first. The development Dockerfile fetches batcontrol
mainand needsfrontend/andscripts/verify_wheel_dashboard.pyfrom it; merging this first breaks the dev add-on build.Testing
🤖 Generated with Claude Code