Is your feature request related to a problem? Please describe.
When the Tesla Gateway is physically off-grid (or at night when solar is idle), the local API reports a tiny, persistent grid import—typically 1–5W, with 2W being very common. This persists for hours and accumulates in pypowerwall's vitals and aggregated data, skewing the daily “from grid” totals by ~50–100Wh even when the utility meter and the official Tesla app both confirm 0W grid usage.
This phantom load I believe is a known measurement artifact caused by CT sensor noise, but it pollutes the historical data stored by pypowerwall and any dashboard that depends on it (Home Assistant, Grafana, etc.). The only current workaround is a fragile manual patch of server.py or per-dashboard template filters, neither of which is source-level or persistent.
Describe the solution you'd like
Add an optional environment variable (e.g., PW_SITE_IMPORT_ZERO_THRESHOLD) that, when set to a positive integer, will force the proxy to report 0W for the site meter's instant_power whenever the absolute value is below that threshold.
For example:
ini
PW_SITE_IMPORT_ZERO_THRESHOLD=50 # default: 0 (disabled)
If the raw site.instant_power is +2W or -3W (an equally tiny export artifact), it would be clamped to 0W. Values above 50W would be passed through unmodified.
Describe alternatives you've considered
PW_NEG_SOLAR analogy: The proxy already has PW_NEG_SOLAR that zeros out negative solar readings. A mirror option for site import would feel very natural and consistent.
Downstream filtering: Template sensors in Home Assistant can mask the issue visually, but they leave the raw pypowerwall data dirty and don't fix the proxy’s own stats and exports.
Additional context
I believe this has been a recurring discussion in the Powerwall community for years (e.g., Whirlpool forums and various GitHub issues). The official Tesla app already suppresses these tiny values, so it’s reasonable for a local monitoring proxy to offer the same cleanup capability. A simple, configurable threshold would give users full control and keep their data spotless without fragile hacks.
Thank you for the amazing work on pypowerwall—this small addition would be hugely appreciated!
Is your feature request related to a problem? Please describe.
When the Tesla Gateway is physically off-grid (or at night when solar is idle), the local API reports a tiny, persistent grid import—typically 1–5W, with 2W being very common. This persists for hours and accumulates in pypowerwall's vitals and aggregated data, skewing the daily “from grid” totals by ~50–100Wh even when the utility meter and the official Tesla app both confirm 0W grid usage.
This phantom load I believe is a known measurement artifact caused by CT sensor noise, but it pollutes the historical data stored by pypowerwall and any dashboard that depends on it (Home Assistant, Grafana, etc.). The only current workaround is a fragile manual patch of server.py or per-dashboard template filters, neither of which is source-level or persistent.
Describe the solution you'd like
Add an optional environment variable (e.g., PW_SITE_IMPORT_ZERO_THRESHOLD) that, when set to a positive integer, will force the proxy to report 0W for the site meter's instant_power whenever the absolute value is below that threshold.
For example:
ini
PW_SITE_IMPORT_ZERO_THRESHOLD=50 # default: 0 (disabled)
If the raw site.instant_power is +2W or -3W (an equally tiny export artifact), it would be clamped to 0W. Values above 50W would be passed through unmodified.
Describe alternatives you've considered
PW_NEG_SOLAR analogy: The proxy already has PW_NEG_SOLAR that zeros out negative solar readings. A mirror option for site import would feel very natural and consistent.
Downstream filtering: Template sensors in Home Assistant can mask the issue visually, but they leave the raw pypowerwall data dirty and don't fix the proxy’s own stats and exports.
Additional context
I believe this has been a recurring discussion in the Powerwall community for years (e.g., Whirlpool forums and various GitHub issues). The official Tesla app already suppresses these tiny values, so it’s reasonable for a local monitoring proxy to offer the same cleanup capability. A simple, configurable threshold would give users full control and keep their data spotless without fragile hacks.
Thank you for the amazing work on pypowerwall—this small addition would be hugely appreciated!