Tibber Binding

Yes, that is likely the problem. But if not having neither subscription, nor Pulse, I would assume most of the values would be null, and the binding would be “useless”. Again, a debug log would be needed to see the response in your specific case.

Anyway, the post I linked to in my previous post has a link to manual download / installation, and this binding version does a check for null values. Basically, if there is no data to fetch your thing will be set to OFFLINE.

indeed consumption is null:

{
  "data": {
    "viewer": {
      "homes": [
        {
          "consumption": null
        }
      ]
    }
  }
}

But i’am interested in current energy price:

{
  "data": {
    "viewer": {
      "homes": [
        {
          "currentSubscription": {
            "priceInfo": {
              "current": {
                "total": 0.233,
                "energy": 0.0341,
                "tax": 0.1989,
                "startsAt": "2020-10-07T15:00:00+02:00"
              }
            }
          }
        }
      ]
    }
  }
}

Would then recommend to do a manual install of the binding with the binding version referred to above.

Enable debug logging, and present results as part of thing initialisation. Log should then show the actual response for your case.

Hi.

Any news regarding this?
I am also having problems with live meassurments in OH 2.5.9, but on Tibber API explorer the meassurment is live, see images below.


image

In the example from the docs I had to change the [W] to [%.0f W] and so ON. Then everything worked fine.

//Tibber
Number      TibberAPICurrentTotal                 "Current Total Price [%.2f NOK]"       (gTibber)     {channel="tibber:tibberapi:d743154f:current_total"}
//DateTime    TibberAPICurrentStartsAt              "Timestamp - Current Price"            (gTibber)     {channel="tibber:tibberapi:d743154f:current_startsAt"}
//DateTime    TibberAPIDailyFrom                    "Timestamp - Daily From"               (gTibber)     {channel="tibber:tibberapi:d743154f:daily_from"}
//DateTime    TibberAPIDailyTo                      "Timestamp - Daily To"                 (gTibber)     {channel="tibber:tibberapi:d743154f:daily_to"}
Number      TibberAPIDailyCost                    "Total Daily Cost [%.2f NOK]"          (gTibber)     {channel="tibber:tibberapi:d743154f:daily_cost"}
Number      TibberAPIDailyConsumption             "Total Daily Consumption [%.2f kWh]"   (gTibber)     {channel="tibber:tibberapi:d743154f:daily_consumption"}
//DateTime    TibberAPIHourlyFrom                   "Timestamp - Hourly From"              (gTibber)     {channel="tibber:tibberapi:d743154f:hourly_from"}
//DateTime    TibberAPIHourlyTo                     "Timestamp - Hourly To"                (gTibber)     {channel="tibber:tibberapi:d743154f:hourly_to"}
Number      TibberAPIHourlyCost                   "Total Hourly Cost [%.2f NOK]"         (gTibber)     {channel="tibber:tibberapi:d743154f:hourly_cost"}
Number      TibberAPIHourlyConsumption            "Total Hourly Consumption [%.2f kWh]"  (gTibber)     {channel="tibber:tibberapi:d743154f:hourly_consumption"}
//DateTime    TibberAPILiveTimestamp                "Timestamp - Live Measurement"         (gTibber)     {channel="tibber:tibberapi:d743154f:live_timestamp"}
Number      TibberAPILivePower                    "Live Power Consumption  [%.0f W]"           (gTibber)     {channel="tibber:tibberapi:d743154f:live_power"}
//Number      TibberAPILiveLastMeterConsumption     "Last Meter Consumption [%.2f kWh]"    (gTibber)     {channel="tibber:tibberapi:d743154f:live_lastMeterConsumption"}
Number      TibberAPILiveAccumulatedConsumption   "Accumulated Consumption [%.2f kWh]"   (gTibber)     {channel="tibber:tibberapi:d743154f:live_accumulatedConsumption"}
Number      TibberAPILiveAccumulatedCost          "Accumulated Cost [%.2f NOK]"          (gTibber)     {channel="tibber:tibberapi:d743154f:live_accumulatedCost"}
//String      TibberAPILiveCurrency                 "Currency"                             (gTibber)     {channel="tibber:tibberapi:d743154f:live_currency"}
Number      TibberAPILiveMinPower                 "Min Power Consumption [%.0f W]"            (gTibber)     {channel="tibber:tibberapi:d743154f:live_minPower"}
Number      TibberAPILiveAveragePower             "Average Power Consumption [%.0f W]"        (gTibber)     {channel="tibber:tibberapi:d743154f:live_averagePower"}
Number      TibberAPILiveMaxPower                 "Max Power Consumption [%.0f W]"            (gTibber)     {channel="tibber:tibberapi:d743154f:live_maxPower"}
Number      TibberAPILiveVoltage1                 "Live Voltage Phase  [%.0f V]1"             (gTibber)     {channel="tibber:tibberapi:d743154f:live_voltage1"}
Number      TibberAPILiveVoltage2                 "Live Voltage Phase 2 [%.0f V]"             (gTibber)     {channel="tibber:tibberapi:d743154f:live_voltage2"}
Number      TibberAPILiveVoltage3                 "Live Voltage Phase 3 [%.0f V]"             (gTibber)     {channel="tibber:tibberapi:d743154f:live_voltage3"}
Number      TibberAPILiveCurrent1                 "Live Current Phase 1 [%.1f A]"             (gTibber)     {channel="tibber:tibberapi:d743154f:live_current1"}
Number      TibberAPILiveCurrent2                 "Live Current Phase 2 [%.1f A]"             (gTibber)     {channel="tibber:tibberapi:d743154f:live_current2"}
Number      TibberAPILiveCurrent3                 "Live Current Phase 3 [%.1f A]"             (gTibber)     {channel="tibber:tibberapi:d743154f:live_current3"}
Number      TibberAPILivePowerProduction          "Live Power Production [%.0f W]"            (gTibber)     {channel="tibber:tibberapi:d743154f:live_powerProduction"}
Number      TibberAPILiveMinPowerproduction       "Min Power Production [%.0f W]"             (gTibber)     {channel="tibber:tibberapi:d743154f:live_minPowerproduction"}
Number      TibberAPILiveMaxPowerproduction       "Power consumption/production [%.0f W]"         (gTibber)     {channel="tibber:tibberapi:d743154f:live_maxPowerproduction"}
Number      TibberAPILiveAccumulatedProduction    "Accumulated Production [%.2f kWh]"    (gTibber)     {channel="tibber:tibberapi:d743154f:live_accumulatedProduction"}
String      TibberAPIPriceLevel                   "Price Level [%s]"    (gTibber)     {channel="tibber:tibberapi:d743154f:current_level"}

Raspberry pi 4
Openhabian
Openhab 2.5.10-1

new to OpenHab, but I just installed the Tibber-Binding. Noticed that the log was spammed with [vent.ItemStateChangedEvent] - TibberAPI_PowerConsumptionProduction changed from ... ...
I added a filter to the logs:

/var/lib/openhab2/etc/org.ops4j.pax.logging.cfg

log4j2.appender.event.filter.tibber.type = RegexFilter log4j2.appender.event.filter.tibber.regex = .*(TibberAPI_PowerConsumptionProduction|TibberAPI_TotalCost).* log4j2.appender.event.filter.tibber.onMatch = DENY log4j2.appender.event.filter.tibber.onMisMatch = ACCEPT

Now i get a few of these every hour. Any idea whats going on?

[WARN ] [ibber.internal.handler.TibberHandler] - IO Exception: java.util.concurrent.TimeoutException: Total timeout 20000 ms elapsed

The TibberAPI_PowerConsumptionProduction should be actual updates/changes of your item.

For the Total timeout 20000 ms elapsed, this often happens immediately after hour changes, as Tibber requires some time to calculate the new values. Uncertain how this could be avoided.

Thanks Stian.
I added the log filter just to remove som stress from the SD-card
As to the timeout, i just wanted to know if there was anything wrong with my setup.

Hi guys, a total noob here. I have got the Tibber binding to work (thank you for an awesome binding!) - I just wonder one thing: am I missing something or is it not possible to get the different hourly prices (not cost) from the binding for today and (if available) tomorrow? I know how to get the current price right now but not the coming prices so to speak.

This to be able to plan when it is a good time to consume the most energy in the household. My goal is to have a graph showing up with the price for the different hours today, just like in the app from Tibber. But either I don’t understand the different channels or it is actually not there yet in the binding.

If my question is really stupid, please forgive me. My technical knowledge is not on the level it should be. Just a happy amateur.

Hi, “future” price is currently not implemented in the binding.

Hi,
ok, thank you for a clear answer, appreciated!

Ok, now with active contract still the Plugin is not working:

2020-12-01 09:35:17.665 [DEBUG] [ibber.internal.handler.TibberHandler] - API response: {"data":{"viewer":{"home":{"currentSubscription":{"priceInfo":{"current":{"total":0.2671,"startsAt":"2020-12-01T09:00:00+01:00"}}},"daily":{"nodes":[]},"hourly":{"nodes":[{"from":"2020-12-01T08:00:00+01:00","to":"2020-12-01T09:00:00+01:00","cost":null,"unitPrice":0.2629024,"consumption":null,"consumptionUnit":"kWh"}]}}}}}

2020-12-01 09:35:17.668 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.tibber.internal.handler.TibberHandler@82390a6': Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:659) ~[?:1.8.0_275]
	at java.util.ArrayList.get(ArrayList.java:435) ~[?:1.8.0_275]
	at com.google.gson.JsonArray.get(JsonArray.java:194) ~[bundleFile:?]
	at org.openhab.binding.tibber.internal.handler.TibberHandler.getURLInput(TibberHandler.java:175) ~[?:?]
	at org.openhab.binding.tibber.internal.handler.TibberHandler.getTibberParameters(TibberHandler.java:118) ~[?:?]
	at org.openhab.binding.tibber.internal.handler.TibberHandler.initialize(TibberHandler.java:91) ~[?:?]
	at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_275]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_275]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_275]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_275]

==> /var/log/openhab2/events.log <==
2020-12-01 09:35:17.678 [hingStatusInfoChangedEvent] - 'tibber:tibberapi:aca8b189' changed from ONLINE to UNINITIALIZED (HANDLER_INITIALIZING_ERROR): Index: 0, Size: 0

==> /var/log/openhab2/openhab.log <==
2020-12-01 09:35:17.677 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'tibber:tibberapi:aca8b189': Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:659) ~[?:1.8.0_275]
	at java.util.ArrayList.get(ArrayList.java:435) ~[?:1.8.0_275]
	at com.google.gson.JsonArray.get(JsonArray.java:194) ~[bundleFile:?]
	at org.openhab.binding.tibber.internal.handler.TibberHandler.getURLInput(TibberHandler.java:175) ~[?:?]
	at org.openhab.binding.tibber.internal.handler.TibberHandler.getTibberParameters(TibberHandler.java:118) ~[?:?]
	at org.openhab.binding.tibber.internal.handler.TibberHandler.initialize(TibberHandler.java:91) ~[?:?]
	at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_275]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_275]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_275]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_275]

EDIT: eventually i have to wait until Tomorrow, so that daily has values too?

Thanks for a nice binding! What happened with “Price Level”. I have run the binding 2.5.8 manually up until now, and “Price Level” has been a nice feature. I cannot see it in the newest binding 2.5.11? Can you please add this in OH3 or to the next release of 2.5?

Well, I am sorry to say that the “Price Level” has not been pushed as a pull request for the official repo yet, so it still only remains available from the manual 2.5.8 install file.

Hello.
Installed Tibber Binding, uding OH 3.0, official release.
But I’m getting a nasty error, and the binding is not initializing:
HANDLER_INITIALIZING_ERROR

class com.google.gson.JsonNull cannot be cast to class com.google.gson.JsonObject (com.google.gson.JsonNull and com.google.gson.JsonObject are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @beb15a)

See post: Link (describe how to install gson 2.8.5)

Installed gson 2.8.5, from search.maven.org, central.maven.org is not host.

262 │ Active │ 80 │ 3.0.0 │ openHAB Add-ons :: Bundles :: Tibber Binding
264 │ Active │ 80 │ 2.8.5 │ Gson

Still having trouble using the binding.¨, getting the same message in UI, and exception in the log:

2021-01-11 23:27:28.148 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'tibber:tibberapi:13c6794339': class com.google.gson.JsonNull cannot be cast to class com.google.gson.JsonObject (com.google.gson.JsonNull and com.google.gson.JsonObject are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @5b9a95)
java.lang.ClassCastException: class com.google.gson.JsonNull cannot be cast to class com.google.gson.JsonObject (com.google.gson.JsonNull and com.google.gson.JsonObject are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @5b9a95)
	at com.google.gson.JsonObject.getAsJsonObject(JsonObject.java:205) ~[bundleFile:?]
	at org.openhab.binding.tibber.internal.handler.TibberHandler.getURLInput(TibberHandler.java:175) ~[?:?]
	at org.openhab.binding.tibber.internal.handler.TibberHandler.getTibberParameters(TibberHandler.java:118) ~[?:?]
	at org.openhab.binding.tibber.internal.handler.TibberHandler.initialize(TibberHandler.java:91) ~[?:?]
	at jdk.internal.reflect.GeneratedMethodAccessor42.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:834) [?:?]

Do you then have a active Pulse / subscription?

Looks simular to issue in Post Link (with subsequent comments).

Debug output.

2021-01-12 09:31:25.861 [DEBUG] [ibber.internal.handler.TibberHandler] - API response: {“data”:{“viewer”:{“home”:{“currentSubscription”:null,“daily”:null,“hourly”:null}}}}

Response from API-explorer, using the same token and Home-ID. Data shown correlates with the tibber app on phone.

{
  "liveMeasurement": {
    "timestamp": "2021-01-12T09:57:32.5+01:00",
    "power": 3392,
    "accumulatedConsumption": 28.755328,
    "accumulatedCost": null,
    "currency": null,
    "minPower": 669,
    "averagePower": 2887.2,
    "maxPower": 7310
  }
}

First off: The binding is set up to handle both subscription queries (account based, no Pulse required) and live Pulse measurements (Tibber Pulse required).

From your logs above, the API response is a result from the subscription query (which you apparently don’t have due to the null value), whereas the log provided from Tibber API Explorer would be the Tibber Pulse measurements.

Apparently, Tibber has switched from using emtpy arrays to null values for subscription queries without subscription account. Thus the initialisation fails, and you never get live data measurements in OH.

Need to make changes to the code wrt initalisation to ignore null values rather than empty arrays. If you create an github issue for the openHab-addons repo, a pull request could be made and handled the best way.

1 Like