Bug Fix: Memory Leak Crash for IP-Serial PVS Devices
Release Date: March 27 2026
Type: Bug fix
What's Fixed
Home Assistant crashes after ~31 hours when PVS serial is an IP address
When a PVS reports an IP address as its serial number, the integration fell back to generating a virtual meter entity name using int(time.time()) as a suffix. Since this runs on every poll cycle, each poll created a brand-new HA entity with a unique name. HA's entity registry, device registry, and statistics database grew without bound until Home Assistant ran out of memory and crashed.
One affected user accumulated 7,839 phantom devices, 62,704 phantom entities, and 6.3 GB of RAM usage before Home Assistant terminated with a segmentation fault.
The fix replaces the timestamp suffix with a fixed _virtual suffix. The virtual meter serial is now virtual_production_meter_meter_virtual, stable across restarts and poll cycles.
Recovery for Affected Users
If you have been running the integration with an IP-serial PVS and Home Assistant has been slow or crashing, you likely have a large number of orphaned entities. After updating:
- Check Settings, Entities in Home Assistant and filter for entities matching
virtual_production_meter_meter_followed by a number. Remove any you find. - Optionally restart Home Assistant to reclaim memory.
The phantom entities will stop accumulating immediately after the update.
Who Is Affected
Only installations where the PVS reports an IP address as its serial number rather than a hardware serial (e.g. ZT2228...). The normal path was not affected.
Upgrade Notes
- Standard HACS update or manual file copy, restart Home Assistant
- No configuration changes required
Credits
Thanks to @joshchiou for identifying the root cause and submitting the fix (PR #64).