v2.0.6
Bug-fix release covering unload/reload safety, energy-sensor accuracy, and websocket log noise. No config or entity changes — safe to update in place.
Fixed
- Panel total Amps didn't match Leg 1 + Leg 2. The panel's total "Amps" sensor summed a de-duplicated per-breaker current value (correct for a single 2-pole breaker, where both legs of a 240V circuit carry the same physical current), while "Amps Leg 1"/"Amps Leg 2" summed the raw per-leg readings. Every 2-pole breaker was effectively counted once in the total but twice across the two leg sensors, so panels with 2-pole breakers showed
Leg 1 + Leg 2 > Amps. Total Amps is now computed the same way Watts already was — as the sum of both legs — soAmps == Amps Leg 1 + Amps Leg 2always holds. - Unload could strand entities on a dead coordinator. If platform unload failed, the integration was already shutting down its data connection — entities would go stale until a full HA restart. The coordinator now only shuts down after a confirmed successful unload.
- A single malformed panel response could break the whole poll cycle. Missing voltage fields from one offline/partial panel raised an uncaught error that skipped every other panel in that batch instead of just the broken one.
- CT current could be silently cut in half. Single-leg CT clamps were unconditionally averaged as if they were two-leg (240V) circuits, halving the real reading. CTs now only average when a genuine second leg is reported.
- Daily energy sensor could freeze at a stale, too-high value. A same-day correction of more than ~50% was mistaken for hardware jitter and the old (wrong) reading was held instead of the corrected one.
- Lifetime energy total had no sanity cap. A host clock jump (e.g. NTP resync) during a data gap could inject an implausible one-time energy spike into the lifetime (Energy dashboard) counter with no way to recover. All power×time accumulation is now bounded per update.
- Websocket "Cannot write to closing transport" warnings in the HA log. Disabled permessage-deflate compression on the Leviton websocket connection — it routed sends through an internal background task that could leak an unhandled error into the log if the connection was torn down mid-send (e.g. during a reload). Sends are tiny JSON messages, so there's no bandwidth cost to this.
Changed
- Replaced a private/internal Home Assistant API (
hass.data["entity_components"]) used by thereset_energy_baselineandreset_panel_energyservices with the stable public entity-platform lookup, for forward compatibility with future HA core versions. - Login rate limiting is now safe under concurrent config entries (multiple panels/accounts reloading at once could previously both bypass the intended 10s wait).
- Daily-sensor restart behavior is now consistent between breaker and CT sensors — both start with a fresh baseline after HA restarts instead of one of them extrapolating energy across the downtime window.
- Restored daily-sensor values from the recorder are now clamped to a sane range on startup.
Internal
- Fixed a couple of asyncio bugs in the websocket keepalive loop (fire-and-forget tasks without a kept reference, a debounce-timer re-arm race during shutdown) that were latent but not user-visible.