Tibber Binding

Great work @kjoglums!

I just tried the binding, and I could only get parts of it to work. My setup is a single account with 2 homes, thereof one with a Pulse.

I got some data in the PaperUI - probably regarding 1 of the homes. No data on the Pulse; from the log “WebSocket Connection closed due to Connection error”

I suggest a slight redesign of the Thing setup as I guess the current setup does not support multiple homes:

  • Tibber Account as the bridge thing
  • Subscription (or Home) as the thing reflecting the subscription
  • Pulse as a separate thing - connected to a Subscription (or Home) thing

What do you think?

Cheers, Arne

Appreciate the feedback. Will evaluate your proposed changes. See the benefit of using bridge / autodiscovery of HomeIDs. At the same time, autodiscovery could cause some issues for some users. For a test case above, for a user having 4 HomeIDs, 1 regular account, 1 with Pulse, 2 HomeIDs were inactive/reporting null values.

The current setup/configuration is intended to give the user most flexibility, i.e. to manually choose which HomeID to track. And it is possible to add more Tibber Things manually in PaperUI, i.e. one Thing per HomeID. In PaperUI the user defines which HomeID to track for each Thing, and defines Pulse as addon from dropdown menu if connected (the code will also verify before actually attempting to live stream).

If you have Pulse connected, and go to https://developer.tibber.com/explorer (sign in / load personal token) and run query below you will see which HomeID to input in PaperUI to get live measurements from Pulse. If you are providing correct HomeId / Pulse combination in PaperUI I do not understand why you do not get websocket connection / live data.

{
  viewer {
    homes {
      id
      features {
        realTimeConsumptionEnabled
      }
    }
  }
}

Still haven’t been able to test, hoping to get some time for testing the coming Week.

I Would also like to suggest that the Production items are added (gjetting solar panel installed in January).
And voltage and current items Would also be appreciated :grin:

No problem to add additional channels to the livestream, so will have a look and update :grinning:

Reason for not including voltage/current initially is because Tibber writes that Kaifa and Aidon meters only reports value every 10 seconds, otherwise null. When testing using https://developer.tibber.com/explorer, this is actually the case for me. However, no problem to include channels and only perform channel updates if/when actual values are received.

In fact, I just created a new version:

  • Added channels for voltage per phase, current per phase and power production
  • Revised code: User still need to input token and HomeID per Tibber Thing added in PaperUI, but binding will automatically detect/report if Pulse is associated with HomeID or not. Several Tibber Things can be installed manually in PaperUI, i.e. one Thing for each HomeID.

JAR file
https://github.com/kjoglum/openhab2-addons/releases/download/v2.0.2/org.openhab.binding.tibber-2.5.0-SNAPSHOT.jar

README
README

Note:
If you already are running a version of the Tibber binding, the following approach would be recommended for updating to new version:

  • Delete existing Tibber thing in PaperUI
  • Delete existing jar from addons folder
  • Reboot OpenHab
  • Install new jar file into addons folder (from link above)
  • Install new Tibber Thing(s) in PaperUI
  • Create/link items to Tibber Thing(s)
1 Like

Worked like a charm!
Thanks for finally implementing this @kjoglums :slight_smile:

Also a little screenshot from the first implementation (Matrix theme).

2 Likes

Just installed this addon, seems to work like a charm! Just signed up with Tibber though, so I won’t get any real numbers until next week :slight_smile:

One thing I stumbled on was the gson installation. I don’t know if it’s just me, but I can’t even resolve central.maven.org in dns. Some googling led me to using https://search.maven.org/remotecontent?filepath=com/google/code/gson/gson/2.8.6/gson-2.8.6.jar instead, which works good.

Hi everyone!
Great job and a great binding @kjoglums!
I just recently became user of tibber.
I have installed the binding and everything works fine.
But I have some suggestion:

Example:

Number:Dimensionless TibberAPICurrentTotal “Current total price [%.2f øre]” (Tibber) {channel=“tibber:tibberapi:XXXXXXXX:current_total”}

Number:Dimensionless TibberAPIDailyCost “Total daily cost [%.2f kr]” (Tibber) {channel=“tibber:tibberapi:XXXXXXXX:daily_cost”}

Number:Dimensionless TibberAPIDailyConsumption “Total daily consumption [%.2f kr]” (Tibber) {channel=“tibber:tibberapi:XXXXXXX:daily_consumption”}

Appreciate your input @Phuong:

As part of the PR, there has been changes. So, several channels are now changed from String/dimensionless to UoM - see updated demo.items Readme.

Will also have a look at the timestamps and currency topics as you suggest. The challenge with currency is although that this is not (as I´ve found) an UoM for OH. But, I could present examples based on NOK.

A new version of the binding is available: Use of UoM / corrections based on PR review:

Readme
Tibber 2.5.4-SNAPSHOT

I am getting these errors in the log after installing the binding. Any idea what it could be?

2020-04-11 16:01:28.917 [WARN ] [ibber.internal.handler.TibberHandler] - Closing a WebSocket due to Disconnected
2020-04-11 16:01:28.917 [ERROR] [ibber.internal.handler.TibberHandler] - Error during websocket communication: Broken pipe
java.io.IOException: Broken pipe
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.flush(SslConnection.java:928) ~[bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:422) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:277) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:381) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.FrameFlusher.flush(FrameFlusher.java:264) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.FrameFlusher.process(FrameFlusher.java:193) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.outgoingFrame(AbstractWebSocketConnection.java:516) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.client.io.WebSocketClientConnection.outgoingFrame(WebSocketClientConnection.java:72) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.close(AbstractWebSocketConnection.java:184) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:458) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:428) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:426) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:320) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:158) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) [bundleFile:9.4.20.v20190813]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
2020-04-11 16:01:28.924 [WARN ] [ibber.internal.handler.TibberHandler] - Closing a WebSocket due to Broken pipe

I see your home id is associated with a Tibber Pulse, hence a websocket connection is attempted established to get real time data.

Although, the Tibber Server apparently closes the connection attempt. Not sure why (Broken pipe). Are you receiving any data at all? Could it be some firewall preventing incoming data?

What could be suggested to get more details from logs during initialisation:

  1. Enable log:set debug org.openhab.binding.tibber from openhab console.
  2. sudo reboot openhab service.

Then present logs from initializing until the error occurs.

Here it is:

2020-04-11 21:27:20.565 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Oslo'.
2020-04-11 21:27:20.675 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'en_NO'.
2020-04-11 21:27:31.697 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'lights.items'
2020-04-11 21:27:31.799 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'temperature.items'
2020-04-11 21:27:31.856 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'timers.items'
2020-04-11 21:27:32.499 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'influxdb.persist'
2020-04-11 21:27:38.741 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2020-04-11 21:27:42.040 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.1.123:8080
2020-04-11 21:27:42.045 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.1.123:8443

==> /var/log/openhab2/events.log <==
2020-04-11 21:27:42.375 [hingStatusInfoChangedEvent] - 'tibber:tibberapi:8e4a8cbd' changed from UNINITIALIZED to INITIALIZING

==> /var/log/openhab2/openhab.log <==
2020-04-11 21:27:42.405 [INFO ] [ibber.internal.handler.TibberHandler] - Initializing Tibber API

==> /var/log/openhab2/events.log <==
2020-04-11 21:27:42.412 [hingStatusInfoChangedEvent] - 'tibber:tibberapi:8e4a8cbd' changed from INITIALIZING to UNKNOWN

==> /var/log/openhab2/openhab.log <==
2020-04-11 21:27:42.461 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.486 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.488 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.488 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.488 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.487 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.498 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.491 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.501 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.501 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.491 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.499 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.499 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.507 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.509 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.510 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.510 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.511 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.512 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.514 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.519 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.519 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.516 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.516 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.524 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.524 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.522 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands
2020-04-11 21:27:42.527 [DEBUG] [ibber.internal.handler.TibberHandler] - Tibber API is read-only and does not handle commands


==> /var/log/openhab2/openhab.log <==
2020-04-11 21:27:46.882 [INFO ] [ibber.internal.handler.TibberHandler] - Initialized ID: c2e61659-................

==> /var/log/openhab2/events.log <==
2020-04-11 21:27:47.201 [hingStatusInfoChangedEvent] - 'tibber:tibberapi:8e4a8cbd' changed from UNKNOWN to ONLINE

==> /var/log/openhab2/openhab.log <==
2020-04-11 21:27:47.222 [DEBUG] [ibber.internal.handler.TibberHandler] - API response (Price): {"data":{"viewer":{"home":{"currentSubscription":{"priceInfo":{"current":{"total":0.0824,"startsAt":"2020-04-11T21:00:00+02:00"}}}}}}}


==> /var/log/openhab2/openhab.log <==
2020-04-11 21:27:47.346 [DEBUG] [ibber.internal.handler.TibberHandler] - API response (Daily): {"data":{"viewer":{"home":{"daily":{"nodes":[{"from":"2020-04-10T00:00:00+02:00","to":"2020-04-11T00:00:00+02:00","cost":6.5339632625,"unitPrice":0.082417,"consumption":79.279,"consumptionUnit":"kWh"}]}}}}}

==> /var/log/openhab2/openhab.log <==
2020-04-11 21:27:47.440 [WARN ] [core.thing.internal.ThingManagerImpl] - Initializing handler for thing 'tibber:tibberapi:8e4a8cbd' takes more than 5000ms.
2020-04-11 21:27:47.603 [DEBUG] [ibber.internal.handler.TibberHandler] - API response (Hourly): {"data":{"viewer":{"home":{"hourly":{"nodes":[{"from":"2020-04-11T20:00:00+02:00","to":"2020-04-11T21:00:00+02:00","cost":null,"unitPrice":0.0837625,"consumption":null,"consumptionUnit":"kWh"}]}}}}}


==> /var/log/openhab2/openhab.log <==
2020-04-11 21:27:47.705 [INFO ] [ibber.internal.handler.TibberHandler] - Pulse associated with HomeId: Live stream will be started
2020-04-11 21:27:47.708 [INFO ] [ibber.internal.handler.TibberHandler] - Connecting to: wss://api.tibber.com/v1-beta/gql/subscriptions

==> /var/log/openhab2/events.log <==
2020-04-11 21:27:47.766 [vent.ItemStateChangedEvent] - TibberAPI_CurrentTotalPrice changed from NULL to 0.0824
2020-04-11 21:27:47.769 [vent.ItemStateChangedEvent] - TibberAPI_TimestampCurrent changed from NULL to "2020-04-11T21:00:00+02:00"
2020-04-11 21:27:47.776 [vent.ItemStateChangedEvent] - TibberAPI_TimestampDailyFrom changed from NULL to "2020-04-10T00:00:00+02:00"
2020-04-11 21:27:47.782 [vent.ItemStateChangedEvent] - TibberAPI_TimestampDailyTo changed from NULL to "2020-04-11T00:00:00+02:00"
2020-04-11 21:27:47.796 [vent.ItemStateChangedEvent] - TibberAPI_TotalDailyCost changed from NULL to 6.5339632625
2020-04-11 21:27:47.798 [vent.ItemStateChangedEvent] - TibberAPI_TotalDailyConsumption changed from NULL to 79.279
2020-04-11 21:27:47.800 [vent.ItemStateChangedEvent] - TibberAPI_TimestampHourlyFrom changed from NULL to "2020-04-11T20:00:00+02:00"
2020-04-11 21:27:47.802 [vent.ItemStateChangedEvent] - TibberAPI_TimestampHourlyTo changed from NULL to "2020-04-11T21:00:00+02:00"

==> /var/log/openhab2/openhab.log <==
2020-04-11 21:27:49.434 [INFO ] [ibber.internal.handler.TibberHandler] - Connected to Server

==> /var/log/openhab2/openhab.log <==
2020-04-11 21:27:49.438 [DEBUG] [ibber.internal.handler.TibberHandler] - Send message: {"type":"connection_init", "payload":"token=e11e3fed883e4dd4edac6554d0087a7d23ec056a8d410b5894c19a4d38f44ecf"}

==> /var/log/openhab2/openhab.log <==
2020-04-11 21:27:49.619 [DEBUG] [ibber.internal.handler.TibberHandler] - Send message: {"id":"1","type":"start","payload":{"variables":{},"extensions":{},"operationName":null,"query":"subscription {\n liveMeasurement(homeId:\"c2e61659-18bb-4042-a324-978e3b14d0d5\") {\n timestamp\n power\n lastMeterConsumption\n accumulatedConsumption\n accumulatedCost\n currency\n minPower\n averagePower\n maxPower\n voltagePhase1\n voltagePhase2\n voltagePhase3\n currentPhase1\n currentPhase2\n currentPhase3\n powerProduction\n accumulatedProduction\n minPowerProduction\n maxPowerProduction\n }\n }\n"}}

==> /var/log/openhab2/openhab.log <==
2020-04-11 21:28:02.464 [INFO ] [rnal.service.RemoteControllerService] - Using WebSocket interface
==> /var/log/openhab2/openhab.log <==
2020-04-11 21:28:32.601 [WARN ] [org.eclipse.jetty.io.ManagedSelector] - java.nio.channels.ClosedSelectorException
2020-04-11 21:28:32.605 [WARN ] [l.protocol.RemoteControllerWebSocket] - WebSocketClient failure: java.lang.InterruptedException

==> /var/log/openhab2/openhab.log <==
2020-04-11 21:28:48.431 [DEBUG] [ibber.internal.handler.TibberHandler] - API response (Price): {"data":{"viewer":{"home":{"currentSubscription":{"priceInfo":{"current":{"total":0.0824,"startsAt":"2020-04-11T21:00:00+02:00"}}}}}}}

2020-04-11 21:28:48.508 [DEBUG] [ibber.internal.handler.TibberHandler] - API response (Daily): {"data":{"viewer":{"home":{"daily":{"nodes":[{"from":"2020-04-10T00:00:00+02:00","to":"2020-04-11T00:00:00+02:00","cost":6.5339632625,"unitPrice":0.082417,"consumption":79.279,"consumptionUnit":"kWh"}]}}}}}

2020-04-11 21:28:48.588 [DEBUG] [ibber.internal.handler.TibberHandler] - API response (Hourly): {"data":{"viewer":{"home":{"hourly":{"nodes":[{"from":"2020-04-11T20:00:00+02:00","to":"2020-04-11T21:00:00+02:00","cost":null,"unitPrice":0.0837625,"consumption":null,"consumptionUnit":"kWh"}]}}}}}

==> /var/log/openhab2/openhab.log <==
2020-04-11 21:28:49.635 [WARN ] [ibber.internal.handler.TibberHandler] - Closing a WebSocket due to Disconnected
2020-04-11 21:28:49.635 [ERROR] [ibber.internal.handler.TibberHandler] - Error during websocket communication: Broken pipe
java.io.IOException: Broken pipe
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.flush(SslConnection.java:928) ~[bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:422) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:277) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:381) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.FrameFlusher.flush(FrameFlusher.java:264) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.FrameFlusher.process(FrameFlusher.java:193) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.outgoingFrame(AbstractWebSocketConnection.java:516) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.client.io.WebSocketClientConnection.outgoingFrame(WebSocketClientConnection.java:72) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.close(AbstractWebSocketConnection.java:184) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:458) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:428) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:426) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:320) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:158) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) [bundleFile:9.4.20.v20190813]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) [bundleFile:9.4.20.v20190813]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
2020-04-11 21:28:49.668 [WARN ] [ibber.internal.handler.TibberHandler] - Closing a WebSocket due to Broken pipe
^C
[21:28:55] openhabian@openHABianPi:~$ 

Well, this is strange, as everything seems normal on the binding side of things: Your Tibber Pulse is recognised for the given token/homeid, a websocket connection for realtime data is initiated, and the correct handshake/initialisation messages are sent to initiate the live stream. Although, you don’t get any live stream response from the server, and the connection is disconnected.

So, the issue points to some local or Tibber server issue in your case:

  1. Firewall issues? Although, I see you get response for the http queries (price, daily cost/consumption etc), so it might seem like it is not the root cause.
  2. Communication issues? Is the Pulse having a solid network connection (wifi, distance etc), and you are getting live and continous updates within the Tibber app? Have you also tested/confirmed getting live updates with your token/homeid under developer.tibber.com (API Explorer) when running query “Real Time Subscription”?

You got it! It is indeed the Pulse that is not getting a network connection. I did not even think about that. I have changed the wireless password, completely forgetting that the Pulse needs the new key as well. Thanks, Stian!

1 Like

Hi. I’ve had some problems with the Tibber binding lately, after I upgrade to the latest release none og the items Are updating except the timestamp item. I’ve tried to delte the thing and remove all items, restarte openhab. But No luck, I’ve not logged anything yet and not tried to revert to an old snapshot, but any suggestions to the problem?

I’ve observed the same issue as part of a full “cleanup” (clean cache, tmp etc). After the first reboot (openhab reboot), I sometimes only get updates for timestamp. Although, when doing yet another reboot I get updates as normal.

As part of full “cleanup” I have also experienced a couple of occurrences where my “live measurements” are not updated. However, this would relate to the number of connections allowed, and is reported as an error in openhab as “too many concurrent connections…”. When this happens, I delete my token (tibber account), and create a new one which I also use as input in OH.

So, if you are seeing updates as normal from developer.tibber.com (API explorer), meaning the issue is OH related only, I would try to clean cache etc and do a couple of reboots. Not sure what would be causing this issue.

Hi @kjoglums
Been able to troubleshoot som more. I think I might have a problem because my supscription with Tibber is no longer active (bought Solar panels and had to change because of the economy).
Most of the none live items have null as value, that is ok since I dont have an subscription. But the live items are still accesable from the api explorer, but they are not updated in Openhab. Everything seems ok in the log, but as you can see from the picture things are not correct.

I should add that I’ve tried all of what you suggested in the previous reply.

2020-06-11 20:53:34.195 [DEBUG] [ibber.internal.handler.TibberHandler] - API response: {"data":{"viewer":{"home":{"currentSubscription":{"priceInfo":{"current":null}},"daily":{"nodes":[{"from":"2020-06-10T00:00:00+02:00","to":"2020-06-11T00:00:00+02:00","cost":null,"unitPrice":null,"consumption":null,"consumptionUnit":"kWh"}]},"hourly":{"nodes":[{"from":"2020-06-11T19:00:00+02:00","to":"2020-06-11T20:00:00+02:00","cost":null,"unitPrice":null,"consumption":null,"consumptionUnit":"kWh"}]}}}}}

2020-06-11 20:53:34.307 [DEBUG] [ibber.internal.handler.TibberHandler] - Pulse associated with HomeId: Live stream will be started
2020-06-11 20:53:34.309 [DEBUG] [ibber.internal.handler.TibberHandler] - Starting Websocket connection
2020-06-11 20:53:34.323 [DEBUG] [ibber.internal.handler.TibberHandler] - Connecting Websocket connection
2020-06-11 20:53:35.075 [DEBUG] [ibber.internal.handler.TibberHandler] - Sending websocket connect message
2020-06-11 20:53:35.203 [DEBUG] [ibber.internal.handler.TibberHandler] - Send message: {"type":"connection_init", "payload":"token=rYbi_Ex1qo6SHIgOVRbbneCzu64Nfktr2phKM6GTq1o"}
2020-06-11 20:53:35.282 [DEBUG] [ibber.internal.handler.TibberHandler] - Connected to Server
2020-06-11 20:53:35.283 [DEBUG] [ibber.internal.handler.TibberHandler] - Send message: {"id":"1","type":"start","payload":{"variables":{},"extensions":{},"operationName":null,"query":"subscription {\n liveMeasurement(homeId:\"dd82df62-fb88-4828-be0d-69a5035815f4\") {\n timestamp\n power\n lastMeterConsumption\n accumulatedConsumption\n accumulatedCost\n currency\n minPower\n averagePower\n maxPower\nvoltagePhase1\n voltagePhase2\n voltagePhase3\n currentPhase1\n currentPhase2\n currentPhase3\n powerProduction\n accumulatedProduction\n minPowerProduction\n maxPowerProduction\n }\n }\n"}}
2020-06-11 20:53:38.182 [INFO ] [marthome.model.script.TimeOfDay rule] - Calculating time of day...
2020-06-11 20:53:42.394 [INFO ] [marthome.model.script.TimeOfDay rule] - Calculated time of day is EVENING

According to your log, everything seems normal: Your Tibber Pulse is recognised for the given token/homeid, a websocket connection for realtime data is initiated, and the correct handshake/initialisation messages are sent to initiate the live stream. You also get connected to the server.

A couple of things:

  1. If you deleted/recreated your Tibber thing: Did you use the same thing ID for the new Tibber thing created as the one deleted? As created items, at least text file configured items, include reference to thing ID, your items will not be updated unless the correct thing ID is in place. You then would need to either change your Tibber thing ID back to original, alternatively create/link new items with the correct thing ID.

  2. Just for reference: The Tibber binding pull request is approved, and the binding is therefore included as part of official OH addons. The lates version can be downloaded:
    Link

Anyone who can point out whats wrong?. new install OH 2.5.6

UNINITIALIZED - HANDLER_INITIALIZING_ERROR Index: 0, Size: 0
21:28:18.036 [WARN ] [ommon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_201]
at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_201]
at com.google.gson.JsonArray.get(JsonArray.java:194) ~[?:?]
at org.openhab.binding.tibber.internal.handler.TibberHandler.getURLInput(TibberHandler.java:175) ~[?:?]
at org.openhab.binding.tibber.internal.handler.TibberHandler.updateRequest(TibberHandler.java:244) ~[?:?]
at org.openhab.binding.tibber.internal.handler.TibberHandler.lambda$0(TibberHandler.java:235) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_201]
at java.util.concurrent.FutureTask.runAndReset(Unknown Source) ~[?:1.8.0_201]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) ~[?:1.8.0_201]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_201]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_201]