JaccoR / hass-entso-e

Integration for Home Assistant to fetch day ahead energy prices from European countries via ENTSO-e Transparency Platform
159 stars 25 forks source link

After upgrading to HA 2024.4.0 no prices where retreived #150

Open sstolk90 opened 3 months ago

sstolk90 commented 3 months ago

I did reset my password @ Entsoe and my API key to be sure. It shows this after reloading it all. It has the prices of yesterday and the 3rd of April but after reloading the 5th is not showing up: image I've installed the update around 22:00

StreborStrebor commented 3 weeks ago

I only needed to clear this object (including all the nested today and tomorrow prices that seemed to be stuck since 6 days ago): sensor.[your entso-e config name]_average_electricity_price_today Prices and graphs filled almost immediately after starting hass again.

Can you say how to clear the object including the nested today and tomorrow prices?

Sure,

SSH into your HASS Shut down HASS with ha core stop Make a backup of the state config file cp config/.storage/core.restore_state config/.storage/core.restore_state.bak Edit it: nano config/.storage/core.restore_state

Remove this segment starting with the {

      "state": {"entity_id":"sensor.[your entso-e config name]_average_electricity_price_today","state":"0.26295","attributes":{"state_class":"measurement","prices_today":[{"time":"2024-06-14 00:00:00+02:00","price":0.25825},{"time":">
      "extra_data": {
        "native_value": 0.26295,
        "native_unit_of_measurement": null,
        "_attr_extra_state_attributes": {
          "prices_today": [
            {
              "time": "2024-06-14 00:00:00+02:00",
              "price": 0.25825
            },
            {
              "time": "2024-06-14 01:00:00+02:00",
              "price": 0.24494
            },

...cut to keep this readably short...

            {
              "time": "2024-06-14 23:00:00+02:00",
              "price": 0.3043
            }
          ],
          "prices_tomorrow": [],
          "prices": [
            {
              "time": "2024-06-13 00:00:00+02:00",
              "price": 0.29839
            },

...cut to keep this readably short...

            {
              "time": "2024-06-14 22:00:00+02:00",
              "price": 0.30842
            },
            {
              "time": "2024-06-14 23:00:00+02:00",
              "price": 0.3043
            }
          ]
        }
      },
      "last_seen": "2024-06-14T07:15:22.322960+00:00"
    },

Restart HASS with ha core start

TheLion commented 3 weeks ago

I didn't upgrade and I had implemented Martin's fix, still broke. Trying to clear config/.storage/core.restore_state entries now... Update: Clearing the entries from core.restore_state worked.

I only needed to clear this object (including all the nested today and tomorrow prices that seemed to be stuck since 6 days ago): sensor.[your entso-e config name]_average_electricity_price_today

Prices and graphs filled almost immediately after starting hass again.

Clearing this one object solved the issue for me.

Hopefully there will be a fix soon, that fixes it permanently ;-)

DannyOosterveer commented 3 weeks ago

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

JaySea77 commented 3 weeks ago

Sure,

SSH into your HASS Shut down HASS with ha core stop Make a backup of the state config file cp config/.storage/core.restore_state config/.storage/core.restore_state.bak Edit it: nano config/.storage/core.restore_state

Remove this segment starting with the {

where should the config dir be? I managed to get the ha core to stop, but I cannot find the file you are refering to.

Found it on mnt/data/supervisor/homeassistant/.storage/core.restore_state I removed the entire block starting with the line after prices_today since I didn't know which { you were referring to.

Edit2: the data filled up a few minutes after the removing the data from core.restore_state. Thanks for pointing this out.