Repository navigation
Uptime as boot timestamp, clearer icons, and less recorder bloat - #416
Open
milandzuris wants to merge 1 commit into
Open
milandzuris wants to merge 1 commit into
milandzuris wants to merge 1 commit into
Conversation
- Uptime (repeater + companion) is now a timestamp sensor holding the boot time, stable between polls (60 s tolerance for LoRa latency and drift). - Distinct icons for sensors that shared mdi:radio / mdi:battery / mdi:percent. - Drop attributes that changed on every poll or duplicated other entities (repeater sensors, telemetry, device tracker) to stop recorder bloat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KUw9XkymcrvKMJhEcChWuQ
This branch has not been deployed
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.
Uptime as boot timestamp, clearer icons, and less recorder bloat
This PR has three parts. Each part only touches its own lines, so any of them can be dropped on request.
1. Uptime as a boot timestamp
What
The repeater Uptime sensor and the companion self-diagnostic Uptime sensor now use
device_class: timestampand hold the node's boot time. Before, they were adurationin minutes.Why
How
boot_time_from_uptime()inutils.pycomputesboot = now - uptime, truncated to whole seconds.uptimeseconds from the status payload, so they are unaffected.Breaking change
(now() - states('sensor.xxx_uptime') | as_datetime).total_seconds().2. Icons
These sensors used the same generic icon (
mdi:radio,mdi:battery,mdi:percent), so you couldn't tell them apart on a dashboard. Each now has an icon that matches what it measures:Telemetry sensors:
last_updatedis removed because it changes on every reading.raw_valueis removed because it duplicates the state.voltageis removed from the battery % sensor, because a separate Battery Voltage telemetry sensor is always created next to it.channel,lpp_type,pubkey_prefix,node_type,node_name,field) stay, since the recorder deduplicates them.Device tracker:
last_updatedis removed because it changes on every GPS reading.Neighbor sensors are untouched; they already only change
last_updatedwhen the data changes (#410).Not affected
Heads-up for card authors
jpettitt/meshcore-carddecides whether a repeater is online from the state'slast_updatedon the Uptime entity. That value only moved on every poll because the attributes changed. After parts 1 and 3 it only moves on a restart. Therequest_successescounter goes up on every successful status poll and is a more reliable signal.Tests
Full test suite passes,
ruff checkis clean.