Expose node clocks as sensors (hub `get_time`, repeater `server_timestamp`)

Open
#322 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 11 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start by reading companion-integration-api.md and tracing how the CLI-command service exposes hub commands and how repeater login/keep-alive handles LOGIN_SUCCESS. The issue also names AnonReqType.BASIC as an optional query path. Done means exposing each node's clock as a timestamp sensor so consumers can compare it with Home Assistant time; the issue does not identify specific source files or tests.

Written by the indexing model from the issue text.

Description

enhancement

Taking up the invitation in companion-integration-api.md to request a structured surface: please expose node clocks as entities so dashboards can show clock drift.

  • Hub: commands.get_time() is already reachable via the CLI-command service, but not as a sensor.
  • Repeaters: LOGIN_SUCCESS carries server_timestamp (firmware companion-v1.10.0+), so the clock could be captured at login/keep-alive without extra traffic. There's also AnonReqType.BASIC (0x03, "just remote clock") for an anonymous query where login isn't available.

A device_class: timestamp sensor per node would be enough — consumers can compute drift against HA time. Concretely, I'd like to implement a clock-drift warning in meshcore-card: flag a node whose clock has drifted beyond a threshold, since stale repeater clocks skew sender_timestamp correlation (as your docs note). This sensor is the missing piece.

Dominant language
Python
Stars
269
Forks
58
Avg merge
10d 17h
Merged PRs (30d)
12

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from meshcore-dev/meshcore-ha

All issues in meshcore-dev/meshcore-ha

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.