feat(ws-controller): network topology service + get_network_topology API (schema 13)#832
Draft
MindFreeze wants to merge 1 commit into
Draft
feat(ws-controller): network topology service + get_network_topology API (schema 13)#832MindFreeze wants to merge 1 commit into
MindFreeze wants to merge 1 commit into
Conversation
Contributor
Author
|
I'll keep this in draft until I have tested the whole stack. May need to tweak the API |
MindFreeze
force-pushed
the
matter-network-topology-service
branch
2 times, most recently
from
July 9, 2026 14:24
8399375 to
8e3ec33
Compare
…ogy API (schema 13)
Derive the full Matter network graph (Thread mesh + Wi-Fi star) server-side and
expose it over the WebSocket API.
- NetworkTopologyService builds the graph from the shared ws-client derivation
pipeline plus the mDNS Border Router registry. Hybrid update model: debounced
change-driven rebuilds, emit-only-when-changed (hash excluding collected_at),
and a slow periodic rebuild for sleepy-device drift. refresh() re-reads Thread
neighbor/route tables (and Wi-Fi diagnostics) from online nodes, concurrency-
capped under an overall deadline.
- get_network_topology {refresh?} command and network_topology_updated event,
bumping SCHEMA_VERSION to 13 (min stays 11). The event is delivered only to
connections that have issued the command, mirroring the schema-12
thread_diagnostics_updated opt-in so pre-13 clients never see a new event type.
- NetworkTopology / node / connection wire types (snake_case), with both observed
Thread link directions preserved and a strongest-direction summary strength.
This first iteration derives Thread links from the nodes' own diagnostics and
classifies externals against the BR registry; the richer MeshCoP enrichment
(route64 / childTable) is a planned follow-up the wire model already accommodates.
MindFreeze
force-pushed
the
matter-network-topology-service
branch
from
July 9, 2026 14:32
8e3ec33 to
d46276f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the Matter network visualization work for OpenHomeFoundation roadmap #210. Follows #829 (the shared topology-derivation extraction), which this builds on.
Derives the full Matter network graph (Thread mesh + Wi-Fi star) server-side and exposes it over the WebSocket API, so downstream consumers (Home Assistant core / frontend) can relay a ready-made topology instead of each re-deriving it from raw cluster attributes and lacking the server-only mDNS Border Router data.
What's here
NetworkTopologyService— builds the graph from the sharedws-clientderivation pipeline plus the passively-discovered Border Router registry. Conventions mirrorThreadDiagnosticsService(injectedPick<>deps, anObservableevent, testable without a controller). Hybrid update model: debounced change-driven rebuilds, emit-only-when-changed (hash compare excluding the timestamp), and a slow periodic rebuild for sleepy-device drift.refresh()re-reads Thread neighbor/route tables (and Wi-Fi diagnostics) from online nodes, concurrency-capped under an overall deadline.get_network_topology { refresh? }command +network_topology_updatedevent, bumpingSCHEMA_VERSIONto 13 (min supported stays 11). The event is delivered only to connections that have issued the command, mirroring the schema-12thread_diagnostics_updatedopt-in so pre-13 clients never receive an event type they didn't subscribe to.NetworkTopology/ node / connection, snake_case): both observed Thread link directions are preserved, with a strongest-direction summarystrengthfor simple renderers.Scope
This first iteration derives Thread links from the nodes' own
ThreadNetworkDiagnostics(neighbor + route tables) and classifies externals against the BR registry. The richer MeshCoP diagnostic enrichment (route64 / childTable → router-to-router links and diagnostic-only mesh nodes) is a planned follow-up; the wire model already accommodates it.