core icon indicating copy to clipboard operation
core copied to clipboard

Tibber integration failed after upgrade to 2024.9.3

Open droidgren opened this issue 1 year ago • 23 comments

The problem

After the update most Tibber entities do not show up. ( Is unavailable )

  • I have no power production installed.
  • I can see the data in the Tibber App so there is no problem in data feed.
  • Using Watty

What version of Home Assistant Core has the issue?

core-2024.9.3

What was the last working version of Home Assistant Core?

core-2024.8.3

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

home-assistant_tibber_2024-09-24T09-49-58.864Z.log config_entry-tibber-19db0f60a05e595f99e41682f2d02a2f.json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Error in rt_subscribe
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/tibber/home.py", line 461, in _start
    data = _add_extra_data(data)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tibber/home.py", line 419, in _add_extra_data
    live_data["lastMeterProduction"] = max(0, live_data["lastMeterProduction"])
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'NoneType' and 'int'

Additional information

https://github.com/home-assistant/core/issues/125312

droidgren avatar Sep 24 '24 09:09 droidgren

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 Renames 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.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tibber documentation tibber source (message by IssueLinks)

home-assistant[bot] avatar Sep 24 '24 09:09 home-assistant[bot]

Fixed in latest dev, and will be included in next release

Danielhiversen avatar Sep 24 '24 10:09 Danielhiversen

Ok, I was hoping that it was included in todays update

droidgren avatar Sep 24 '24 11:09 droidgren

Ohh, then it is not fixed

Danielhiversen avatar Sep 24 '24 12:09 Danielhiversen

I tried the work-around mentioned here. And now it works.

Neither of the solutions in this thread so far worked for me unfortunately. But I did manage to "solve" it by changing the following line in home.py:

live_data["lastMeterProduction"] = max(0, live_data["lastMeterProduction"])

to

live_data["lastMeterProduction"] = max(0, live_data["lastMeterProduction"] or 0)

This way, if lastMeterProduction is null, which seems to be the problem (at least for me), it defaults to 0.

droidgren avatar Sep 25 '24 06:09 droidgren

Still same issue here - Tibber not working with Core 2024.9.3 Supervisor 2024.09.1 Operating System 13.1 Frontend 20240909.1

hope that it is fixed with Core 2024.9.4

fraban avatar Sep 28 '24 13:09 fraban

Ok I solved - or its automatically solved after doing 2 Restarts of HA ... Hm - now it seems working again. Still with Core 2024.9.3 Supervisor 2024.09.1 Operating System 13.1 Frontend 20240909.1

  • thx

fraban avatar Sep 29 '24 09:09 fraban

For me it works fine with 2024.9.4. This obviously doesn't mean that this bug is invalid, it just means that I can't reproduce it, which is very likely caused by the data, Tibber API gives you vs. the data, Tibber API gives me when queried.

Your suggested fix would need to be applied in https://github.com/Danielhiversen/pyTibber. I of course can create a PR there applying your suggestion. However, as I can't properly test it, I'd suggest, you do that @droidgren.

nohn avatar Sep 29 '24 18:09 nohn

Since the fix was reported by me, I went ahead and created a PR in https://github.com/Danielhiversen/pyTibber.

jyourstone avatar Sep 30 '24 15:09 jyourstone

Still not solved with 2024.10.0

I only get 1 entity with corect data and that is Current price. I have tries my accesstoken in the developer area at tibber and i works fine to poll currentL1, currentL2, currentL3 that is not present for me in the integration.


Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/tibber/home.py", line 461, in _start
    data = _add_extra_data(data)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tibber/home.py", line 419, in _add_extra_data
    live_data["lastMeterProduction"] = max(0, live_data["lastMeterProduction"])
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'NoneType' and 'int'
2024-10-03 14:14:56.455 ERROR (MainThread) [tibber.home] Could not find consumption data.
2024-10-03 14:14:56.570 ERROR (MainThread) [tibber.home] Error in rt_subscribe
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/tibber/home.py", line 461, in _start
    data = _add_extra_data(data)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tibber/home.py", line 419, in _add_extra_data
    live_data["lastMeterProduction"] = max(0, live_data["lastMeterProduction"])
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'NoneType' and 'int'
2024-10-03 14:14:56.699 ERROR (MainThread) [tibber.home] Could not find production data.

R3ffoTz avatar Oct 03 '24 12:10 R3ffoTz

I don't think the recent changes in pyTibber has been released yet.

jyourstone avatar Oct 03 '24 12:10 jyourstone

Still not solved with 2024.10.0

I only get 1 entity with corect data and that is Current price. I have tries my accesstoken in the developer area at tibber and i works fine to poll currentL1, currentL2, currentL3 that is not present for me in the integration.


Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/tibber/home.py", line 461, in _start
    data = _add_extra_data(data)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tibber/home.py", line 419, in _add_extra_data
    live_data["lastMeterProduction"] = max(0, live_data["lastMeterProduction"])
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'NoneType' and 'int'
2024-10-03 14:14:56.455 ERROR (MainThread) [tibber.home] Could not find consumption data.
2024-10-03 14:14:56.570 ERROR (MainThread) [tibber.home] Error in rt_subscribe
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/tibber/home.py", line 461, in _start
    data = _add_extra_data(data)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tibber/home.py", line 419, in _add_extra_data
    live_data["lastMeterProduction"] = max(0, live_data["lastMeterProduction"])
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'NoneType' and 'int'
2024-10-03 14:14:56.699 ERROR (MainThread) [tibber.home] Could not find production data.

Same for me. I'm using Watty. Can that be why some are impacted and some not?

Goran129 avatar Oct 03 '24 12:10 Goran129

Same for me. I'm using Watty. Can that be why some are impacted and some not?

Watty for me as well.

R3ffoTz avatar Oct 03 '24 12:10 R3ffoTz

Same for me. Watty here

VamoS81 avatar Oct 03 '24 13:10 VamoS81

Watty here as well. No solar panels

skpgzamora avatar Oct 03 '24 16:10 skpgzamora

Had the same problem, tried restarting HA multiple times without success. Today I just reloaded the Service and it started working again, so maybe give that a try also (Restart Tibber Service)

SgtBBK avatar Oct 04 '24 05:10 SgtBBK

Same issue for me. And I am also using watty, No solar panels.

bullas82 avatar Oct 04 '24 06:10 bullas82

Same issue for me aswell, watty and no production.

antsve avatar Oct 04 '24 06:10 antsve

Had the same problem, tried restarting HA multiple times without success. Today I just reloaded the Service and it started working again, so maybe give that a try also (Restart Tibber Service)

Unfortunately didn't work, just 6 entities show up

skpgzamora avatar Oct 04 '24 08:10 skpgzamora

I tried with a Pulse and now it works fine. Watty must definetly be the problem.

R3ffoTz avatar Oct 10 '24 09:10 R3ffoTz

2024.10.2 and still Tibber don't work...

Goran129 avatar Oct 11 '24 21:10 Goran129

Same here, Watty with no solar and the sensors are unavailable.

niXta1 avatar Oct 12 '24 18:10 niXta1

It wont be fixed until next version of pyTibber is released and updated in Home assistant. So just wait.

droidgren avatar Oct 12 '24 18:10 droidgren

@Danielhiversen, would you be able to create a new release of pyTibber so it can be updated in Home Assistant and most likely solve this problem?

jyourstone avatar Oct 17 '24 18:10 jyourstone

Home Assistant Core 2024.10.2

Can confirm issues with Watty:

Error in rt_subscribe Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/tibber/home.py", line 461, in _start data = _add_extra_data(data) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/tibber/home.py", line 419, in _add_extra_data live_data["lastMeterProduction"] = max(0, live_data["lastMeterProduction"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: '>' not supported between instances of 'NoneType' and 'int'

epetwes avatar Oct 19 '24 06:10 epetwes