From d4dc746f6b518f93ea631540e9a6a8eec540e042 Mon Sep 17 00:00:00 2001 From: Gerrrt Date: Wed, 18 Nov 2026 20:28:06 -0800 Subject: [PATCH 1/2] feat(wall): the thermostat and the Litter-Robot in the Home row The Home row gains the hallway thermostat's temperature and humidity, and heating or cooling while it runs, read from climate.thermostat. The Litter-Robot shows in amber only when it needs something, through a new sensor.wall_litter that uses litter_robot.yaml's own thresholds. Doors and windows share one item when all are shut, and a row too long for the screen drops the office lights, then the thermostat, never an amber item. Co-Authored-By: Claude Opus 5.5 --- docs/changelog.md | 12 +++++ docs/security.md | 5 +- stacks/sensitive/Caddyfile | 15 ++++++ stacks/sensitive/README.md | 8 ++- .../home-assistant/packages/README.md | 2 +- .../home-assistant/packages/wall_house.yaml | 36 ++++++++++++- stacks/sensitive/wall/wall.js | 54 +++++++++++++++---- 7 files changed, 117 insertions(+), 15 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 23b8cf69..5a7eaefc 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,18 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-18 +- **The wall's Home row reads the thermostat and the Litter-Robot.** The + second of the wall's five steps. The row gains the hallway thermostat's + temperature and humidity, and "heating" or "cooling" while it is, read + from `climate.thermostat` at `/api/ha/thermostat`. The Litter-Robot + appears in amber only when it wants something: a new `sensor.wall_litter` + in `wall_house.yaml` says which, by `litter_robot.yaml`'s own thresholds. + Doors and windows share one item when all are shut, and a row too long for + the screen drops the office lights, then the thermostat, never an amber + item. The mockup's front-door lock is left out: the house has no smart + lock for it to read. Previewed at 1920x1080 against stubbed answers, + quiet and with two openings and the Litter-Robot at once. Not yet run + against the real Home Assistant. - **The wall gets a week, a countdown and a context card.** The first of five steps that take the useful ideas from a denser mockup of the office wall without shrinking its text below what reads from the chair. diff --git a/docs/security.md b/docs/security.md index d981a909..c4be640f 100644 --- a/docs/security.md +++ b/docs/security.md @@ -1145,10 +1145,11 @@ from Home Assistant with *not enough permissions*. firing alerts, per-host CPU, SNMP reachability, WAN traffic and latency, the UPS and `heimdall`'s temperature. That is less than the Homelab page already shows, and the page and the Pi hold no credential. - **Its household half reads eleven Home Assistant entities the same way.** + **Its household half reads thirteen Home Assistant entities the same way.** Each `/api/ha/NAME` is one `GET /api/states/` written in the Caddyfile: the weather, today's forecast, the alarm's mode, four door - contacts, two window contacts, the office lights, and `sensor.wall_today`, + contacts, two window contacts, the office lights, the thermostat, the + Litter-Robot's summary, and `sensor.wall_today`, which holds the next seven days' calendar events. Caddy adds the token of HA's non-admin `wall` user. Home Assistant has no read-only role, so that token could call services, the alarm's included. It is read-only only because it lives in diff --git a/stacks/sensitive/Caddyfile b/stacks/sensitive/Caddyfile index ebf523d2..21083169 100644 --- a/stacks/sensitive/Caddyfile +++ b/stacks/sensitive/Caddyfile @@ -441,6 +441,21 @@ wall.matrix.elysium { import wall_ha } + # The hallway thermostat: temperature, humidity and whether it is + # heating or cooling (home-assistant/packages/thermostat.yaml says + # what it is). Its id names no room of anyone's. + handle /api/ha/thermostat { + rewrite * /api/states/climate.thermostat? + import wall_ha + } + + # The Litter-Robot: ok, or attention and what, through a template + # entity in home-assistant/packages/wall_house.yaml. + handle /api/ha/litter { + rewrite * /api/states/sensor.wall_litter? + import wall_ha + } + # Today's high and low, the next rain and the next sunrise or sunset, # asked of weather.get_forecasts by # home-assistant/packages/wall_weather.yaml: since HA 2024.4 a forecast diff --git a/stacks/sensitive/README.md b/stacks/sensitive/README.md index 7a33075b..30e60a05 100644 --- a/stacks/sensitive/README.md +++ b/stacks/sensitive/README.md @@ -783,7 +783,13 @@ container of its own: Caddy serves `wall/` as static files. house's one alarm panel) and `binary_sensor.wall_office_lights` (on when any light whose id contains `office` is on). The page shows them as the header's weather and a one-line Home row: the - alarm's mode, any open door or window in amber, and the office lights. + alarm's mode, any open door or window in amber, the hallway thermostat's + temperature, humidity and whether it is heating or cooling (read from + `climate.thermostat` at `/api/ha/thermostat`), the office lights, and the + Litter-Robot in amber only when it wants something (`sensor.wall_litter` + at `/api/ha/litter`, from `wall_house.yaml`). A row too long for the + screen drops the office lights first, then the thermostat, never an + amber item. The header's high and low, the next rain and the next sunrise or sunset are `sensor.wall_weather` at `/api/ha/forecast`, from `home-assistant/packages/wall_weather.yaml`, which asks diff --git a/stacks/sensitive/home-assistant/packages/README.md b/stacks/sensitive/home-assistant/packages/README.md index c846ee9f..105f3411 100644 --- a/stacks/sensitive/home-assistant/packages/README.md +++ b/stacks/sensitive/home-assistant/packages/README.md @@ -29,7 +29,7 @@ and nothing else. This README is not YAML and Home Assistant ignores it. | `thermostat.yaml` | Thermostat alerts, no control: the hallway too cold or hot, humidity out of range, emergency heat switched on, the thermostat gone from Honeywell's cloud, or its gateway gone from the network (from its DHCP renewals in Loki). Each condition is a template binary sensor, so a restart does not lose it. Alerts go to phones labelled `household_phones` and to Home Assistant's notifications. The thermostat keeps its own schedule | | `tv_room_evening.yaml` | At 19:00 the TV comes on with Prime Video open and the TV room at its Mood scene; at 21:00 a bedtime nudge on the living-room Echo and the TV. A pause switch skips both | | `wall_calendar.yaml` | `sensor.wall_today`: the next seven days' events, asked of `calendar.get_events` every five minutes, for the office wall's Today panel, its week below tomorrow and the header's *Up next* (ADR-0119). The calendars are those labelled `wall_calendar` in the UI, or all of them when none is labelled, so no calendar is named here. Unavailable, not empty, when a calendar cannot be read | -| `wall_house.yaml` | `sensor.wall_alarm` and `binary_sensor.wall_office_lights` for the office wall (ADR-0119): the house's one alarm panel's mode, and whether any light whose id contains `office` is on. Their own ids name the city and a person, so the wall reads these instead. Unavailable when nothing matches | +| `wall_house.yaml` | `sensor.wall_alarm`, `binary_sensor.wall_office_lights` and `sensor.wall_litter` for the office wall (ADR-0119): the house's one alarm panel's mode, and whether any light whose id contains `office` is on. Their own ids name the city and a person, so the wall reads these instead. Unavailable when nothing matches. `sensor.wall_litter` is `ok` or `attention`, with what in `needs`: the drawer at 90%, the litter under 30% or a cat's weight dropping, `litter_robot.yaml`'s thresholds | | `wall_weather.yaml` | `sensor.wall_weather` for the office wall's header (ADR-0119): today's high and low, the first of the next six hours with rain or snow, and `sun.sun`'s next sunrise and sunset. Asked of `weather.get_forecasts` on `weather.forecast_home` every fifteen minutes, because a forecast is an action's answer, not an attribute. Unavailable only when neither the daily nor the hourly forecast answers; with no daily entry for today, the state is `none` and the rain and sun still come through | Home Assistant reads these files only when it starts, and the directory is diff --git a/stacks/sensitive/home-assistant/packages/wall_house.yaml b/stacks/sensitive/home-assistant/packages/wall_house.yaml index c026515e..d5378b2d 100644 --- a/stacks/sensitive/home-assistant/packages/wall_house.yaml +++ b/stacks/sensitive/home-assistant/packages/wall_house.yaml @@ -1,6 +1,6 @@ --- -# The alarm's mode and the office lights, as two entities the office wall can -# read by a fixed id (ADR-0119). +# The alarm's mode, the office lights and the Litter-Robot, as entities the +# office wall can read by a fixed id (ADR-0119). # # The wall reads Home Assistant through fixed `GET /api/states/` # handles in the Caddyfile. The Ring Alarm's own entity id names the city, and @@ -39,3 +39,35 @@ template: availability: >- {{ states.light | selectattr('entity_id', 'search', 'office') | rejectattr('state', 'in', ['unavailable', 'unknown']) | list | count > 0 }} + + # The Litter-Robot, for the wall's Home row, which shows it only when it + # wants something: `ok`, or `attention` with what, in `needs`. The + # thresholds are litter_robot.yaml's reminder's (drawer at 90%, litter + # under 30%) and its weight sensors', so the wall and the phones agree. + # Its own sensors' ids are already in that file and name no person; this + # one exists so the thresholds live here, not in the page. + - sensor: + - name: Wall litter + unique_id: wall_litter + icon: mdi:cat + state: >- + {% set drawer = states('sensor.litter_robot_4_waste_drawer') | float(0) %} + {% set litter = states('sensor.litter_robot_4_litter_level') | float(100) %} + {% set cats = states.binary_sensor | selectattr('entity_id', 'search', '_weight_dropping$') + | selectattr('state', 'eq', 'on') | list | count %} + {{ 'attention' if drawer >= 90 or litter < 30 or cats > 0 else 'ok' }} + availability: >- + {{ has_value('sensor.litter_robot_4_waste_drawer') + and has_value('sensor.litter_robot_4_litter_level') }} + attributes: + # Short phrases, in the order the wall shows them. + needs: >- + {% set drawer = states('sensor.litter_robot_4_waste_drawer') | float(0) %} + {% set litter = states('sensor.litter_robot_4_litter_level') | float(100) %} + {% set cats = states.binary_sensor | selectattr('entity_id', 'search', '_weight_dropping$') + | selectattr('state', 'eq', 'on') | list | count %} + {% set n = namespace(items=[]) %} + {% if drawer >= 90 %}{% set n.items = n.items + ['drawer full'] %}{% endif %} + {% if litter < 30 %}{% set n.items = n.items + ['litter low'] %}{% endif %} + {% if cats > 0 %}{% set n.items = n.items + ['cat weight'] %}{% endif %} + {{ n.items }} diff --git a/stacks/sensitive/wall/wall.js b/stacks/sensitive/wall/wall.js index d60e430f..f9c59644 100644 --- a/stacks/sensitive/wall/wall.js +++ b/stacks/sensitive/wall/wall.js @@ -43,7 +43,10 @@ const WINDOWS = [["window_left", "Left"], ["window_right", "Right"]]; // "forecast" is sensor.wall_weather: today's high and low, the next rain and // the next sunrise or sunset (home-assistant/packages/wall_weather.yaml). - const HOUSE = ["weather", "forecast", "alarm", "office_light", ...DOORS.map((d) => d[0]), ...WINDOWS.map((w) => w[0])]; + // "thermostat" is climate.thermostat itself; "litter" is sensor.wall_litter + // (home-assistant/packages/wall_house.yaml). + const HOUSE = ["weather", "forecast", "alarm", "office_light", "thermostat", "litter", + ...DOORS.map((d) => d[0]), ...WINDOWS.map((w) => w[0])]; // "today" is sensor.wall_today: the calendars' events for the next seven // days, gathered by home-assistant/packages/wall_calendar.yaml. const HA = [...HOUSE, "today"]; @@ -404,11 +407,22 @@ armed_night: ["Night", ""], arming: ["Arming", "warn"], pending: ["Entry delay", "alert"], triggered: ["TRIGGERED", "alert"], }; - function homeItem(label, value, cls) { + // `drop` marks an item the row may leave out when it runs out of width: + // the higher, the sooner it goes. Unmarked items always stay. + function homeItem(label, value, cls, drop) { const span = el("span", `item ${cls || ""}`, label); span.append(el("b", null, value)); + if (drop) span.dataset.drop = String(drop); return span; } + // A crowded row loses its quiet items first, whole, never half a word. + function fitRow(row) { + while (row.scrollWidth > row.clientWidth + 2) { + const items = [...row.querySelectorAll("[data-drop]")]; + if (!items.length) return; + items.sort((a, b) => Number(b.dataset.drop) - Number(a.dataset.drop))[0].remove(); + } + } function openOf(list) { let unknown = false; const open = []; @@ -429,19 +443,41 @@ row.append(homeItem("Alarm", "—", "unknown")); } + // Doors and windows share one item: all shut is one fact, and the row + // needs the room. What is open is named, a window as "Left window". const doors = openOf(DOORS); - if (doors.open.length) row.append(homeItem("Open", doors.open.join(", "), "warn")); - else row.append(homeItem("Doors", doors.unknown ? "—" : "all closed", doors.unknown ? "unknown" : "")); - const wins = openOf(WINDOWS); - if (wins.open.length) row.append(homeItem("Window open", wins.open.join(", "), "warn")); - else row.append(homeItem("Windows", wins.unknown ? "—" : "closed", wins.unknown ? "unknown" : "")); + const open = [...doors.open, ...wins.open.map((w) => `${w} window`)]; + if (open.length) row.append(homeItem("Open", open.join(", "), "warn")); + else if (doors.unknown || wins.unknown) row.append(homeItem("Doors & windows", "—", "unknown")); + else row.append(homeItem("Doors & windows", "closed")); + + // The hallway thermostat. Its own alerts are thermostat.yaml's; this is + // the reading, with what it is doing when it is doing something. + if (haFresh("thermostat")) { + const t = states.thermostat.attributes || {}; + const bits = []; + if (t.current_temperature != null) bits.push(`${Math.round(t.current_temperature)}°`); + if (t.current_humidity != null) bits.push(`${Math.round(t.current_humidity)}%`); + if (t.hvac_action === "heating" || t.hvac_action === "cooling") bits.push(t.hvac_action); + row.append(homeItem("Inside", bits.length ? bits.join(" · ") : "—", bits.length ? "" : "unknown", 1)); + } else { + row.append(homeItem("Inside", "—", "unknown", 1)); + } if (haFresh("office_light")) { - row.append(homeItem("Office lights", states.office_light.state === "on" ? "on" : "off")); + row.append(homeItem("Office lights", states.office_light.state === "on" ? "on" : "off", "", 2)); } else { - row.append(homeItem("Office lights", "—", "unknown")); + row.append(homeItem("Office lights", "—", "unknown", 2)); + } + + // The Litter-Robot only when it wants something, in amber. An unreadable + // one says nothing here; the status bar's house age covers it. + if (haFresh("litter") && states.litter.state === "attention") { + const needs = (states.litter.attributes || {}).needs || []; + row.append(homeItem("Litter-Robot", needs.length ? needs.join(", ") : "needs a look", "warn")); } + fitRow(row); } // ---------- today: the calendar ---------- From 6dfe9dbc4f5dcee19e7cd0e568cc7dd2c3c77fa6 Mon Sep 17 00:00:00 2001 From: Gerrrt Date: Wed, 18 Nov 2026 20:34:57 -0800 Subject: [PATCH 2/2] fix(wall): never clip a Home-row warning; show an unreadable Litter-Robot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review of #1579: - When dropping the quiet items is not enough, each warning falls back to a count ("6 doors & windows"), so no amber item is ever cut off. - A Litter-Robot that cannot be read shows as "—", the last quiet item a crowded row drops, so an outage never looks like all is well. Co-Authored-By: Claude Opus 5.5 --- docs/changelog.md | 7 ++++--- stacks/sensitive/README.md | 8 ++++--- stacks/sensitive/wall/wall.js | 39 +++++++++++++++++++++++------------ 3 files changed, 35 insertions(+), 19 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 5a7eaefc..cfc9eb29 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -25,9 +25,10 @@ docstring gives: it is a record, not a claim about now. from `climate.thermostat` at `/api/ha/thermostat`. The Litter-Robot appears in amber only when it wants something: a new `sensor.wall_litter` in `wall_house.yaml` says which, by `litter_robot.yaml`'s own thresholds. - Doors and windows share one item when all are shut, and a row too long for - the screen drops the office lights, then the thermostat, never an amber - item. The mockup's front-door lock is left out: the house has no smart + An unreadable Litter-Robot shows as `—`, not as nothing. Doors and windows + share one item when all are shut, and a row too long for the screen drops + the office lights, then the thermostat, never an amber item; warnings + still too wide say how many instead of which. The mockup's front-door lock is left out: the house has no smart lock for it to read. Previewed at 1920x1080 against stubbed answers, quiet and with two openings and the Litter-Robot at once. Not yet run against the real Home Assistant. diff --git a/stacks/sensitive/README.md b/stacks/sensitive/README.md index 30e60a05..6a81ca59 100644 --- a/stacks/sensitive/README.md +++ b/stacks/sensitive/README.md @@ -787,9 +787,11 @@ container of its own: Caddy serves `wall/` as static files. temperature, humidity and whether it is heating or cooling (read from `climate.thermostat` at `/api/ha/thermostat`), the office lights, and the Litter-Robot in amber only when it wants something (`sensor.wall_litter` - at `/api/ha/litter`, from `wall_house.yaml`). A row too long for the - screen drops the office lights first, then the thermostat, never an - amber item. + at `/api/ha/litter`, from `wall_house.yaml`), and as `—` when it cannot be + read. A row too long for the screen drops the office lights first, then + the thermostat, then an unreadable Litter-Robot's `—`, never an amber + item; if the warnings alone are still too wide, each says how many + instead of which ("6 doors & windows"). The header's high and low, the next rain and the next sunrise or sunset are `sensor.wall_weather` at `/api/ha/forecast`, from `home-assistant/packages/wall_weather.yaml`, which asks diff --git a/stacks/sensitive/wall/wall.js b/stacks/sensitive/wall/wall.js index f9c59644..a10653ae 100644 --- a/stacks/sensitive/wall/wall.js +++ b/stacks/sensitive/wall/wall.js @@ -408,20 +408,29 @@ triggered: ["TRIGGERED", "alert"], }; // `drop` marks an item the row may leave out when it runs out of width: - // the higher, the sooner it goes. Unmarked items always stay. - function homeItem(label, value, cls, drop) { + // the higher, the sooner it goes. Unmarked items always stay. `compact` is + // a shorter value an item that always stays may fall back to. + function homeItem(label, value, cls, drop, compact) { const span = el("span", `item ${cls || ""}`, label); span.append(el("b", null, value)); if (drop) span.dataset.drop = String(drop); + if (compact) span.dataset.compact = compact; return span; } // A crowded row loses its quiet items first, whole, never half a word. + // If the warnings alone are still too wide, each says how many instead of + // which ("6 open"), which always fits, so no warning is ever clipped. function fitRow(row) { - while (row.scrollWidth > row.clientWidth + 2) { + const over = () => row.scrollWidth > row.clientWidth + 2; + while (over()) { const items = [...row.querySelectorAll("[data-drop]")]; - if (!items.length) return; + if (!items.length) break; items.sort((a, b) => Number(b.dataset.drop) - Number(a.dataset.drop))[0].remove(); } + for (const item of row.querySelectorAll("[data-compact]")) { + if (!over()) return; + item.querySelector("b").textContent = item.dataset.compact; + } } function openOf(list) { let unknown = false; @@ -448,7 +457,7 @@ const doors = openOf(DOORS); const wins = openOf(WINDOWS); const open = [...doors.open, ...wins.open.map((w) => `${w} window`)]; - if (open.length) row.append(homeItem("Open", open.join(", "), "warn")); + if (open.length) row.append(homeItem("Open", open.join(", "), "warn", 0, `${open.length} doors & windows`)); else if (doors.unknown || wins.unknown) row.append(homeItem("Doors & windows", "—", "unknown")); else row.append(homeItem("Doors & windows", "closed")); @@ -460,22 +469,26 @@ if (t.current_temperature != null) bits.push(`${Math.round(t.current_temperature)}°`); if (t.current_humidity != null) bits.push(`${Math.round(t.current_humidity)}%`); if (t.hvac_action === "heating" || t.hvac_action === "cooling") bits.push(t.hvac_action); - row.append(homeItem("Inside", bits.length ? bits.join(" · ") : "—", bits.length ? "" : "unknown", 1)); + row.append(homeItem("Inside", bits.length ? bits.join(" · ") : "—", bits.length ? "" : "unknown", 2)); } else { - row.append(homeItem("Inside", "—", "unknown", 1)); + row.append(homeItem("Inside", "—", "unknown", 2)); } if (haFresh("office_light")) { - row.append(homeItem("Office lights", states.office_light.state === "on" ? "on" : "off", "", 2)); + row.append(homeItem("Office lights", states.office_light.state === "on" ? "on" : "off", "", 3)); } else { - row.append(homeItem("Office lights", "—", "unknown", 2)); + row.append(homeItem("Office lights", "—", "unknown", 3)); } - // The Litter-Robot only when it wants something, in amber. An unreadable - // one says nothing here; the status bar's house age covers it. - if (haFresh("litter") && states.litter.state === "attention") { + // The Litter-Robot when it wants something, in amber, and as "—" when it + // cannot be read, so an outage never looks like all is well. Quiet when + // it is fine. The "—" is the last quiet item a crowded row drops. + if (!haFresh("litter")) { + row.append(homeItem("Litter-Robot", "—", "unknown", 1)); + } else if (states.litter.state === "attention") { const needs = (states.litter.attributes || {}).needs || []; - row.append(homeItem("Litter-Robot", needs.length ? needs.join(", ") : "needs a look", "warn")); + row.append(homeItem("Litter-Robot", needs.length ? needs.join(", ") : "needs a look", "warn", 0, + needs.length > 1 ? `${needs.length} things` : undefined)); } fitRow(row); }