Skip to content

Add configurable reporting interval#15

Open
poolski wants to merge 5 commits into
azebro:mainfrom
poolski:configurable-reporting-interval
Open

Add configurable reporting interval#15
poolski wants to merge 5 commits into
azebro:mainfrom
poolski:configurable-reporting-interval

Conversation

@poolski
Copy link
Copy Markdown

@poolski poolski commented Apr 16, 2026

Context

Because the TAP emits a packet every time one of the optimizers sends an update, there is no way to know the volume of events on the wire ahead of time. During periods of low activity (i.e. at night), there's not a lot of activity on the wire.

In the morning/throughout the day, however, I was finding that the sheer volume of events from my 13 panels (which isn't all that much) was causing a huge amount of CPU and IO overhead on my Home Assistant machine, to the point where the frontend was disconnecting and timing out.

My Home Assistant instance is no slouch:
CPU: 12-core Intel(R) Core(TM) i7-10710U,
RAM: 32GB RAM
Storage: 512GB NVMe SSD
HAOS is running on bare metal.

The sheer volume of events that PyTAP was processing from the wire was causing issues, which was a bit unexpected.

Proposed solution

After having a bit of a poke through the code, I added a reporting interval setting to the coordinator (and wired that through the setup screens). I'd imagine few people want down-to-the-second resolution for their panel/TS4 telemetry, so my thinking is that an average of the values across reporting_interval is a reasonable compromise.

The updated implementation

  1. buffers the packets it sniffs from the wire for a period of time up to reporting_interval
  2. decodes and buckets each metric by node ID (barcode) and for each node (including totals/per-string/etc)
  3. computes the average metric value for each bucket
  4. writes the metrics out to Home Assistant
  5. resets the timer and begins again

This approach also makes things like ApexCharts much more responsive. By default, ApexCharts loads all data points for a given series, so frequent state updates result in even simple charts with one series being sluggish.

By spacing the state updates out a bit more and having the option to customise the reporting interval (5-300s seems plenty big a range) people can tune their PyTAP setup to their particular needs.

UI Changes

image PixelSnap 2026-04-16 at 17 06 35@2x

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.

1 participant