Skip to content

feat: per-entity update intervals (1s base + skip_updates)#29

Open
malaiwah wants to merge 1 commit into
wildekek:mainfrom
malaiwah:feat/per-entity-update-intervals
Open

feat: per-entity update intervals (1s base + skip_updates)#29
malaiwah wants to merge 1 commit into
wildekek:mainfrom
malaiwah:feat/per-entity-update-intervals

Conversation

@malaiwah
Copy link
Copy Markdown

Closes #8

Replaces the blanket update_interval: 5s with a 1s base poll plus per-entity skip_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

Entity Interval
Output V/I/W, Battery V/Ah/Wh 1s
Temperature internal/external, Input voltage 5s
Setpoints (V, I, OVP, OCP), date_*, Keypad lock 30s
Model, Serial, Firmware version 60s
CV/CC, OVP/OCP fault flags, Output switch 1s

Battery mode stays 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 config passes both YAMLs
  • Full esphome compile clean (RAM 46.3% / Flash 49.4% — same as upstream)
  • At 115200 baud each Modbus exchange is ~3ms; with mostly-skipped slow entities the bus stays well under saturated even at 1s base

Disclosure

Drafted with Claude (Anthropic). Author-reviewed.

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>
@malaiwah malaiwah mentioned this pull request Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Increase speed

1 participant