Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/architecture.md

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ docstring gives: it is a record, not a claim about now.

## 2026-11-19

- **The wall says when the dogs are due.** The last of the wall's five
steps.
- `wall_dogs.yaml` makes `sensor.wall_dogs`: when the dogs were last
walked and fed, and how many hours each may go. No device knows this, so
it is recorded by hand: two dashboard buttons, `Dogs walked` and
`Dogs fed`, or an NFC tag labelled `wall_dog_walk` or `wall_dog_feed`
and tapped with a phone. The newest of the two counts.
- The context card *Dogs* shows while either is overdue, after packages
and before the to-do list, in amber with how long ago each happened.
- Both intervals start at 0, which means not tracked, so the card stays
hidden until they are set in the UI. An Alexa routine was in the plan;
this house does not expose Home Assistant to Alexa, so it is left out.

Previewed at 1920x1080 against stubbed answers; it has not run against
the real Home Assistant.

- **The wall shows what is playing, and how the backups stand.** The fourth
of the wall's five steps.
- `wall_media.yaml` makes `sensor.wall_media`: the title, artist and app of
Expand Down
5 changes: 3 additions & 2 deletions docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -1147,14 +1147,15 @@ from Home Assistant with *not enough permissions*.
off-site copy last succeeded, and how many security updates and reboots
each host is waiting for. That is less than Glance's Homelab and
Maintenance pages already show, and the page and the Pi hold no credential.
**Its household half reads nineteen Home Assistant entities the same way.**
**Its household half reads twenty Home Assistant entities the same way.**
Each `/api/ha/NAME` is one `GET /api/states/<entity>` written in the
Caddyfile: the weather, today's forecast, the alarm's mode, four door
contacts, two window contacts, the office lights, the thermostat, the
Litter-Robot's summary, the next drive, the Shabbat times, the open to-do
items, the next trash pickup, the packages to collect by their own labels,
what the labelled players are playing (title, artist and app, never the
player's name or room), and `sensor.wall_today`,
player's name or room), when the dogs were last walked and fed, 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
Expand Down
6 changes: 6 additions & 0 deletions stacks/sensitive/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ wall.matrix.elysium {
# trash the next pickup, from three helpers
# deliveries packages to go and get (17TRACK)
# media what the players labelled wall_media are playing
# dogs when the dogs were last walked and fed
handle /api/ha/commute {
rewrite * /api/states/sensor.wall_commute?
import wall_ha
Expand Down Expand Up @@ -511,6 +512,11 @@ wall.matrix.elysium {
import wall_ha
}

handle /api/ha/dogs {
rewrite * /api/states/sensor.wall_dogs?
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
Expand Down
8 changes: 5 additions & 3 deletions stacks/sensitive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,8 @@ container of its own: Caddy serves `wall/` as static files.
(`/api/ha/commute`); Shabbat or Yom Tov, from six hours before candle
lighting to havdalah (`/api/ha/shabbat`); the bins, from 16:00 the evening
before pickup to noon on the day (`/api/ha/trash`); packages to go and
get (`/api/ha/deliveries`); the open to-do items (`/api/ha/todo`); what is
get (`/api/ha/deliveries`); the dogs, while a walk or a feeding is overdue
(`/api/ha/dogs`); the open to-do items (`/api/ha/todo`); what is
playing on the players labelled `wall_media` (`/api/ha/media`); and
otherwise a Hebrew word of the day from a static list in the page. The
others that also apply are named on the card's last line. Each source is a
Expand All @@ -824,8 +825,9 @@ container of its own: Caddy serves `wall/` as static files.
`Home`, region US, any destination, its polling off) and the label
`wall_commute` on each calendar to route from, the Jewish Calendar
integration, a to-do list labelled `wall_todo`, the trash helpers'
pickup day, the 17TRACK integration with the household's account, and the
label `wall_media` on each player to show. The
pickup day, the 17TRACK integration with the household's account, a
walking or feeding interval above 0 for the dogs, and the label
`wall_media` on each player to show. The
commute card sends the next labelled event's location to Waze. The UPS's mains or battery,
charge and runtime are in its node tile, `mjolnir`. Booted on
Home Assistant 2026.11.1 against its demo calendars on 2026-11-18: the
Expand Down
1 change: 1 addition & 0 deletions stacks/sensitive/home-assistant/packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ and nothing else. This README is not YAML and Home Assistant ignores it.
| `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_commute.yaml` | `sensor.wall_commute` for the office wall's context card (ADR-0119): the minutes of the quickest live-traffic route from the home zone to the next timed event within three hours, on a calendar labelled `wall_commute` in the UI, whose location looks like a place (a digit or a comma, and not Teams, Zoom, Meet, Webex or a link), and when to leave, five minutes ahead. Asked of `waze_travel_time.get_travel_times` every five minutes, only while there is such an event; the Waze Travel Time integration has to be added once in the UI for the action to exist. Sends that location to Waze. `none` when there is nothing to drive to |
| `wall_deliveries.yaml` | `sensor.wall_deliveries` for the office wall's context card (ADR-0119): the 17TRACK packages delivered today, ready to be picked up or undelivered, by their own labels, and how many are in transit. Asked of `seventeentrack.get_packages` every fifteen minutes. Never the tracking numbers. Unavailable until the 17TRACK integration is added |
| `wall_dogs.yaml` | `sensor.wall_dogs` for the office wall's context card (ADR-0119): when the dogs were last walked and fed, the newest of a dashboard button (`input_button.dogs_walked`, `input_button.dogs_fed`) and an NFC tag labelled `wall_dog_walk` or `wall_dog_feed` in the UI, and how many hours each may go, set in the UI. The state counts what is overdue. Unavailable while both intervals are 0, the default |
| `wall_media.yaml` | `sensor.wall_media` for the office wall's context card (ADR-0119): `playing` or `idle`, with the title, artist or series and app of the first playing media player labelled `wall_media` in the UI. Never the player's name or room, and no album art. Unavailable while no player carries the label |
| `wall_shabbat.yaml` | `sensor.wall_shabbat` for the office wall's context card (ADR-0119): the upcoming candle lighting as its state, with havdalah, the parsha, the Hebrew date and any Yom Tov's name, from the Jewish Calendar integration's entities, found by what their ids end with. Unavailable until that integration is added |
| `wall_todo.yaml` | `sensor.wall_todo` for the office wall's context card (ADR-0119): the open items, title and due date, of the to-do lists labelled `wall_todo` in the UI, asked of `todo.get_items` every minute. Unavailable while no list carries the label |
Expand Down
76 changes: 76 additions & 0 deletions stacks/sensitive/home-assistant/packages/wall_dogs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
# When the dogs were last walked and fed, for the office wall's context card
# (ADR-0119). No device knows this, so someone records it, either way:
#
# - the two buttons below, on a dashboard, for anyone in the house;
# - an NFC tag, by the leash hook or the food bin, tapped with a phone that
# has the companion app. Each tag is an entity (`tag.*`) whose state is
# when it was last scanned; label it `wall_dog_walk` or `wall_dog_feed` in
# the UI and it counts. The label picks the tags, so none is named here.
#
# The newest of a button press and a labelled tag's scan wins. How long is too
# long is set in the UI, in hours; 0, the default, means not tracked, so the
# wall stays quiet until it is set.
#
# What reaches the wall: two times and two thresholds. Not who pressed or
# scanned, and not the dogs' names.

input_button:
dogs_walked:
name: Dogs walked
icon: mdi:dog-side
dogs_fed:
name: Dogs fed
icon: mdi:bowl-mix

input_number:
dogs_walk_every_hours:
name: Walk the dogs every (hours, 0 = not tracked)
icon: mdi:dog-side
min: 0
max: 24
step: 0.5
mode: box
dogs_feed_every_hours:
name: Feed the dogs every (hours, 0 = not tracked)
icon: mdi:bowl-mix
min: 0
max: 24
step: 0.5
mode: box

template:
- sensor:
# State: how many of the two are overdue. now() makes it re-evaluate
# each minute. The wall works out the ages itself from the attributes.
- name: Wall dogs
unique_id: wall_dogs
default_entity_id: sensor.wall_dogs
icon: mdi:dog
availability: >-
{{ states('input_number.dogs_walk_every_hours') | float(0) > 0
or states('input_number.dogs_feed_every_hours') | float(0) > 0 }}
state: >-
{% set ns = namespace(n=0) %}
{% for button, label, every in [
('input_button.dogs_walked', 'wall_dog_walk', 'input_number.dogs_walk_every_hours'),
('input_button.dogs_fed', 'wall_dog_feed', 'input_number.dogs_feed_every_hours')] %}
{% set hours = states(every) | float(0) %}
{% set last = ([button] + label_entities(label)) | map('states')
| map('as_datetime', none) | reject('none') | list %}
{% if hours > 0 and (not last or now() - (last | max) > timedelta(hours=hours)) %}
{% set ns.n = ns.n + 1 %}
{% endif %}
{% endfor %}
{{ ns.n }}
attributes:
walked: >-
{% set last = (['input_button.dogs_walked'] + label_entities('wall_dog_walk')) | map('states')
| map('as_datetime', none) | reject('none') | list %}
{{ (last | max).isoformat() if last else none }}
fed: >-
{% set last = (['input_button.dogs_fed'] + label_entities('wall_dog_feed')) | map('states')
| map('as_datetime', none) | reject('none') | list %}
{{ (last | max).isoformat() if last else none }}
walk_hours: "{{ states('input_number.dogs_walk_every_hours') | float(0) }}"
feed_hours: "{{ states('input_number.dogs_feed_every_hours') | float(0) }}"
25 changes: 23 additions & 2 deletions stacks/sensitive/wall/wall.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
// The context card's sources (wall_commute, wall_shabbat, wall_todo,
// wall_trash, wall_deliveries, wall_media), each unavailable until it is
// set up.
const CARDS = ["commute", "shabbat", "todo", "trash", "deliveries", "media"];
const CARDS = ["commute", "shabbat", "todo", "trash", "deliveries", "dogs", "media"];
const HA = [...HOUSE, "today", ...CARDS];
const states = {}; // HA name -> the entity's state object
const answers = {}; // name -> data.result of the last good answer
Expand Down Expand Up @@ -688,7 +688,7 @@
// others that are also true are named on its last line, so nothing that
// matters is hidden without a word. The last entry always applies, so the
// card is never empty. Later cards (commute, Shabbat, trash, deliveries,
// now playing) slot in above it as their sources arrive.
// dogs, now playing) slot in above it as their sources arrive.
const MIN = 60_000;
const attrs = (name) => (haFresh(name) && states[name].attributes) || {};
const until = (t) => {
Expand Down Expand Up @@ -778,6 +778,26 @@
if (Number(a.in_transit) > 0) sub(box, `${a.in_transit} on the way`);
}

// Dogs: while a walk or a feeding is overdue. A threshold of 0 is not
// tracked; one never recorded counts as overdue, so a new setup shows.
function dogsDue() {
const a = attrs("dogs");
return [["Walked", "walk", a.walked, Number(a.walk_hours) || 0], ["Fed", "feed", a.fed, Number(a.feed_hours) || 0]]
.filter(([, , , hours]) => hours > 0)
.map(([label, verb, at, hours]) => {
const t = at ? new Date(at) : null;
const age = t && !isNaN(t) ? (Date.now() - t) / 1000 : null;
return { label, verb, age, due: age === null || age > hours * 3600 };
});
}
function dogsLive() { return haFresh("dogs") && dogsDue().some((d) => d.due); }
function renderDogs(box) {
const all = dogsDue();
const due = all.filter((d) => d.due).map((d) => d.verb);
hero(box, `${due.join(" and ")} the dogs`.replace(/^./, (c) => c.toUpperCase()), "warn");
for (const d of all) sub(box, d.age === null ? `${d.label}: not recorded yet` : `${d.label} ${ago(d.age)} ago`);
}

// The to-do list, the default when it has anything on it.
function todoLive() { return haFresh("todo") && Number(states.todo.state) > 0; }
function renderTodo(box) {
Expand Down Expand Up @@ -808,6 +828,7 @@
short: "shabbat", when: shabbatLive, render: renderShabbat },
{ title: "Trash", short: "trash", when: trashLive, render: renderTrash },
{ title: "Packages", short: "packages", when: deliveriesLive, render: renderDeliveries },
{ title: "Dogs", short: "dogs", when: dogsLive, render: renderDogs },
{ title: "To-do", short: "to-do", when: todoLive, render: renderTodo },
{ title: "Now playing", short: "playing", when: mediaLive, render: renderMedia },
{ title: "Word of the day", short: "word", when: () => true, render: renderWord },
Expand Down