core icon indicating copy to clipboard operation
core copied to clipboard

Tibber sensors not available after startup

Open ztamas83 opened this issue 2 years ago • 32 comments

The problem

Sensor data not provided upon startup and I also noticed random stops in the sensor data updates. At some point during the day the update can just stop.

I could investigate a bit around the startup but without more logs it's technically a black hole. I suggest adding debug logs to the integration in order to be able to catch problems.

What version of Home Assistant Core has the issue?

core-2022.10.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tibber

Link to integration documentation on our website

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

Diagnostics information

config_entry-tibber-c0650c76aecc1bf6170316a194f7fbe1.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

After setting up the sensors and notifications there are no updates.

2022-10-28 16:08:40.666 INFO (MainThread) [homeassistant.setup] Setting up tibber
2022-10-28 16:08:40.675 INFO (MainThread) [homeassistant.setup] Setup of domain tibber took 0.0 seconds
2022-10-28 16:08:41.191 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: tibber, upnp
2022-10-28 16:08:44.748 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.tibber
2022-10-28 16:08:54.667 INFO (MainThread) [homeassistant.components.notify] Setting up notify.tibber

At this stage I can reload the Tibber integration and the updates eventually start happening:
2022-10-28 16:15:33.531 INFO (MainThread) [homeassistant.components.notify] Setting up notify.tibber
2022-10-28 16:15:39.786 DEBUG (MainThread) [homeassistant.components.tibber.sensor] Manually updated xxxxxx data

Additional information

In general I miss logging from the integration. There are many points in the code where debug info could be printed in order to identify where the setup flow stops.

ztamas83 avatar Oct 28 '22 14:10 ztamas83

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

home-assistant[bot] avatar Oct 28 '22 14:10 home-assistant[bot]

The updates are just stopping. There are zero logs that would indicate something is wrong. I wonder if it's the TibberRtDataCoordinator that hangs in some way, or the background tasks that would initiate the periodical calls that have problems. I noticed that the Easee related sensors also froze at around the same time, cannot confirm that it's related, but may be worth to mention. Again, no logs.

ztamas83 avatar Oct 31 '22 08:10 ztamas83

Duplicate of https://github.com/home-assistant/core/issues/81037 ?

Danielhiversen avatar Oct 31 '22 08:10 Danielhiversen

Duplicate of #81037 ?

Reading that ticket the symptoms are not the same but I cannot judge if the problem is the same. I still see the devices and entities and after a "Reload" of the integration the sensos updates are rolling again. As it seems I have no problem contacting the Tibber API. Judging from the update frequency (1/10 sec) it is 6 requests per minute, 30 requests for 5 minutes. That should be below the 100 requests / 5 minutes. If it was the Tibber rate limiting causing problems I would expect the sensor updates to be delayed and not completely stopped as APIs only limit temporarily. Too many ifs without logs :)

ztamas83 avatar Oct 31 '22 08:10 ztamas83

Further to this I don't see any indication of a 429 or other HTTP failure code when things stop.

ztamas83 avatar Oct 31 '22 09:10 ztamas83

Same for me. Reloading the integration works but it is really annoying...

cobch avatar Nov 01 '22 15:11 cobch

Same problem with the need to reload integration here. Furthermore some of my sensors are constantly missing: sensor.electricity_price sensor.monthly_peak_hour_consumption sensor.monthly_cost sensor.monthly_net_consumption sensor.time_of_max_hour_consumption

This is no good.

clas72 avatar Nov 01 '22 20:11 clas72

Same problem here. I'm using the Tibber integration to get data from Watty and several times a day the data stops updating and I need to reload the Tibber integration for it to start updating again. It started happening around a week ago. Running version 2022.10.5.

edit I also noticed that sometimes it starts updating by itself after not updating the data for a while (5-10 mins), but if it gets stuck longer a reload is required.

jyourstone avatar Nov 02 '22 06:11 jyourstone

Hi, I have the exact same problem and have 2 HA boxes and this seems to happen to both at the same time. Last night it happened around midnight. There are both problems at startup that it is necessary to load the Tibber integration again and that the software hangs after a while. Have the last version of HA on both.

GunnarAa avatar Nov 02 '22 09:11 GunnarAa

Same problem here. On two different systems. Problem is happening since a week ago. Just like others I have to reload the integration to get the updates again. I think this is happening randomly 2 or 3 times a day.

EenerNL avatar Nov 03 '22 09:11 EenerNL

I suspect what the problem is. Tibber says: "We have recently added a rate limit of 100 requests in 5 minutes per IP address to protect the API." I have problems when I use Iphone Tibber App in combination with my Home Assistant implementation. Some of your are using two Home Assistant implementations.

I assume that the App is using the Tibber API and we encounter a request overload on a per-user basis.

clas72 avatar Nov 03 '22 09:11 clas72

I suspect what the problem is. Tibber says: "We have recently added a rate limit of 100 requests in 5 minutes per IP address to protect the API." I have problems when I use Iphone Tibber App in combination with my Home Assistant implementation. Some of your are using two Home Assistant implementations.

I assume that the App is using the Tibber API and we encounter a request overload on a per-user basis.

This would explain part of the problem. But in my case I do not have a subscription so those sensors would not be created and updated periodically. Nor I expect the app to be so inefficient to exhaust the rate limit. As mentioned I don't see the 429 errors in my logs at all. The real time sensors work with websocket subscription, should not be affected by the http rate limiting. So the root cause is still a question. I do believe this issue is duplicate of #81037 and #76419 despite the scattered symptoms. In #76419 there's a workaround with an automation.

Whatever the root cause is for the problem I believe that a stable integration should recover by itself. For the 429 code there is the possibility to transmit rhe Retry-After header which Tibber could use to keep the clients backing off in a controlled way.

ztamas83 avatar Nov 03 '22 17:11 ztamas83

I am having the same issue. My CPU load also increases by 4x when the integration stops working. The only way to fix this is by relading the integration.

metrafonic avatar Nov 03 '22 19:11 metrafonic

I suspect what the problem is. Tibber says: "We have recently added a rate limit of 100 requests in 5 minutes per IP address to protect the API." I have problems when I use Iphone Tibber App in combination with my Home Assistant implementation. Some of your are using two Home Assistant implementations. I assume that the App is using the Tibber API and we encounter a request overload on a per-user basis.

This would explain part of the problem. But in my case I do not have a subscription so those sensors would not be created and updated periodically. Nor I expect the app to be so inefficient to exhaust the rate limit. As mentioned I don't see the 429 errors in my logs at all. The real time sensors work with websocket subscription, should not be affected by the http rate limiting. So the root cause is still a question. I do believe this issue is duplicate of #81037 and #76419 despite the scattered symptoms. In #76419 there's a workaround with an automation.

Whatever the root cause is for the problem I believe that a stable integration should recover by itself. For the 429 code there is the possibility to transmit rhe Retry-After header which Tibber could use to keep the clients backing off in a controlled way.

I totally agree. There is some negative use-case that is currently not implemented. I just gave you the root cause and a fix that seems to work fine: only use one implementation to access the Tibber API. It has work flawlessly for me for over a day now. Well flawlessly... I still miss 5 sensors in my integration, for some unknown reason.

Another solution is to get yourself an MQTT energy device and set up a Broker on your favourite appliance. That will be my upcoming approach when I leave the somewhat buggy Tibber.

clas72 avatar Nov 03 '22 21:11 clas72

I have the same problem. Tibber sensors become availible or stuck until the integration is restarted. Worked flawlessly before.

erik-bjork avatar Nov 04 '22 06:11 erik-bjork

Same here. I have two HA installations on separated sites with the same Tibber account. Almost every time both integrations stops simultaneously.

Fixes if I reload the integration but lately I have to restart the whole installation to get it running again.

Is there anything we can provide you with @Danielhiversen to better solve this issue? Log files or some other trace…

The integration is very much appreciated and my automations depend on knowing the current consumption and price.

dahl1632 avatar Nov 07 '22 06:11 dahl1632

Sorry, but I don't have time to prioritise this now

Danielhiversen avatar Nov 07 '22 07:11 Danielhiversen

Same here. I have two HA installations on separated sites with the same Tibber account. Almost every time both integrations stops simultaneously.

Fixes if I reload the integration but lately I have to restart the whole installation to get it running again.

Is there anything we can provide you with @Danielhiversen to better solve this issue? Log files or some other trace…

The integration is very much appreciated and my automations depend on knowing the current consumption and price.

do you still experience this problem? It looks like that the issue has been less frequent, if not gone..., since last Friday, 4/11. Can you check?

ztamas83 avatar Nov 07 '22 07:11 ztamas83

The issue was still here this morning for my instance.

cobch avatar Nov 07 '22 08:11 cobch

It seemed that last update of core 4 Nov gave an improvement but at midnight both boxes hung... Starting Tibber never works without a reload of this integration.

GunnarAa avatar Nov 07 '22 08:11 GunnarAa

Just happened for the third time this day. Now reloading doesn’t help anymore…..

EenerNL avatar Nov 07 '22 12:11 EenerNL

Just happened for the third time this day. Now reloading doesn’t help anymore…..

Same issue for me now. Reload does not work anymore.

bullas82 avatar Nov 07 '22 12:11 bullas82

Just happened for the third time this day. Now reloading doesn’t help anymore…..

Same here, reloading doesn't help.

Found this in the log:

Logger: graphql_subscription_manager Source: components/tibber/init.py:88 First occurred: 13:27:41 (3 occurrences) Last logged: 13:54:13 Websocket is closed.

If too many requests are the problem, is there a way we can limit the amount of requests?

jyourstone avatar Nov 07 '22 12:11 jyourstone

I have an automation that reloads the tibber integration if it has stale data for 5 minutes. Didn't fire once during the whole weekend, at around an hour ago it started firing up. No data is available after reload though, so it just loops every 5 minutes. Had to disable it.

mariusjell avatar Nov 07 '22 12:11 mariusjell

I have only 1 sensor left: sensor.electricity_price

rest is unavailable or unknown..

same log message as jyourstone

EenerNL avatar Nov 07 '22 13:11 EenerNL

Still not working even after restart of the whole HA server. Anyhow I did send an email to [email protected] today describing the problem and asked them to allocate a developer to help @Danielhiversen fix the problem. I think if a lot of us here continue to send them emails regarding the faulty integration in HA maybe they will respond?

Its a great integration and I think all of us can agree that we will help with whatever we can to get it working again.

The best would be if HA could connect locally to the pulse?

dahl1632 avatar Nov 07 '22 15:11 dahl1632

I have this issue too and it affects the history function of all other sensors. I just disabled the Tibber integration and the history of the other sensors were back/accessible again. Home Assistant 2022.11.1 Supervisor 2022.10.2 Operating System 9.3 Frontend-version: 20221102.1 - latest

LAPDragnet avatar Nov 07 '22 15:11 LAPDragnet

Stopped working after restart, tried restart many times but still nothing. Tibber App works fine

Schelin78 avatar Nov 07 '22 15:11 Schelin78

Just happened for the third time this day. Now reloading doesn’t help anymore…..

Same issue for me now. Reload does not work anymore.

Same issue here. Restarting the whole shebang does not help. Same "Websocket is closed." error as others have in the log.

olealm avatar Nov 07 '22 15:11 olealm

Same issue here, hope tibber takes this seriously as this integration is the only reason i use tibber.

StianHaugland1 avatar Nov 07 '22 16:11 StianHaugland1