Nibe REST API

Hey folks,

I am running the OH2.5 binding very well with the given version…

Now I am on “OH3.1 stable” with openhabian and on a Raspberry Pi 2 and would like to try the nibeuplinkrest binding given by the link in this post.

Unfortunately there is the following error when starting the bundle:

2021-09-12 21:14:03.746 [ERROR] [Events.Framework                    ] - FrameworkEvent ERROR
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.nibeuplinkrest [284]
  Unresolved requirement: Import-Package: javax.measure; version="[1.0.0,2.0.0)"
	at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.16.200.jar:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1845) ~[org.eclipse.osgi-3.16.200.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136) ~[org.eclipse.osgi-3.16.200.jar:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1838) ~[org.eclipse.osgi-3.16.200.jar:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781) ~[org.eclipse.osgi-3.16.200.jar:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1743) ~[org.eclipse.osgi-3.16.200.jar:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1665) ~[org.eclipse.osgi-3.16.200.jar:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) ~[org.eclipse.osgi-3.16.200.jar:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) [org.eclipse.osgi-3.16.200.jar:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345) [org.eclipse.osgi-3.16.200.jar:?]

And some seconds later:

2021-09-12 21:14:10.751 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.nibeuplinkrest-3.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.nibeuplinkrest [284]
  Unresolved requirement: Import-Package: javax.measure; version="[1.0.0,2.0.0)"
	at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.16.200.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:440) ~[org.eclipse.osgi-3.16.200.jar:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.8]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.8]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [bundleFile:3.6.8]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [bundleFile:3.6.8]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.8]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.8]

Any hints on this?
Thanks!

Jonathan

OH 3.1 updated the Units of Measurement library, but it seems like it’s trying to use the old version, which is strange. Perhaps the uploaded build is an older one, since before the change, but I don’t believe so. I’ll make a new build and upload it just to make sure, but it’ll have to wait until tomorrow.

1 Like

I have made a new build against 3.2.0-SNAPSHOT, which hopefully should work in 3.1, don’t think there are any other changes in dependencies that could cause troubles. Let me know if it works!

Hi @pacive,

thanks for the update. Unfortunately I cannot get it to work on my OH3.1.0 release build.
The addon won’t load when dropped into the addons directory.

Is a newer snapshot addon (nibeuplinkrest, 3.2.0) usable on a previous version of OH (in my instance OH3.1.0 release)?

Thanks!
Jonathan

Thanks

Log in to the karaff console and run

bundle:list | grep -i nibe

I suspect that the old version is still there, which can cause the new one not to start. If that’s the case, note the bundle id (the first column) of the two versions and run

bundle:uninstall <old version id>
bundle:restart <new version id>

Then make sure to delete the old jar from the addons directory to prevent issues on the next reboot.

Unfortunatley, there is only the new version in the bundle list:

openhab> bundle:list | grep -i nibe
288 x Active x  80 x 3.2.0.202109130834    x openHAB Add-ons :: Bundles :: NibeUplinkRest Binding

It’s shown as active, but the binding will not show up in the binding list in the main UI.

I also tried reboots between installation and removal of the binding versions.

There is also no hint in the log as well :frowning:

Bindings installed manually don’t show up in the binding list, but you should be able to add a Thing for it if everything works as it should.

It’s there :face_with_hand_over_mouth: - I must have something on my eyes today morning as I looked into the list of addable things :wink:

I somehow had in mind the manually installed bindings will show up in the list of installed bindings as well…

Thanks for the hint.

Cheers
Jonathan

The binding is now published in the new Add-on Marketplace so it can be installed more easily!

Make sure you uninstall the old version first, (bundle:uninstall org.openhab.binding.nibeuplinkrest and remove the jar from the addons directory) otherwise the installation will fail.

2 Likes

Hi @pacive , thanks for the amazing add-on, I’ve managed to set it up successfully. Only, my setup is a SMO40 with a F2040 outdoor unit. The addon currently seems to only present the SMO40 as a Thing in OH. How could I add the outdoor unit as a separate Thing? I would love to be able to monitor the compressor start info that I can see in the Nibe Uplink UI, where it is presented as a slave unit to the SMO40.

Thanks for your time!

It should be able to detect both systems, but there could be some bug I have missed, have not been able to test since I only have one system.

Could you enable debug logging (log:set DEBUG org.openhab.binding.nibeuplinkrest) and post the log output when starting discovery?

A quick question. Does this binding support the S-series (I have a NIBE S1155) heat pumps or is there another way to connect to myuplink.com which as I understand it is a bit different from nibeuplink.com?

Unfortunately no, as you say they have a different API. It could probably be made to work, but I wouldn’t have any possibility to test it against a real system.

2 Likes

Let me know if you would be interested in some kind of collaboration. I have one in operation and another one soon to be installed so there are definitely pumps available to test on. I have some developer background but nothing around bindings. Is it complicated to set up a development environment?

There are good guides in the openhab docs for how to set everything up. What can be a bit of a learning curve is to learn how to use the oh core apis to make everything work, but once you get a hang of that it’s mostly like any other programming.

I have managed to get a developer account at myuplink, so I can see the different endpoints and such, but without a real system to test against it’s quite difficult to implement anything.

If you would like to try and add it to my binding you are very welcome, and I’ll help you with any questions and refactorings that might be necessary!

The source code is available here: GitHub - pacive/openhab-addons at nibeuplink-rest-3

I’ve Problems to activate the REST API-Binding in my Openhab 3.4 Environement.

  • A NibeUpling-Binding is running
  • I’ve defined a application under api.nibeuplink.com
  • I’ve installed the Binding in OH34
  • When i call the Callback-URL http://192.168.xxx.xx:8080/nibeuplinkconnect i get “Website not reachable”
  • I checked the IP-Adress → correct
    My Hardware is a VVM500 with a F2120.
    What could be the matter with this?

Is that when trying to access the page for the first time, or during the authorization flow? Is your openHAB instance accessible on port 8080? (if you remove nibeuplinkconnect from the url?)

No, not reachable.
Neither http://192.168.xxx.xx:8080 nor http://192.168.xxx.xx are functional.

Then how do you access your openHAB?

Ooh, i see the failure!
I’ve tried the IP-Adress from my Nibe-WP.
Taking my OpenHAB-IP-Adress it works.
Thanks a lot!!!