Skip to content

Track advert paths and expose them on contact sensors - #323

Open
jpettitt wants to merge 1 commit into
meshcore-dev:mainfrom
jpettitt:advert-path
Open

Track advert paths and expose them on contact sensors#323
jpettitt wants to merge 1 commit into
meshcore-dev:mainfrom
jpettitt:advert-path

Conversation

@jpettitt

@jpettitt jpettitt commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

When the companion pushes an ADVERTISEMENT event, the coordinator fetches the route that advert took (GET_ADVERT_PATH — a local device query, no RF traffic) and exposes it on the contact binary sensor as adv_path / adv_path_len / adv_path_time.

Why: out_path only reflects a learned return route, which stays flood-routed until a two-way exchange with the contact. The firmware records the traversed path for every advert it hears, so this makes "how was this contact last heard" visible to dashboards — e.g. meshcore-card's routing-path display, which today can only show Direct/Flood for advert-only contacts.

Notes

  • Fetching latches off after 3 consecutive failures so firmware without GET_ADVERT_PATH isn't queried on every advert (retries after HA restart).
  • Paths populate as adverts arrive; no persistence across restarts (the neighbor-store pattern could be added later if wanted).
  • Docs: contact attribute list updated in contacts.md.
  • Tests: 7 integration-tier tests driving the real coordinator and sensor with only the MeshCore API mocked.

🤖 Generated with Claude Code

On ADVERTISEMENT push, fetch the advert's traversed route via
GET_ADVERT_PATH (a local companion query, no RF traffic) and expose it
as adv_path / adv_path_len / adv_path_time attributes on the contact
binary sensor. Fetching latches off after three consecutive failures so
firmware without the command isn't queried on every advert.

Co-Authored-By: Claude Fable 5 <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