Tmbao / amberelectric-usages

MIT License
5 stars 1 forks source link

Failing to load intergration #5

Closed gheydon closed 4 months ago

gheydon commented 4 months ago

Hi,

I have installed this integration on a newly commissioned amber site and I am getting the following error. The site only has 2 days worth of data, so I am not sure if this is a problem or if it is something else.

This is the error message I am getting.

This error originated from a custom integration.

Logger: custom_components.amberelectric_usages Source: helpers/update_coordinator.py:315 integration: Amber Electric - Usages (documentation, issues) First occurred: 11 May 2024 at 16:16:27 (944 occurrences) Last logged: 13:15:57

Unexpected error fetching amberelectric_usages data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/amberelectric_usages/coordinator.py", line 82, in _async_update_data await self._insert_usage_statistic(usages_by_hour_by_channel) File "/config/custom_components/amberelectric_usages/coordinator.py", line 132, in _insert_usage_statistic async_add_external_statistics(self._hass, metadata, statistics) File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2251, in async_add_external_statistics raise HomeAssistantError("Invalid statistic_id") homeassistant.exceptions.HomeAssistantError: Invalid statistic_id

Tmbao commented 4 months ago

Hi @gheydon this sounds similar to #4 , could you try the workaround to use only lower cases in the name when you add the integration.

gheydon commented 4 months ago

Thanks, that fixed it.