hass-entso-e
hass-entso-e copied to clipboard
ApexChart Graph suddenly empty and average sensor error in log
Suddenly my ApexChart graphs stay empty. I have played a bit with the yAxis min setting, but changed that one back to original.
But I do not have any graph anymore. I changed everything back to original. This is the code of the card:
type: custom:apexcharts-card
graph_span: 24h
span:
start: day
now:
show: true
label: Now
header:
show: true
title: Electriciteitsprijzen Vandaag (€/kwh)
yaxis:
- decimals: 2
series:
- entity: sensor.average_electricity_price_today
stroke_width: 2
float_precision: 3
type: column
opacity: 1
color: ''
data_generator: |
return entity.attributes.prices.map((entry) => {
return [new Date(entry.time), entry.price];
});
Than I noticed in the logs that the sensor.average_electricity_price_today could not be found.
I do have the sensor.dynamische_energieprijzen_average_electricity_price_today So I changed the code to:
type: custom:apexcharts-card
graph_span: 24h
span:
start: day
now:
show: true
label: Now
header:
show: true
title: Stroomprijs vandaag (€/kWh)
series:
- entity: sensor.dynamische_energieprijzen_average_electricity_price_today
stroke_width: 2
float_precision: 3
type: column
opacity: 1
color: ''
data_generator: |
return entity.attributes.prices.map((record, index) => {
return [record.time, record.price];
});
yaxis:
- id: Prijs
decimals: 2
min: 0
But the graphs still stay empty. I have waited a whole night and I have waited till the next polling moment.
In the log files I have found this:
Deze fout is ontstaan door een aangepaste integratie.
Logger: homeassistant.helpers.entity
Source: custom_components/entsoe/coordinator.py:213
Integration: ENTSO-e Transparency Platform (documentation, issues)
First occurred: 14:00:00 (1 occurrences)
Last logged: 14:00:00
Update for sensor.dynamische_energieprijzen_average_electricity_price_today fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 559, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in async_device_update
await self.async_update()
File "/config/custom_components/entsoe/sensor.py", line 134, in async_update
self._attr_extra_state_attributes = {x: self.coordinator.processed_data()[x] for x in self.coordinator.processed_data() if x not in invalid_keys and x not in existing_entities}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/entsoe/coordinator.py", line 171, in processed_data
"min_price": self.get_min_price(filtered_hourprices),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/entsoe/coordinator.py", line 213, in get_min_price
return min(hourprices.values())
^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: min() arg is an empty sequence
I have exactly the same problem:
2023-07-04 08:00:00.821 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.anwb_average_electricity_price_today fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 559, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in async_device_update
await self.async_update()
File "/config/custom_components/entsoe/sensor.py", line 134, in async_update
self._attr_extra_state_attributes = {x: self.coordinator.processed_data()[x] for x in self.coordinator.processed_data() if x not in invalid_keys and x not in existing_entities}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/entsoe/coordinator.py", line 171, in processed_data
"min_price": self.get_min_price(filtered_hourprices),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/entsoe/coordinator.py", line 213, in get_min_price
return min(hourprices.values())
^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: min() arg is an empty sequence
I have exactly the same problem:
2023-07-04 08:00:00.821 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.anwb_average_electricity_price_today fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 559, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in async_device_update await self.async_update() File "/config/custom_components/entsoe/sensor.py", line 134, in async_update self._attr_extra_state_attributes = {x: self.coordinator.processed_data()[x] for x in self.coordinator.processed_data() if x not in invalid_keys and x not in existing_entities} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/entsoe/coordinator.py", line 171, in processed_data "min_price": self.get_min_price(filtered_hourprices), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/entsoe/coordinator.py", line 213, in get_min_price return min(hourprices.values()) ^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: min() arg is an empty sequence
Yes, your graph looks exactly as min, only the first bar is visible! When did this start for you, also since one day?
Yes, your graph looks exactly as min, only the first bar is visible! When did this start for you, also since one day?
Yep, since one day.
Since Sunday i didn’t get new data from Api. So all empty now.
Same issue here. Empty graphs
Same issue here.
My chart is working again! Without changing anything btw.
Apparently the entsoe api has a new version. See https://transparency.entsoe.eu/content/static_content/Static%20content/web%20api/Guide.html)
So the creator of this plugin should implement this change aswell
It's also working here now..strange
It really is strange, for me it is still not working, even after a reboot.... unfortunatelly...
Having the same problem here. Still empty after 2 days. Also got a new API code but it is still not working. Following this.
The data contained in sensor.entso_average_electricity_price_today is from juli 2, seems to be stuck at that date, does not update.
Same issue here. The graph data stored in the attributes of the average_electricity_price_today got last updated on July 2 (including the data for July 3). On Monday July 3, the attributes where not updated in the afternoon (so no "tomorrow" data). On Tuesday July 4 there was no sensor data between 0:00 until 9:00. Since Tuesday 9:00 the sensor data like current electricity price is being updated, but the average_electricity_price_today attributes still contain the data for July 2 and 3.
I am having the same issue for several days. This is what I have found in logs:
Logger: custom_components.entsoe.sensor Source: custom_components/entsoe/sensor.py:128 Integration: ENTSO-e Transparency Platform (documentation, issues) First occurred: July 5, 2023 at 16:51:41 (15 occurrences) Last logged: 11:20:53
Unable to update entity due to data processing error: None and error: min() arg is an empty sequence Unable to update entity due to data processing error: None and error: unsupported operand type(s) for /: 'NoneType' and 'float'
Remove old entso-e entry and creat new one with slightly different name solves the issue. Don't forget to adjust the new entity names in your apexchart.
Remove old entso-e entry and creat new one with slightly different name solves the issue. Don't forget to adjust the new entity names in your apexchart.
For me, that did the trick!
Same here, thanks everyone :D
I just explained it... Are you sure you're in the right place?
I just explained it...
Hardly, but that happens when you're looking at it from differend angles. Sometimes ppl need a little more direction than just "remove this and add that".
Are you sure you're in the right place?
yeah, pretty sure i am.
Doesn't matter anyways, i already figured it out.
I am one that need more info. What do I delete? Energyzero or anwb entso-e. Integration? Or something else. Help would be appreciated for a newbie
Yesterday I have removed the "stuck" entry from the ENTSO-e integration and created a new one (or two actually). The new one immediately filled with up-to-date data and was again updated this afternoon as it used to work before! Thanks for the solution RogMoe!
I am one that need more info. What do I delete? Energyzero or anwb entso-e. Integration? Or something else. Help would be appreciated for a newbie
Step 1: Go to the devices & services screen and open up the entso-e module. Now under “integration entities” add a new entry. Make sure you name it something that you remember. I used “energy” but feel free to choose any name.
Step 2:
Go to your chart and replace the current sensor entry (which should be something like “sensor.entsoe_average_electricity_price_today”) with “sensor.
The chart should fill up again.
Thanks that is what i needed. Works. Great thanks
It worked for me too, but what is/was the cause of this issue? Is it a bug in the integration or did the transparency platform cause this and if so why did the integration not recover by it self?
I'm not sure, but I think it's within HA or its database. Apexchart works, so does entso-e. What remains is HA. I spent one hour looking for the glitch, but desided not to waiste more time on it. Deleting/re-creting/editing instances takes 3 minutes.
This is a quite persistent and annoying error. I've been using the integration for over two years. Everytime the ENTSO-e API had some error, and there is no data available for some time, the integration seems to corrupt the data in sensors. Even after the data in the API is correct again, you can't use the previous sensors anymore. You'll have to delete the integration, add it again and change all our automations etc. Probably some better error handling is necessary when receiving empty or wrong data from the API...
I also keep having it....
v0.4.0 is released this version contains fixes that solve a lot of warnings and known issues. This issue is probably also solved. Please update to the latest version. Closing this issue for now. If you still have issue please feel free to open a new issue.
v0.4.0 is released this version contains fixes that solve a lot of warnings and known issues. This issue is probably also solved. Please update to the latest version. Closing this issue for now. If you still have issue please feel free to open a new issue.
Thanks for the fix! One day to the next, my graph stopped working and the dynamic energy prices from ENTSO-e stopped showing. After the update everything worked again. I had this problem before and then I had to reset all the sensors, not a very big problem, but not really convenient.