After upgrading to Home Assistant 2024.12+, the integration throws a RuntimeError when importing historical statistics. The error indicates that
mean_type parameter is not specified when calling async_import_statistics.
Additionally, warnings appear: found some weird values in historical statistics
To Reproduce
- Install ha-ideenergy via HACS
- Configure integration with valid i-DE credentials
- Wait for data refresh
- Check logs - see RuntimeError
Logs
2025-12-11 14:53:55.248 WARNING (MainThread) [custom_components.ideenergy.sensor] sensor.es0021000001395653px_historical_consumption: found some weird
values in historical statistics
2025-12-11 14:53:55.264 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 192, in report_usage
...
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 388, in _report_usage_no_integration
raise RuntimeError(msg) from err
RuntimeError: Detected code that doesn't specify mean_type when calling async_import_statistics. Please report this issue
2025-12-11 14:53:55.624 WARNING (MainThread) [custom_components.ideenergy.sensor] sensor.es0021000001395653px_historical_generation: found some weird
values in historical statistics
Environment
- HomeAssistant version: 2024.12.x (check your version in Settings → About)
- ideenergy integration version: 2025.2.0
- Installation method: HACS
- i-de.es advanced user: yes
- Did I read the FAQ: yes
- Did I enable debug before posting any log: yes
Expected behavior
Historical statistics should be imported without errors.
Additional context
This appears to be a breaking change in Home Assistant's statistics API. The async_import_statistics function now requires a mean_type parameter.
After upgrading to Home Assistant 2024.12+, the integration throws a RuntimeError when importing historical statistics. The error indicates that
mean_type parameter is not specified when calling async_import_statistics.
Additionally, warnings appear: found some weird values in historical statistics
To Reproduce
Logs
2025-12-11 14:53:55.248 WARNING (MainThread) [custom_components.ideenergy.sensor] sensor.es0021000001395653px_historical_consumption: found some weird
values in historical statistics
2025-12-11 14:53:55.264 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 192, in report_usage
...
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 388, in _report_usage_no_integration
raise RuntimeError(msg) from err
RuntimeError: Detected code that doesn't specify mean_type when calling async_import_statistics. Please report this issue
2025-12-11 14:53:55.624 WARNING (MainThread) [custom_components.ideenergy.sensor] sensor.es0021000001395653px_historical_generation: found some weird
values in historical statistics
Environment
Expected behavior
Historical statistics should be imported without errors.
Additional context
This appears to be a breaking change in Home Assistant's statistics API. The async_import_statistics function now requires a mean_type parameter.