home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.06k stars 29.72k forks source link

Tibber integration unable to connect #84997

Closed magnushegge closed 1 year ago

magnushegge commented 1 year ago

The problem

Unable to get data from the Tibber API since 18:00 on January 1st.

Possibly related to this breaking change in the Tibber API? https://developer.tibber.com/docs/overview#breaking-websocket-change

What version of Home Assistant Core has the issue?

2022.12.8

What was the last working version of Home Assistant Core?

2022.12.8

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Tibber

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tibber/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: tibber
Source: runner.py:120
First occurred: December 31, 2022 at 05:07:10 (3886074 occurrences)
Last logged: 18:49:14

Timed out when connecting to Tibber
Error connecting to Tibber, resp code: 428

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @danielhiversen, mind taking a look at this issue as it has been labeled with an integration (tibber) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `tibber` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tibber` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


tibber documentation tibber source (message by IssueLinks)

Danielhiversen commented 1 year ago

Timed out when connecting to Tibber

Tibber API has lately been unstable, and this is an issue at Tibber.

Error connecting to Tibber, resp code: 428

This means that you are rate limited by Tibber. Could you try to fetch data at https://developer.tibber.com/explorer from the same external IP as your HA instance?

magnushegge commented 1 year ago

Using the explorer from the same IP and API key i get the resulting message: "Network error: Failed to fetch"

The integration has been working stable since July 2021.

I did move my electricity subscription away from Tibber in the start of December 2022 and as expected all price and billing entities went unavailable from the date of transfer but the energy meter data from Tibber Pulse has remained available up until now.

Danielhiversen commented 1 year ago

You should contact Tibber, and ask why the API explorer is not working.

Appendit commented 1 year ago

Using the same API Token in the API Explorer i get all the data, but in Homeassistant i get the following error and the sensors are unavailable (XXX XXX is changed by me as the Name is not important)

Logger: homeassistant.components.tibber.sensor Source: components/tibber/sensor.py:630 Integration: Tibber (documentation, issues) First occurred: 00:16:00 (1 occurrences) Last logged: 00:16:00 Unexpected error fetching Tibber XXX XXX data: 'tibber:energy_consumption_e663afd4e50448e1a71370dd4310f5b4'

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/tibber/sensor.py", line 573, in _async_update_data await self._insert_statistics() File "/usr/src/homeassistant/homeassistant/components/tibber/sensor.py", line 630, in _insert_statistics _sum = stat[statistic_id][0]["sum"] KeyError: 'tibber:energy_consumption_e663afd4e50448e1a71370dd4310f5b4'

magnushegge commented 1 year ago

It would seem as if i was temporarily IP-banned. The API explorer worked with my key from a different IP address. I disabled the HA Tibber integration for a while, and eventually I got access to the API again. I have 3 addresses listed under Homes in Tibber's API Explorer allthough I only ever had 2 subscriptions (the third is just added as an address in the Tibber app).

It has been like this for over a year, so I am not sure why it seems as I might have hit the rate limit. Perhaps if the API went unstable for a while, the HA Integration might have been hammering to get back in?

Danielhiversen commented 1 year ago

HA Integration might have been hammering to get back in?

It should not. Great that it now is solved

magnushegge commented 1 year ago

It should not but the log error message has a lot of occurrences for the period it was down. First log occurrence on december 31 05:07 and on january 2nd 18:49 it had received nearly 3,9 million error messages.

Logger: tibber Source: runner.py:120 First occurred: December 31, 2022 at 05:07:10 (3886074 occurrences) Last logged: 18:49:14

Timed out when connecting to Tibber Error connecting to Tibber, resp code: 428

Kristoffer99 commented 1 year ago

Have the same error with the latest ha version installed. Have tried to disable tibber and enable after a day but still same problem. Any idea of what to do?