Skip to content

Dashboard as an ingress panel (development add-on) - #35

Merged
MaStr merged 2 commits into
mainfrom
feat/dashboard-mcp
Oct 19, 2026
Merged

MaStr merged 2 commits into
mainfrom
feat/dashboard-mcp

Conversation

@MaStr

@MaStr MaStr commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Summary

Exposes the new batcontrol dashboard (MaStr/batcontrol#457) as the Batcontrol entry in the Home Assistant sidebar - development add-on only.

  • Ingress on port 8080 with a panel entry. An unmapped 8080/tcp ports 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 set auth_token first.
  • New options, mirrored from batcontrol's api: block: enabled, host, port, dashboard_enabled, docs_enabled (Swagger UI + OpenAPI schema, default off), mcp_enabled, auth_token, mcp_auth_token.
  • Two deliberate differences from upstream defaults: api.enabled: true (the panel needs it) and api.host: 0.0.0.0 (ingress connects from the supervisor, outside the container).
  • Dockerfile: builds the dashboard in a pinned node:24-alpine stage (--platform=$BUILDPLATFORM, so npm stays off QEMU for aarch64), and runs the upstream wheel verification so a wheel without a dashboard fails the build.
  • The stable add-on is untouched: it installs the released wheel, which carries the dashboard as package data.
  • port-batcontrol-change skill now also covers add-on surface changes (ingress, ports, map).
  • Dependabot tracks the development add-on base images.

Merge order

Merge MaStr/batcontrol#457 first. The development Dockerfile fetches batcontrol main and needs frontend/ and scripts/verify_wheel_dashboard.py from it; merging this first breaks the dev add-on build.

Testing

🤖 Generated with Claude Code

MaStr and others added 2 commits October 16, 2026 13:28
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>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 11:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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 unmapped 8080/tcp port with description, new api: options and matching schema, dev version bump 0.10.0dev6 → dev7.
  • Dockerfile: new source (alpine) and frontend (node:24-alpine) stages pinned to $BUILDPLATFORM, dashboard overlaid into the wheel, verify_wheel_dashboard.py gate, and EXPOSE 8080.
  • Docs/ops: DOCS.md api section, 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.

Comment on lines +222 to +224
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/).
@MaStr
MaStr merged commit 2216781 into main Oct 19, 2026
4 checks passed
@MaStr
MaStr deleted the feat/dashboard-mcp branch October 19, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants