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

Tibber integration cannot connect #85042

Closed
02dag opened this issue Jan 3, 2023 · 26 comments
Closed

Tibber integration cannot connect #85042

02dag opened this issue Jan 3, 2023 · 26 comments
Assignees

Comments

@02dag
Copy link

02dag commented Jan 3, 2023

The problem

Since approx mid-November 2022 I havent had connection with tibber. The integration doesnt get data from Tibber.
I have tried the API explorer and that works ok.

I am on the latest core and HA OS.

I have tried reinstalling the integration several times. Last time today after upgrading to 2022.12.9.

What version of Home Assistant Core has the issue?

2022.12.9

What was the last working version of Home Assistant Core?

approx 2022.10.1

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tibber

Link to integration documentation on our website

https://github.com/home-assistant/core/tree/dev/homeassistant/components/tibber

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

This is from the debug log

2023-01-03 08:55:04.378 ERROR (MainThread) [tibber] Error connecting to Tibber, resp code: 500

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jan 3, 2023

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
Copy link
Member

Sorry, but no idea why the Tibber API returns resp code: 500 for you.
Nothing else in the logs?

@surfercool
Copy link

I would like to inform you that the old Api server ist moved to new one.
Monitoring - Websocket Server at api.tibber.com has been switched of as scheduled for December 2022. Please use the new server at websocket-api.tibber.com. For more information see https://developer.tibber.com

@SebSkarp
Copy link

SebSkarp commented Jan 4, 2023

I would like to inform you that the old Api server ist moved to new one. Monitoring - Websocket Server at api.tibber.com has been switched of as scheduled for December 2022. Please use the new server at websocket-api.tibber.com. For more information see https://developer.tibber.com

Yes so it seems this change kinda is breaking the integration. For me I still get a data from a few sensors within the integration.

Anyone knows if/how one needs to change anything within HA to make it work again? @Danielhiversen can you tell if the "breaking change" they announce on Tibber dev is the reason for the HA integration stopped working as of today (for me at least)?
Thanks

@AlfHou
Copy link

AlfHou commented Jan 4, 2023

The integration also broke for me. I'm managing two instances (parents), and it's broken in both. I can still see some entities such as sensor.electricity_price. Would also like if I need to make some changes.

@anhaff
Copy link

anhaff commented Jan 4, 2023

According to status.tibber.com:

"Websocket server at api.tibber.com has been switched off as scheduled for December 2022
Update - We are continuing to monitor for any further issues.
Jan 04, 2023 - 13:02 CET

Monitoring - Websocket server at api.tibber.com has been switched off as scheduled for December 2022. Please use the new server at websocket-api.tibber.com. For more info see https://developer.tibber.com/.

If you are running old version of Home Assistant, please upgrade to 2022.12 or later.
Jan 04, 2023 - 11:41 CET"

From 12:02 all entities became unavailable here. I run 2022.12.9

Checking just now: they are back

@02dag
Copy link
Author

02dag commented Jan 4, 2023

Well, is there anything we have to do to make it work again? configure the tibber integration to go to websocket-api.tibber.com? How do I do that?

Did this happen today? I have had problems since mid-november

@Danielhiversen Here is something else from the logs

Logger: homeassistant.components.tibber
Source: components/tibber/init.py:62
Integration: Tibber (documentation, issues)
First occurred: January 3, 2023 at 3:20:10 PM (1 occurrences)
Last logged: January 3, 2023 at 3:20:10 PM

Error connecting to Tibber: Cannot connect to host api.tibber.com:443 ssl:default [Try again]

@thatvalis
Copy link

thatvalis commented Jan 4, 2023

Hello,

I have this same issue.
Keeps breaking and stops reporting, has been doing it probably since mid November.
I have been hoping new versions of HA fixes it, but so far it still breaks.
A reboot fixes it, but after a while it stops reporting again.

Some logs:

Logger: tibber.tibber_home
Source: /usr/local/lib/python3.10/site-packages/tibber/tibber_home.py:495
First occurred: January 3, 2023 at 4:10:12 AM (64466 occurrences)
Last logged: 1:22:29 PM

Tibber connection closed
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/tibber/tibber_home.py", line 482, in _start
    await self._tibber_control.rt_connect()
  File "/usr/local/lib/python3.10/site-packages/tibber/__init__.py", line 103, in rt_connect
    await self.sub_manager.connect_async()
  File "/usr/local/lib/python3.10/site-packages/gql/client.py", line 632, in connect_async
    await self.transport.connect()
  File "/usr/local/lib/python3.10/site-packages/gql/transport/websockets_base.py", line 490, in connect
    self.websocket = await asyncio.wait_for(
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 650, in _wrap_awaitable
    return (yield from awaitable.__await__())
  File "/usr/local/lib/python3.10/site-packages/websockets/legacy/client.py", line 659, in __await_impl_timeout__
    return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.10/site-packages/websockets/legacy/client.py", line 666, in __await_impl__
    await protocol.handshake(
  File "/usr/local/lib/python3.10/site-packages/websockets/legacy/client.py", line 332, in handshake
    raise InvalidStatusCode(status_code, response_headers)
websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 502

@Danielhiversen
Copy link
Member

Sorry, but I do not know why the Tibber API returns these error codes for you. Not able to reproduce it here.

@Hexagon
Copy link

Hexagon commented Jan 4, 2023

@Danielhiversen Hire me and I'll show you how to fix it 🤣

(Same issue over here btw)

@Danielhiversen
Copy link
Member

Danielhiversen commented Jan 4, 2023

I do the Tibber integration in my spare time, so I do not have any money to pay you. 🤣
(I do not have anything to do with the Tibber API at work either)

@Hexagon
Copy link

Hexagon commented Jan 4, 2023

Oh, sorry! 🙈 Pass it on to the api guys then 😉

@02dag
Copy link
Author

02dag commented Jan 5, 2023

Sorry, but I do not know why the Tibber API returns these error codes for you. Not able to reproduce it here.

Apparently my tibber integration goes to the incorrect url for the api. Where can I change this or update my tibber integration?
Taking one error out of the equation...

@Danielhiversen
Copy link
Member

Danielhiversen commented Jan 5, 2023

https://github.com/Danielhiversen/pyTibber/blob/master/tibber/__init__.py#L20

Should not be the problem if you run HA 2022.12 or newer, since Tibber has unblocked these releases: https://status.tibber.com/incidents/fkh9ml637jf1

@02dag
Copy link
Author

02dag commented Jan 6, 2023

So you are telling me that the connection url to the tibber server is in HA core, not in your integration?

The logs cleraly say that it still go to the old server "Cannot connect to host api.tibber.com:443"

I am on 2023.0 now and this havent changed anything.

@Danielhiversen
Copy link
Member

Danielhiversen commented Jan 6, 2023

All versions of HA use the old URL.
Tibber blocks HA 2022.11 and older from using the old URL.
HA 2022.12 and newer should still be allowed to use the old URL.

So if 2023.0 does not work for you, I do not know why.

@anhaff
Copy link

anhaff commented Jan 6, 2023

It might be allowed, but does it help if it is switched off?
image
On the other hand there has been some ON - OFF - ON - ... I had some chat contact and as I understod it has been switched on again for a short period of time for some professional user

@Danielhiversen
Copy link
Member

It is not switched off. Just blocking most clients

@FluGanz
Copy link

FluGanz commented Jan 12, 2023

https://github.com/Danielhiversen/pyTibber/blob/master/tibber/__init__.py#L20

Should not be the problem if you run HA 2022.12 or newer, since Tibber has unblocked these releases: https://status.tibber.com/incidents/fkh9ml637jf1

Can I edit that through home assistant app on ios?

@Bigert
Copy link

Bigert commented Jan 13, 2023 via email

@FluGanz
Copy link

FluGanz commented Jan 16, 2023

Hi. After reinstalling Tibber it worked. New version?Kind regards Thomas Bigert12 jan. 2023 kl. 12:27 skrev FluGanz @.>: https://github.com/Danielhiversen/pyTibber/blob/master/tibber/__init__.py#L20 Should not be the problem if you run HA 2022.12 or newer, since Tibber has unblocked these releases: https://status.tibber.com/incidents/fkh9ml637jf1 Can I edit that through home assistant app on ios? —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.>

2023.1.4 is the version i run and i get this ” Could not fetch Tibber data.” have tried reinstall the intergration and reboot ha and the computer

@edwinstol
Copy link

All versions of HA use the old URL. Tibber blocks HA 2022.11 and older from using the old URL. HA 2022.12 and newer should still be allowed to use the old URL.

So if 2023.0 does not work for you, I do not know why.

But don't they state that they stop supporting the old/current endpoint?
https://developer.tibber.com/docs/overview#breaking-websocket-change

Breaking change in websocket subscriptions December 2022

This API initially supported GraphQL websocket subscriptions using graphql-ws sub-protocol. However, that library is archived and no longer maintained. Thus, on March 31, 2022, support for graphql-transport-ws sub-protocol was added.

Support for the old protocol will be removed during December 2022. Also, at the same time, the URL for connecting to websocket server changes. Previously, the connection could be established at wss://api.tibber.com/v1-beta/gql/subscriptions. After the change the URL must be queried via GraphQL (see example below) and client must support graphql-transport-ws sub-protocol

@Schema-F
Copy link

Same issue as FluGanz on 2023.1.5

@Bigert
Copy link

Bigert commented Jan 19, 2023

Hi. After reinstalling Tibber it worked. New version?Kind regards Thomas Bigert12 jan. 2023 kl. 12:27 skrev FluGanz @.>: https://github.com/Danielhiversen/pyTibber/blob/master/tibber/__init__.py#L20 Should not be the problem if you run HA 2022.12 or newer, since Tibber has unblocked these releases: https://status.tibber.com/incidents/fkh9ml637jf1 Can I edit that through home assistant app on ios? —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: _@**.**_>

2023.1.4 is the version i run and i get this ” Could not fetch Tibber data.” have tried reinstall the intergration and reboot ha and the computer

The problem occured the first time I installed it. Probably HA version HA 2023.1.2. A few days later it worked efter reinstallation but at that time I probably had a later version of HA. Today it still works with HA 2023.1.5.

@Schema-F
Copy link

Schema-F commented Jan 20, 2023

Delete and reinstall didn`t work for me on 2023.1.5

Updated to 2023.1.6 - still not working. Removed Tibber and re-added - works!

@02dag
Copy link
Author

02dag commented Feb 16, 2023

I have done like @Schema-F and removed and reinstalled a couple of days ago and now the tibber integration works. This case can be closed

@02dag 02dag closed this as completed Feb 16, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests