Skip to content

fix(wall): restart Home Assistant on make up; keep the calendar visible under many alerts - #1573

Merged
Gerrrt merged 16 commits into
mainfrom
claude/homelab-tv-dashboard-sd6zal
Nov 18, 2026
Merged

Gerrrt merged 16 commits into
mainfrom
claude/homelab-tv-dashboard-sd6zal

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Nov 18, 2026

Copy link
Copy Markdown
Owner

What changed

1. make up restarts Home Assistant (scripts/reload-config.sh)

  • The new restart_home_assistant restarts HA on every make up of a stack that declares the service. That is sensitive only.
  • It follows the same pattern as restart_alloy: restart, wait for running to hold, and fail the deploy if it doesn't.
  • check_container_health.py then waits for the healthcheck, as it already does.
  • A stack that doesn't declare home-assistant is skipped. There is no "restart anyway" fallback.
  • The script header and home-assistant/packages/README.md say so.

2. The wall's left column (stacks/sensitive/wall/wall.js, wall.css)

  • Alerts:
    • capped at half the column and at most four rows, worst first, with "+N more"
    • the card no longer flex-shrinks alongside Today
  • A shared fitList():
    • keeps only whole rows in both Alerts and Today, and recounts "+N more"
    • drops a "Tomorrow" heading left with nothing under it
  • The .more line: its line height goes from 1 to 1.3, with 2 px of slack in the overflow test.
  • Today: its minimum height goes from 200 px to 300 px.

Changelog: a 2026-11-18 entry.

Why

  • Home Assistant:
    • After feat(wall): heimdall first light, and the house and family calendar on the wall #1566 deployed, sensor.wall_today, sensor.wall_alarm and binary_sensor.wall_office_lights didn't exist until the operator restarted HA by hand.
    • packages/ is mounted as a whole directory, so a changed file appears inside the container at once. HA reads it only at start.
    • compose up -d recreates nothing for a file-only change, and check_mounted_config.py only re-pins single-file mounts.
    • Restarting on every make up rather than comparing mtimes follows restart_alloy's documented reasoning. Converge's hourly no-op runs no make up, so this costs about a minute without automations per deploy only.
  • The wall:
    • On the real TV with 12 alerts firing, Alerts took about 70% of the column, its last row was cut in half, and Today showed 2 events and "+7 more".
    • While fixing that, two bugs surfaced:
      • A flex-shrinking card made each removed row shrink the box by the same amount, so the fit never converged.
      • line-height: 1 on "+N more" overhung by 3 px, so every check read as overflow and emptied the panel.

Refs ADR-0119.

Blast radius

  • On trinity: every make up STACK=sensitive, and every converge that deploys, restarts Home Assistant. That's about a minute without automations, and the wall's house row reads stale for that minute.

  • Other stacks: nothing changes.

  • The wall page: only the left column's sizing and fitting change. No data source, Caddy route or token changes.

  • No change to network segmentation or firewall rules

  • No new port published to a VLAN that could not already reach the service

  • No credential added outside secrets/*.sops.yaml

Verification

reload-config.sh, with a stub docker on PATH:

  • sensitive with home-assistant declared restarts docker-socket-proxy and home-assistant once each, and prints home-assistant (restarted: it reads its packages only at start).
  • observability restarts docker-socket-proxy and alloy, and never touches home-assistant.
  • A declared but stopped home-assistant fails the deploy: home-assistant is not running…, exit 1.
  • bash -n and shellcheck (via shellcheck-py) pass.

The wall, rendered at 1920×1080 against the pinned Caddy v2.11.9 with stand-in Prometheus and HA:

Alerts firing Alerts panel Today panel
12 DiskFilling (critical) first, then 1 more row and "+10 more", no half row 4 events and "+4 more"
2 both rows 4 events and "+4 more"
0 "All quiet" 4 events and "+4 more"

The bugs were reproduced before the fix:

  • Before the flex: 0 0 auto change, 12 alerts rendered as a bare "+12 more".
  • A per-step trace showed the box 3 px "over" whenever "+N more" was the last row.
  • After both fixes, the same scenarios render as in the table.

Repo checks:

  • python3 scripts/check_docs.py: docs OK.

  • markdownlint: 0 issues.

  • node --check wall.js: passed.

  • scripts/check_compose_vars.py (ci: check that every guarded SOPS value is in COMPOSE_VARS #1572): OK.

  • ./scripts/lint.sh passed with 12 checks skipped and not run (no Docker here). CI runs them.

  • make validate passes: left to CI

  • Deployed to the lab and confirmed working: after merge, make up STACK=sensitive on trinity should print the home-assistant restart line, then reboot heimdall

  • Docs updated (docs/, service README, or docs/roadmap.md)


Generated by Claude Code

The office television came up on heimdall on 2026-11-18. Its generic EDID
prefers 1280x720, and the video= boot line only sets the console, so a
kanshi profile now sets 1920x1080 at 60 Hz: sharp, no overscan, and kept
across a reboot. The Changhong has no HDMI-CEC (its manual never mentions
it, and the Pi's probe found no device), and it switches itself off
without a signal. So neither night-time path in ADR-0119 decision 5
applies, and the screen stays on with the set's Auto Sleep and Sleep
timers off.

build-heimdall.md sections 5, 7, 8 and 9, the hardware.md wall display
rows and a 2026-11-18 changelog entry say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
main already had a 2026-11-18 heading, so the entry added a second one, and
markdownlint's MD024 failed Lint on #1566. The entry now opens the
existing day, newest first. markdownlint-cli2 reported the MD024 error on
the previous head and 0 issues in 209 files on this one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
From Copilot's review on #1566. cec-ctl's physical address belongs to the
local adapter and is derived from the TV's EDID; the TV would be 0.0.0.0.
Section 8 now says the TV never replied, rather than that the Pi saw it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
Keep both 2026-11-18 changelog entries under one heading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
The page's header shows the weather and its bottom row the Ring Alarm's mode,
four door contacts, two window contacts and the office lights. Each is one
of nine /api/ha/NAME handles in the Caddyfile: a GET of one
/api/states/<entity>, ending in `?` so the client's query string is
dropped, with WALL_HA_TOKEN (the non-admin `wall` user, #1563) added by
Caddy. Home Assistant has no read-only role, so that narrowing is the
read-only part. security.md names the residual.

Two entities were renamed in HA so no committed ID names a person or the
city: light.office and alarm_control_panel.house. Measured against the
pinned Caddy and a stand-in HA: each handle reached only its entity with the
token, ?x=1 was dropped, POST 405, /api/states/ directly 404.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
A Today panel under the alerts lists today's and tomorrow's events: time
(or All day / Now), title and location, with a colour bar per calendar.
Alerts keep the height they need and the calendar fits what is left, with
"+N more" for the rest.

The events come from sensor.wall_today, built by a new HA package,
wall_calendar.yaml: a trigger-based template sensor that asks
calendar.get_events every five minutes for today and tomorrow. It reads the
calendars labelled wall_calendar, or every calendar when none is labelled, so
no calendar (whose Google ids name people) is named in the repository. It
reads unavailable, not empty, when a calendar cannot be read, and the
status bar shows that as "calendar · unavailable". The wall reads it through
a tenth fixed handle, /api/ha/today.

Booted on Home Assistant 2026.11.1: check_config passed, the sensor held the
demo calendars' events, and with no calendar it read unavailable. The page
was rendered against the pinned Caddy with a stand-in HA in its three states.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
The Ring Alarm's and the office lights' entity ids name the city and a
person, so the wall cannot name them and they stay as they are in HA. A new
package, wall_house.yaml, finds them instead: sensor.wall_alarm takes the
house's one alarm_control_panel, and binary_sensor.wall_office_lights is on
when any light whose id contains "office" is on. Both read unavailable when
nothing matches. The Caddyfile's alarm and office_light handles now name
these two template entities.

Booted on Home Assistant 2026.11.1 with a stand-in alarm and office light:
disarmed/off at start, armed_home/on after arming and turning on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
…hboard-sd6zal

# Conflicts:
#	docs/changelog.md
Keep every 2026-11-18 changelog entry under one heading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
make up STACK=sensitive failed on trinity with "required variable
WALL_HA_TOKEN is missing a value". The token is in
secrets/sensitive.sops.yaml (#1563) and compose.yaml guards it, but
render-config.sh writes to .env only the names in COMPOSE_VARS, and the wall
change never added it there. CI validates against seed-validation-env.sh's
stand-ins, not a render, so it passed.

Every other ${VAR:?} guard naming a SOPS key was checked against the list;
none is missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
…s push fast-forwards

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
…le under many alerts

Home Assistant reads packages/ only at start, and the directory is mounted
whole, so #1566's wall_* entities did not exist until a manual restart.
reload-config.sh now restarts it on every make up of a stack that declares
it, on the same terms as Alloy (no mtime shortcut, per restart_alloy's note).
Tested with a stub docker: sensitive restarts it, observability does not, and
a stopped one fails the deploy.

On the wall, 12 firing alerts took most of the left column and left Today
two events. Alerts are capped at half the column and four rows, worst first,
and a shared fitList() keeps only whole rows in both panels. A .more
line-height of 1 overhung its box by 3px, which read as overflow and emptied
the panel; it is now 1.3, with 2px slack in the test. Rendered with 12, 2 and
0 alerts against the pinned Caddy: Today kept at least four events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
…s push fast-forwards

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
Keep both 2026-11-18 changelog entries under one heading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
Copilot AI balanced review requested due to automatic review settings November 18, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

A single oversized alert can still be clipped by the half-height panel without a “+1 more” indicator because the fitting logic never removes the last data row.

1 open issue
What changed in this PR

This PR makes Home Assistant load package changes during deployment and keeps the wall dashboard’s calendar visible when many alerts are firing.

Changes:

  • Restart Home Assistant when the deployed stack declares it, checking that the container stays running.
  • Cap the Alerts panel and share whole-row fitting logic between Alerts and Today, including hidden-item counts.
  • Document the restart behavior and record both fixes in the changelog.
File Description
stacks/​sensitive/​wall/​wall.js Adds shared list fitting and limits alerts to four rows before fitting.
stacks/​sensitive/​wall/​wall.css Caps alert height, reserves calendar space, and adjusts overflow styling.
stacks/​sensitive/​home-assistant/​packages/​README.md Explains automatic restarts and their deployment downtime.
scripts/​reload-config.sh Restarts Home Assistant only in stacks that declare it.
docs/​changelog.md Records the deployment and wall-layout fixes.

Review effort: Balanced

Comment thread stacks/sensitive/wall/wall.js Resolved
…g it

From Copilot's review on #1573. fitList() never removed the last child, so
one alert whose name wrapped past the half-height panel was clipped with no
indicator. A row can now always be dropped; only a lone non-row line
("Nothing else today", or the "+N more" itself) is kept. Rendered with one
alert of a 238-character name: "+1 more". With 12 and 0 alerts the panels
are as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2EweeobucQzJcXxXS27K6
@Gerrrt
Gerrrt merged commit 438c98b into main Nov 18, 2026
9 checks passed
@Gerrrt
Gerrrt deleted the claude/homelab-tv-dashboard-sd6zal branch November 18, 2026 19:12
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.

3 participants