Skip to content

v0.5.1: card works on dashboards opened during startup - #8

Merged
PeterSlijkhuis merged 1 commit into
mainfrom
claude/project-thread-1p9qg3
Sep 29, 2026
Merged

PeterSlijkhuis merged 1 commit into
mainfrom
claude/project-thread-1p9qg3

Conversation

@PeterSlijkhuis

Copy link
Copy Markdown
Owner

Before: A dashboard opened while Home Assistant was still starting (after a restart or update, often in the phone app) showed "Configuration error" instead of the card. It stayed that way until the page was fully reloaded, even though the sensors were fine.

After: The card loads on those dashboards too. Reproduced in a test Home Assistant by opening the dashboard during startup: before the change the error stayed for 45 s and more; after it the card showed right away.

Cause: the card was only served from the integration's own URL, which exists once the integration is set up. Home Assistant serves dashboards well before that, and a page never picks up a card that is added after it has loaded.

How: on setup the card files are copied to /config/www/battery_roi and added as a dashboard resource (/local/battery_roi/battery-roi-card.js?v=<version>). /local is served from the moment Home Assistant starts. The old URL stays as a fallback, and the card ignores being loaded twice. The resource URL follows the version, so updates bust the cache. Removing the integration removes the copy and the resource. YAML-managed resources are left alone (README explains the one line to add). If the resource step fails for any reason, setup continues and logs a warning. Version 0.5.1.

Release note for v0.5.1:

Fixed "Configuration error" on the card after Home Assistant restarts. The card is now also installed as a dashboard resource from /config/www/battery_roi. If you had no www folder yet, the fix takes effect after one more restart.

Tests: 27 pass, including a new one that checks the copy, the resource and the cleanup on removal.


Generated by Claude Code

Dashboards opened while Home Assistant was still starting never loaded
the card and showed "Configuration error" until the page was reloaded,
because the integration's own card URL only exists once it is set up.
The card is now also copied to /config/www/battery_roi and added as a
dashboard resource; /local is served from the start. Removing the
integration removes both again. Version 0.5.1.
@PeterSlijkhuis
PeterSlijkhuis marked this pull request as ready for review September 29, 2026 09:01
@PeterSlijkhuis
PeterSlijkhuis merged commit 7d7f2de into main Sep 29, 2026
3 checks passed
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.

1 participant