Skip to content

Post: MQTT wait_for_trigger value_template doesn't filter — three layers of HA template semantics#18

Open
clarkbw wants to merge 2 commits into
mainfrom
post/mqtt-wait-for-trigger-value-template
Open

Post: MQTT wait_for_trigger value_template doesn't filter — three layers of HA template semantics#18
clarkbw wants to merge 2 commits into
mainfrom
post/mqtt-wait-for-trigger-value-template

Conversation

@clarkbw

@clarkbw clarkbw commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

New post from today's Poseidon-cutover lesson (agent-lessons.md, 2026-06-11): the HA ask-roundtrip wait that "matched the reply's trace_id" for two days and had never filtered anything.

The arc, all trace-verified live today:

  1. Layer 1: MQTT trigger value_template is a payload transformer, not a filter — without a payload: key nothing is compared and the trigger fires on every message. The trace_id check never filtered; one-producer topic made it invisible until interim says showed up and the puck spoke "Let me check the pilot book." as the answer.
  2. Layer 2: payload: "True" matched nothing — templates render native types, boolean True ≠ string "True".
  3. Layer 3: explicit sentinel strings still matched nothing — script variables aren't in scope in the per-message value_template render. Fun wrinkle: the script docs say variables are passed to the trigger, and that's true only at setup (topic/payload templates). I cite the actual mqtt/trigger.py lines showing the per-message render gets payload only.
  4. Fix: bare trigger + repeat/until loop — conditions DO see script variables. Includes the wait.trigger is none timeout escape and a note that the timeout becomes per-message.

Gotchas section carries the three lessons (negative-case verification, shared-topic traffic as a breaking change, per-context template semantics incl. a summary table) plus one short paragraph on the assist_satellite.announce mid-session kill + interim: true skip — flagged as a candidate for its own post later.

Privacy check: no hosts/IPs/paths; topic names are the ones already public in naturali-agents; daemon referenced generically with an org link.

Worth a verify pass on: the trace_id generation snippet in the Problem section is illustrative, not our literal line; and the docs-vs-source framing in Attempt 2 — I quote dev-branch code, line shapes could drift.

🤖 Generated with Claude Code

clarkbw and others added 2 commits June 11, 2026 18:13
…ers of HA template semantics

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deep-dive on signalk-dsc — the $--DSC/$--DSE and PGN 129808 gaps stock
SignalK parsers drop, how the plugin captures/stores/alarms on received
DSC traffic, and the 47 CFR 80.409 radio-log standard it mirrors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant