From 205bc158ac6d8fc2bcf31662fdaa6369e4b89eac Mon Sep 17 00:00:00 2001 From: Mortdecai Date: Mon, 1 Jun 2026 20:17:18 -0400 Subject: [PATCH] =?UTF-8?q?docs:=20session=20handoff=20=E2=80=94=20consoli?= =?UTF-8?q?dation=20+=20fixes=20complete=20and=20verified?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- .../2026-06-01-consolidate-and-fix.md | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .claude/handoffs/2026-06-01-consolidate-and-fix.md diff --git a/.claude/handoffs/2026-06-01-consolidate-and-fix.md b/.claude/handoffs/2026-06-01-consolidate-and-fix.md new file mode 100644 index 0000000..f68cc27 --- /dev/null +++ b/.claude/handoffs/2026-06-01-consolidate-and-fix.md @@ -0,0 +1,44 @@ +# LG TV Bridge — consolidated, fixed, deployed (2026-06-01) + +## State: DONE, live, verified end-to-end. + +Single MQTT→HA bridge now runs on **steel141** as systemd `lgtv-mqtt.service` +(User=seth). Repo: `git.sethpc.xyz/Seth/lgtv` (was 0 commits; now pushed). + +## What was wrong + what fixed it +1. **Flaky HA state** — old code ping-swept all 254 hosts over SSH every 30s + (racy ARP). + I briefly made it worse by deploying a 2nd bridge with the + same MQTT `client_id` as the pve173 one → broker eviction war. + → Cached-IP probe (`~/.cache/lgtv/last_ip`), sweep only on miss. Single + bridge; pve173 service retired. +2. **Won't turn ON** — weak WoL. → unicast+broadcast, ports 9/7, 3 bursts. + **TV-side settings are the remaining half** (Quick Start+ / Mobile TV On; + prefer wired Ethernet) — only Seth can set these. +3. **power_off failed under systemd** — bscpylgtv key DB defaulted to a + CWD-relative path. → pass absolute `key_file_path`. Plus a 2× retry for the + "OFF within ~30s of ON" LG quirk (TV not ready for WebSocket control yet). + +## Verified live +- MQTT ON → TV woke <8s, found at 192.168.0.5, IP cached. +- Cache-hit status: 0.041s (was ~1s sweep). +- MQTT OFF (settled): power_off in 3.4s → TV off in ~13s. +- MQTT OFF (10s after ON, the hard case): retry path → rc=0 → TV off. +- Broker: 0 client_id evictions; service 0 restarts. + +## Decommissioned +pve173 `lgtv-mqtt.service`: stopped, disabled, unit moved to +`pve173:/root/.backup/lgtv-mqtt.service.retired` (+ old lgtv_mqtt.py backed up). +Reversible: restore the unit file + `daemon-reload` + `enable --now`. + +## If something regresses +- Logs: `sudo journalctl -u lgtv-mqtt.service -f` (on steel141). +- Broker churn check: mosquitto log in CT 301 on pve241, + `/var/log/mosquitto/mosquitto.log`, grep `lgtv-bridge already`. +- Redeploy from repo: `./install.sh` (needs `$HOMELAB_PASSWORD`). +- WebOS pairing key: `/home/seth/.aiopylgtv.sqlite` (steel141, seth). If lost, + re-pair with `bscpylgtvcommand ...` from seth's shell (TV prompts). + +## Open / deferred +- TV-side WoL settings unverified (Seth to confirm on the TV). +- No DHCP reservation for the TV (Pi-hole isn't the DHCP server; router is). + Not required — cache handles it — but would let us drop the sweep fallback.