Bug Fix: Stale Power Values at Night (Issue #41)
Release Date: 12-12-2025
Type: Bug fix + enhancements
What's New
Bug Fix: Stale Power Values at Night (NEW)
Fixed inverters showing non-zero power values when offline at night
- Previously: Cached inverters retained last production values (e.g., showing 1.7W at 11 PM)
- Now: Power-related fields automatically zeroed when inverters offline
- Affects: All inverter power, current, voltage, and frequency sensors
- Preserves: Lifetime production and temperature data remain accurate
Why this matters:
- Eliminates confusing "ghost production" in nighttime graphs
- Power dashboards now correctly show 0W when solar panels are offline
- Cached inverter structure preserved for entity stability
- Addresses user concern about misleading nighttime averages (Issue #41)
Bug Fix: Timestamp Accuracy
Fixed DATATIME timestamps to show actual PVS measurement time
- Previously: DATATIME showed when integration processed the data
- Now: DATATIME shows when PVS hardware actually measured the data
- Affects: Inverters, Meters, ESS/Battery devices, Transfer Switches
- Uses actual
msmtEpstimestamp from pypvs instead ofdatetime.utcnow()
Why this matters:
- Cache files now show accurate "last measured" timestamps
- Easier to diagnose stale data issues (Issue #39)
- Timestamps reflect PVS hardware timing, not integration processing timing
Enhancement: Last Reported Sensor (NEW)
Added "Last Reported" timestamp sensor for each inverter
- Shows when the PVS last measured data from each inverter
- Displays as relative time ("3 hours ago") automatically by Home Assistant
- Matches pvs-hass functionality for easy comparison
- Helps identify stale inverter data at a glance
Enhancement: Inverter Sensor Precision
Added 3 decimal precision to inverter sensors matching pvs-hass
- Lifetime Production: 3 decimals (2,329.650 kWh)
- Production Current: 3 decimals (0.005 A)
- MPPT Current: 3 decimals (0.035 A)
- Helps see precise values during low light conditions and tracks exact lifetime production
- Matches pvs-hass precision where they explicitly set 3 decimals
User Impact
Nighttime Power Display
- Inverter power sensors now correctly show 0W when panels are offline
- Eliminates "ghost production" in energy dashboards and graphs
- No action required - automatic sanitization when inverters go offline
- Lifetime production and temperature data remain accurate in cache
Timestamp Changes
- Your cache files and diagnostic data will now show accurate PVS measurement times
- No action required - timestamps will automatically reflect actual measurement times
- This is particularly useful when debugging stuck inverter issues
New Last Reported Sensor
- Each inverter gets a new "Last Reported" sensor showing measurement timestamp
- Displays as "3 hours ago" style relative time in HA UI
- Click the sensor to see actual date/time
- Helpful for identifying when inverter data becomes stale
Inverter Sensor Precision
- Lifetime production and current sensors now show 3 decimal places
- Provides better visibility into low current values (dawn/dusk, cloudy days)
- Shows exact lifetime production matching pvs-hass display
- No action required - display will automatically update
Upgrade Instructions
Automatic Update
- HACS Users: Standard HACS update process
- Manual Install: Copy updated files and restart Home Assistant
Recommended Actions
- Update anytime; no specific timing requirements
Technical Details
Files Modified:
__init__.py: Lines 516-553 - Added_sanitize_cached_inverter()function to zero power values__init__.py: Lines 991-995 - Modified cache restoration to sanitize inverter data at nightpypvs_converter.py: Lines 9, 111, 145, 210, 238 - Added timezone import and fixed DATATIME to use actuallast_report_datefrom pypvsconst.py: Lines 530, 556, 584 - Addedsuggested_display_precision: 3to lifetime production and current sensorsconst.py: Lines 605-613 - Added INVERTER_LAST_REPORTED timestamp sensorsensor.py: Line 293 - Addedsuggested_display_precisionparameter to SunPowerSensor.init()sensor.py: Lines 327-330 - Addedsuggested_display_precisionproperty to expose precision to Home Assistantsensor.py: Line 191 - Passsuggested_display_precisionfrom sensor config during entity creationsensor.py: Lines 363-378 - Added DATATIME string to datetime conversion for timestamp sensors
Issues Addressed:
- Issue #41 - Fixed stale power values showing in graphs when inverters offline at night
- Issue #39 - Improves diagnostic capability for stuck inverter debugging
For detailed documentation, see the README and TROUBLESHOOTING guides.