flopp999 / Tibber-Domoticz

Script to communicate with Tibber. Help me with a buy-me-a-coffee
https://www.buymeacoffee.com/flopp999
GNU General Public License v3.0
8 stars 4 forks source link

Breaking change in websocket subscriptions December 2022 #54

Closed Skjal closed 1 year ago

Skjal commented 1 year ago

seems like Tibber has changed their websockets so that Domoticz cant connect anymore to the api. here is the link from tibber https://developer.tibber.com/docs/overview#breaking-websocket-change. would you please have a look at this and update the plugin?

flopp999 commented 1 year ago

I will have a look at and see if I can fix it

flopp999 commented 1 year ago

I now have a working example, so I should be able to fix this so it will work

me-processware commented 1 year ago

I now have a working example, so I should be able to fix this so it will work

i will buy you a few extra cups of coffee :) it save's me money because i can charge my battery when the price is low

flopp999 commented 1 year ago

I have now updated so it shall work.

Can you update your plugin and try it? Thanks

Skjal commented 1 year ago

Will do as soon as I get the chance.

tir. 20. des. 2022, 13:51 skrev flopp999 @.***>:

I have now updated so it shall work.

Can you update your plugin and try it? Thanks

— Reply to this email directly, view it on GitHub https://github.com/flopp999/Tibber-Domoticz/issues/54#issuecomment-1359308451, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVEQ7IIBP5GA62XY23PGK7LWOGTVJANCNFSM6AAAAAAR6IDO64 . You are receiving this because you authored the thread.Message ID: @.***>

me-processware commented 1 year ago

i have installed the plugin but only 13 custom sensors are working:

i have data from:

power voltagePhase1 voltagePhase3 voltagePhase2 powerProduction currentL1 currentL2 currentL3 Current Price Current Price incl. fee Mean Price Minimum Price Maximum Price

but not from:

minPowerProduction signalStrength minPower maxPower maxPowerProduction lastMeterProduction lastMeterConsumption accumulatedConsumption accumulatedProduction accumulatedConsumptionLastHour accumulatedProductionLastHour accumulatedCost accumulatedReward averagePower

2022-12-21 01:48:48.700 tibber: Live power updated 2022-12-21 01:48:58.211 tibber: Traceback (most recent call last): 2022-12-21 01:48:58.211 File "/opt/domoticz/userdata/plugins/Tibber-Domoticz/plugin.py", line 338, in LivePowerEvery 2022-12-21 01:48:58.211 async with Client(transport=WebsocketsTransport(url="wss://api.tibber.com/v1-beta/gql/subscriptions", init_payload={"token": self.AccessToken}, headers={"User-Agent": "user_agent"}, ping_interval=10 ) ) as session: 2022-12-21 01:48:58.211 File "/usr/local/lib/python3.7/dist-packages/gql/client.py", line 660, in aenter 2022-12-21 01:48:58.211 return await self.connect_async() 2022-12-21 01:48:58.211 File "/usr/local/lib/python3.7/dist-packages/gql/client.py", line 634, in connect_async 2022-12-21 01:48:58.211 await self.transport.connect() 2022-12-21 01:48:58.211 File "/usr/local/lib/python3.7/dist-packages/gql/transport/websockets_base.py", line 512, in connect 2022-12-21 01:48:58.211 await self._initialize() 2022-12-21 01:48:58.211 File "/usr/local/lib/python3.7/dist-packages/gql/transport/websockets.py", line 157, in _initialize 2022-12-21 01:48:58.211 await self._send_init_message_and_wait_ack() 2022-12-21 01:48:58.211 File "/usr/local/lib/python3.7/dist-packages/gql/transport/websockets.py", line 154, in _send_init_message_and_wait_ack 2022-12-21 01:48:58.211 await asyncio.wait_for(self._wait_ack(), self.ack_timeout) 2022-12-21 01:48:58.211 File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for 2022-12-21 01:48:58.211 return fut.result() 2022-12-21 01:48:58.211 File "/usr/local/lib/python3.7/dist-packages/gql/transport/websockets.py", line 131, in _wait_ack 2022-12-21 01:48:58.211 answer_type, answer_id, execution_result = self._parse_answer(init_answer) 2022-12-21 01:48:58.211 File "/usr/local/lib/python3.7/dist-packages/gql/transport/websockets.py", line 430, in _parse_answer 2022-12-21 01:48:58.211 return self._parse_answer_apollo(json_answer) 2022-12-21 01:48:58.211 File "/usr/local/lib/python3.7/dist-packages/gql/transport/websockets.py", line 403, in _parse_answer_apollo 2022-12-21 01:48:58.211 raise TransportServerError(f"Server error: '{repr(error_payload)}'") 2022-12-21 01:48:58.211 gql.transport.exceptions.TransportServerError: Server error: '{'message': 'Prohibited connection!'}' 2022-12-21 01:48:58.211 2022-12-21 01:48:58.211 tibber: <class 'gql.transport.exceptions.TransportServerError'> 2022-12-21 01:49:09.315 tibber: Live power updated

flopp999 commented 1 year ago

Please try again with version 1.20

flopp999 commented 1 year ago

version 1.22 should work

me-processware commented 1 year ago

version 1.22 should work

thanks it works :) noticed the plugin stopped today @ 10:59 but i thought it was a api limit on my side. thanks for the update

image