Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApexChart Graph suddenly empty and average sensor error in log #127

Closed
TheBrankman opened this issue Jul 4, 2023 · 29 comments
Closed

ApexChart Graph suddenly empty and average sensor error in log #127

TheBrankman opened this issue Jul 4, 2023 · 29 comments

Comments

@TheBrankman
Copy link

TheBrankman commented Jul 4, 2023

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

@VictorvandenHoven
Copy link

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

image

@TheBrankman
Copy link
Author

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

image

Yes, your graph looks exactly as min, only the first bar is visible!
When did this start for you, also since one day?

@VictorvandenHoven
Copy link

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.

@morini1
Copy link

morini1 commented Jul 4, 2023

Since Sunday i didn’t get new data from Api. So all empty now.

@Axalian215
Copy link

Same issue here. Empty graphs

@Tim16200
Copy link

Tim16200 commented Jul 4, 2023

Same issue here.

@VictorvandenHoven
Copy link

My chart is working again!
Without changing anything btw.

@Axalian215
Copy link

Axalian215 commented Jul 4, 2023

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

@Axalian215
Copy link

It's also working here now..strange

@TheBrankman
Copy link
Author

It really is strange, for me it is still not working, even after a reboot.... unfortunatelly...

@PV-Web
Copy link

PV-Web commented Jul 5, 2023

Having the same problem here. Still empty after 2 days. Also got a new API code but it is still not working. Following this.

@jjvandenberg
Copy link

jjvandenberg commented Jul 5, 2023

The data contained in sensor.entso_average_electricity_price_today is from juli 2, seems to be stuck at that date, does not update.

@PeterPasmans
Copy link

PeterPasmans commented Jul 5, 2023

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.

@Zakarumit
Copy link

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'

@RogMoe
Copy link

RogMoe commented Jul 6, 2023

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.

@TheBrankman
Copy link
Author

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!

@ajouwens
Copy link

ajouwens commented Jul 6, 2023

Same here, thanks everyone :D

@RogMoe
Copy link

RogMoe commented Jul 7, 2023

I just explained it...
Are you sure you're in the right place?

@marcel-st
Copy link

marcel-st commented Jul 7, 2023

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.

@Ronm10
Copy link

Ronm10 commented Jul 7, 2023

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

@PeterPasmans
Copy link

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!

@marcel-st
Copy link

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._average_electricity_price_today”

The chart should fill up again.

@Ronm10
Copy link

Ronm10 commented Jul 7, 2023

Thanks that is what i needed. Works. Great thanks

@schellekensonline
Copy link

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?

@RogMoe
Copy link

RogMoe commented Jul 8, 2023

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.

@DannyOosterveer
Copy link

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...

@mourmeer
Copy link

I also keep having it....

@Roeland54
Copy link
Collaborator

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.

@LenFaki
Copy link

LenFaki commented Sep 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests