feat: per-entity update intervals (1s base + skip_updates)#29
Open
malaiwah wants to merge 1 commit into
Open
Conversation
Closes wildekek#8. Replaces the blanket update_interval: 5s with a 1s base poll plus per-entity skip_updates so that: * dynamic measurements (Output V/I/W, Battery V/Ah/Wh) refresh every 1s — fast enough to see a load step transient in HA * thermal & input-rail sensors refresh every ~5s * static identity (Model/Serial/FW version) every ~60s * config setpoints (OVP/OCP, Backlight, internal date_*) every ~30s * fault flags (CV/CC, OVP/OCP) and the Output switch stay at 1s The base interval is exposed as ${update_interval} in the substitutions block so users can dial it down (e.g. "5s" to restore the old cadence) without touching individual entities. At 115200 baud each Modbus read is ~3ms, so even with all entities polled simultaneously the bus is well under saturated. RD6006 firmware handles ~5 reads/sec comfortably; we end up well below that since slower entities skip most cycles. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Open
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.
Closes #8
Replaces the blanket
update_interval: 5swith a 1s base poll plus per-entityskip_updates, so dynamic measurements refresh every 1s while config / static / setpoint entities slow down to once per 5s, 30s, or 60s as appropriate.The base interval is exposed as
${update_interval}in the substitutions block — set it back to"5s"to restore the old cadence with the new per-entity proportions intact.Cadence summary
Battery modestays at 1s (no skip_updates) because the battery_charge / battery_energy availability gate (#17) consults its state on every poll; slowing it down would let stale Ah/Wh values leak into HA statistics on transitions.Verification
esphome configpasses both YAMLsesphome compileclean (RAM 46.3% / Flash 49.4% — same as upstream)Disclosure
Drafted with Claude (Anthropic). Author-reviewed.