Files
Mortdecai 93f6c33cd3 feat: simplify Google switch to on-only (state push restored)
Dropped the both-on/off-fire workaround now that HomeGraph reportState works
(new SA key + linked agent). turn_off is a no-op; on-tap prints; tile auto-reverts
via reportState. Verified: turn_on prints, turn_off does nothing. Docs/DECISIONS
updated to mark the HomeGraph auth issue resolved.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 04:53:26 -04:00

58 lines
4.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# POS-Automation — Decisions
Format: `YYYY-MM-DD: <decision> — <why>`
- **2026-06-07: On-demand trigger via MQTT bridge (lgtv pattern), not cron.** Seth
wants a Google Home button, not a scheduled print. Bridge `pos-briefing-mqtt.service`
(systemd, `User=claude`) on steel141 subscribes to `posbriefing/button/press` on
broker CT 301 (192.168.0.154); HA exposes a `script` to Google as a Scene (button).
The earlier "schedule 4:58am/3pm" was never a real cron job — that commit only
edited SESSION.md.
- **2026-06-07: Printer discovered by MAC `50:57:9c:eb:0f:07`, not a fixed IP.** The
TM-m30's IP changes on every reboot (router DHCP, no reservation). Cache last IP
(`~/.cache/pos-briefing/last_ip`), verify by MAC + port, sweep the /24 on a miss.
A router DHCP reservation would make this belt-and-suspenders but isn't required.
- **2026-06-07: Summaries on `gemma4:26b`; story selection stays on a fast model.**
Seth asked to switch summaries to gemma4. gemma4:26b under `format:json` ignores
the bare-array instruction and emits a reasoning object (`{"thought": ...}`), which
broke Phase-1 selection. Selection now uses `ollama_select_model` (default
`qwen2.5:1.5b`); summaries use `ollama_model` = `gemma4:26b`. Also better latency
for an interactive button.
- **2026-06-07: yfinance installed on steel141** via `pip --user --break-system-packages`
(PEP 668). It was missing after the CT 166 → steel141 migration — the original
"not firing" had two causes: no cron ever installed + this missing dependency.
- **2026-06-07: HA side deployed on VM HA `192.168.0.146`** (`/config/scripts.yaml`
+ `script.print_daily_briefing` in `configuration.yaml` `google_assistant.entity_config`;
backups in `/config/.backup/`). MQTT-discovery button entity id is
`button.pos_briefing_print_daily_briefing` (HA prefixes the device name). Access:
`ssh seth@192.168.0.146` (key auth), `bash -lc "ha core check|restart"`, services via
`$SUPERVISOR_TOKEN``http://supervisor/core/api/`. See `docs/ha-setup.md`.
- **2026-06-07: Exposed to Google as a SWITCH tile, not a Scene.** HA scripts/scenes
get Google's Scene trait, which Google Home does NOT render as a tappable tile
(voice/Routine only) — the button was invisible. A template switch
(`switch.print_daily_briefing`) tiles like the TV. **Confirmed working end-to-end
2026-06-07: a Google Home tap printed a receipt.** State is forced off and both
on-tap fires the print; state is forced off so the tile auto-reverts via reportState;
`turn_off` is a no-op. (Was both-on/off-fire while HomeGraph was down; simplified to
on-only 2026-06-07 once state push was restored. Bridge debounce still guards doubles.)
- **2026-06-07: HomeGraph SA key regenerated.** The old `/config/SERVICE_ACCOUNT.json`
key was invalid (`invalid_grant` — rotated in the lgtv 06-06 cleanup, never refreshed),
breaking requestSync/reportState. Seth issued a new JSON key for `claude@seth-freiberg.iam`
(id `8e3e812b6913…`); deployed to HA (0600), restarted. Auth now succeeds
(400→404). After a Google re-link registered the agent, both requestSync and
reportState return 200 → **live state push works for all devices.** (A manually
admin-triggered request_sync logs a harmless 404: it sends the unlinked owner id
`2c22820…`; HA's automatic reporting uses the linked `f948247…` and succeeds.)
- **2026-06-07: paho-mqtt v1 callbacks (`CallbackAPIVersion.VERSION1`).** paho 2.1.0
is installed for `claude`; matches the working lgtv bridge. One-time deprecation
warning at startup is harmless.
## Deferred / Rejected
- **Print latency (~12 min/press):** gemma4:26b summarization (+ yfinance) dominates.
Acceptable for v1; the button returns immediately and `posbriefing/status` tracks
progress. Optimize later (model keep-alive, fewer/shorter summaries) if it annoys.
- **Router DHCP reservation for the printer:** Seth's router action; MAC discovery
makes it optional. Add if convenient to drop the sweep fallback.
- **zfs/reddit/grafana dashboard fields return None on steel141** (not the tank/ZFS
host; `cannot open 'tank'`). Out of scope for the trigger work — track separately.