Thank you so much for this great binding!
I’ve installed the latest jar, and linked all channels. Everything seems to update and play fine, but i see these warnings in my logs every 5-10sec:
2019-11-26 19:44:20.271 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel current_total although the handler was already disposed.
2019-11-26 19:44:20.272 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel current_startsAt although the handler was already disposed.
2019-11-26 19:44:20.391 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel daily_from although the handler was already disposed.
2019-11-26 19:44:20.392 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel daily_to although the handler was already disposed.
2019-11-26 19:44:20.392 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel daily_cost although the handler was already disposed.
2019-11-26 19:44:20.393 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel daily_consumption although the handler was already disposed.
2019-11-26 19:44:20.511 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel hourly_from although the handler was already disposed.
2019-11-26 19:44:20.511 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel hourly_to although the handler was already disposed.
2019-11-26 19:44:20.511 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel hourly_cost although the handler was already disposed.
2019-11-26 19:44:20.512 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel hourly_consumption although the handler was already disposed.
2019-11-26 19:44:20.512 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler tried updating the thing status although the handler was already disposed.
2019-11-26 19:49:54.476 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel live_power although the handler was already disposed.
2019-11-26 19:49:54.476 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel live_lastMeterConsumption although the handler was already disposed.
2019-11-26 19:49:54.477 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel live_accumulatedConsumption although the handler was already disposed.
2019-11-26 19:49:54.477 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel live_accumulatedCost although the handler was already disposed.
2019-11-26 19:49:54.478 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel live_currency although the handler was already disposed.
2019-11-26 19:49:54.478 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel live_minPower although the handler was already disposed.
2019-11-26 19:49:54.478 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel live_averagePower although the handler was already disposed.
2019-11-26 19:49:54.479 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler TibberHandler of thing tibber:tibberapi:9889a531 tried updating channel live_maxPower although the handler was already disposed.
I have pulse installed, and enabled in the binding config.
I actually encountered the same issue, so maybe you did the same as me: Just replacing jar / rebooting OpenHab without deleting existing Tibber API Thing first…?
The sequence of events which seem to work (if already having the Tibber binding running):
Delete existing Tibber API from PaperUI Things to get a correct close / disposal.
Reboot OpenHab (with the new jar file in the addons folder)
Create new Tibber API Thing in PaperUI (now a new/fresh connection should be made, without the "handler disposed" warnings)
Link all channels (probably needed to link again as a new Thing ID is generated)
Error while starting bundle: file:/C:/openhab-2.4.0/addons/org.openhab.binding.tibber.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.tibber [292]
Unresolved requirement: Import-Package: com.google.gson; version="[2.8.0,3.0.0)"
at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [10:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [10:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [10:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(
From post above: Link, there is a link to the README file which explains what has to be done if error related to gson is occurring during initialization.
From openhab/karaf console, run: bundle:install http://central.maven.org/maven2/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar
Then you should be able to initialize the binding.
19:57:04.664 [INFO ] [tibber.internal.handler.TibberHandler] - Connecting to: wss://api.tibber.com/v1-beta/gql/subscriptions
19:57:05.026 [INFO ] [tibber.internal.handler.TibberHandler] - Connected to Server
19:57:05.175 [WARN ] [tibber.internal.handler.TibberHandler] - WebSocket Connection closed due to Connection error
19:57:05.238 [WARN ] [tibber.internal.handler.TibberHandler] - Closing a WebSocket due to Disconnected
19:57:13.256 [INFO ] [tibber.internal.handler.TibberHandler] - Connecting to: wss://api.tibber.com/v1-beta/gql/subscriptions
19:57:13.534 [INFO ] [tibber.internal.handler.TibberHandler] - Connected to Server
19:57:13.672 [WARN ] [tibber.internal.handler.TibberHandler] - WebSocket Connection closed due to Connection error
19:57:13.737 [WARN ] [tibber.internal.handler.TibberHandler] - Closing a WebSocket due to Disconnected
Based on your log, you get connected, but as part of connection_init request to actually start data stream, Tibber API responds with error in its first response message. This would point in the direction of incorrect token used in the setup.
However, the binding might not be set up to handle multiple homes, so for sure, this could be an issue.
Also, using “personal token”, choosing “Real time subscription” from dropdown menu, what is the result when running subscription (see my example below)?
Then I have prepared a new version of the binding to be able to handle multiple HomeIds / Pulse. Now the user has to define both Tibber token and Tibber HomeId as part of OpenHab setup. Desired HomeId to be used as input in OpenHab could be found from https://developer.tibber.com/explorer: Sign in with your account, load personal token, and run query as shown below:
{
viewer {
homes {
id
}
}
}
Copy and paste HomeId (without quotation marks) into OpenHab setup. Choose desired HomeId/Pulse addon combination.
For users with multiple HomeIds: It would be of great interest to test creating multiple Things in OpenHab, i.e. one Thing per HomeId.
Only issue i see is selecting home id, i kinda had to guess they show in order when quiering https://developer.tibber.com/explorer
{
viewer {
homes {
id
}
}
}
The correct query to be run from https://developer.tibber.com/explorer to identify your HomeId and to see which id has the Pulse associated (realTimeConsumptionEnabled will report true) would be:
{
viewer {
homes {
id
features {
realTimeConsumptionEnabled
}
}
}
}