jobvk / Home-Assistant-Windcentrale

Provides Home Assistant sensors for multiple wind turbines from the Windcentrale
https://jobvankoeveringe.com/projects/windcentrale/
Apache License 2.0
14 stars 3 forks source link

Unexpected high sensor.de_jonge_held_energy_shares value #73

Closed abko closed 1 year ago

abko commented 1 year ago

Checklist

The problem

Sometimes I experience a very high value for this property, leading to the Energy dashboard showing a huge peak of production, while this did not happen.

It happened just today, while windcentrale is even having an error, reporting no energy production.

It can be fixed by adjusting the statistics via developer tools (note I screwed up making screenshots before fixing it, so this is a manual adjustment to show the same).

image

I am not sure if it's related to this log entry: `Logger: homeassistant.components.sensor Source: custom_components/windcentrale/sensor.py:235 Integration: Sensor (documentation, issues) First occurred: 13:56:40 (2 occurrences) Last logged: 13:56:40

Error adding entities for domain sensor with platform windcentrale Error while setting up windcentrale platform for sensor Traceback (most recent call last): File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities await asyncio.gather(*tasks) File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity await entity.add_to_platform_finish() File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 788, in add_to_platform_finish await self.async_added_to_hass() File "/home/homeassistant/.homeassistant/custom_components/windcentrale/sensor.py", line 235, in async_added_to_hass self.attr[week] = state.attributes[week] KeyError: 'Week 0' `

What is version of Home Assistant Core did you recieve the bug?

Home Assistant 2022.12.8 Frontend 20221213.1 - latest

What is version of Home Assistant Supervisor did you recieve the bug?

Home Assistant 2022.12.8 Frontend 20221213.1 - latest

What is version of Home Assistant Supervisor?

Home Assistant 2022.12.8 Frontend 20221213.1 - latest

What is version of the Windcentrale integration?

0.2.6

Example Code snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.sensor Source: custom_components/windcentrale/sensor.py:235 Integration: Sensor (documentation, issues) First occurred: 13:56:40 (2 occurrences) Last logged: 13:56:40

Error adding entities for domain sensor with platform windcentrale Error while setting up windcentrale platform for sensor Traceback (most recent call last): File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities await asyncio.gather(*tasks) File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity await entity.add_to_platform_finish() File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 788, in add_to_platform_finish await self.async_added_to_hass() File "/home/homeassistant/.homeassistant/custom_components/windcentrale/sensor.py", line 235, in async_added_to_hass self.attr[week] = state.attributes[week] KeyError: 'Week 0'

Additional information

I have seen it in total 3-4 times since I run the integration (about 2 months)

abko commented 1 year ago

This is the effect on the Energy dashboard when it happens:

image
jobvk commented 1 year ago

Let me know if you still have the problem after today

abko commented 1 year ago

I have not since it since the API started working again. Will post it here when it happens again.

jobvk commented 1 year ago

If you want to fix your energy dashboard I removed statistics from the database to fix this problem. I made some instructions https://github.com/jobvk/Home-Assistant-Windcentrale/discussions/76