Skip to content

Refine SED node state and parent presentation #105

@DarinShapiro

Description

@DarinShapiro

Problem

The nodes table currently marks some sleepy end devices (SEDs) as offline based on Home Assistant availability semantics even when mesh evidence suggests they are behaving normally as sleeping children.

Example observed in the dashboard:

  • Family Room Shade 4: role Sleepy end, status offline, strongest peer Eve Energy 1
  • Dining Room Shade 3: role Sleepy end, status online, strongest peer Eve Energy 1

Both appear to have the same mesh-side relationship to Eve Energy 1, but one is rendered as offline and both currently show no parent reported unless a direct parent field is present.

Current behavior

  • Primary node status is computed availability-first in sqlite_store.recompute_node_statuses(): available = 1 => online, available = 0 and HA-registered => offline.
  • For SED/FED rows, the dashboard only shows via <parent> when parent_eui64 is explicitly derived; otherwise it shows no parent reported.
  • Signal strength separately shows the strongest reporter / best peer, which often appears to be the practical parent for SEDs.

Questions to resolve

  1. Is HA availability the right primary operator-facing status for SEDs, or should SEDs surface a separate sleeping state when mesh evidence indicates expected sleepy-child behavior?
  2. When parent_eui64 is absent but the strongest incoming reporter is a stable single router and the node is a SED, should the UI treat that as inferred parent evidence instead of no parent reported?
  3. What threshold should distinguish sleeping from truly offline for SEDs? Example: if a SED normally checks in every ~60s, absence beyond a configurable multiple of that interval should be required before escalating to offline/problem.

Desired outcome

Refine node state and parent presentation so SEDs are not misclassified as broken when they are merely asleep between expected polls.

Scope

  • Define operator-facing state semantics for SEDs: online vs sleeping vs offline.
  • Decide whether SED parent presentation should fall back to best-peer / strongest-child-reporter evidence when direct parent derivation is unavailable.
  • Keep the backend as the source of truth so UI, MCP, and chat all consume the same refined node state.
  • Add focused tests for SED status classification and parent inference/presentation.

Acceptance criteria

  • A documented backend rule exists for classifying SEDs as sleeping versus offline.
  • SED rows no longer show offline purely because HA marks the backing entity unavailable if mesh evidence indicates expected sleepy behavior.
  • SED parent display no longer says no parent reported when there is strong enough evidence to infer the effective parent.
  • Focused tests cover the new state transitions and the parent fallback behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions