Nibe uplink binding

nibe
api
Tags: #<Tag:0x00007f1824d5a988> #<Tag:0x00007f1824d5a848>

(Mikael Gustafsson) #1

Hello everybody!

First of all, I am aware of the current Nibe binding, which uses a physical connection, but I was wondering if if would be possible to use the existing Nibe uplink API instead? Of course this would need a new binding. As I’m planning on building a house with a Nibe heatpump and will be using OpenHAB I’d be really interested in this. I’d give it a shot myself, but my programming skills are nonexistent. There’s some discussion on using the API here, if anyone is interested: https://www.marshflattsfarm.org.uk/wordpress/?page_id=3480

Mikael


(Patrick) #2

Some time ago I wrote a script to read the values from Nibe Uplink (German): https://www.symcon.de/forum/threads/25663-Heizung-Nibe-F750-Nibe-Uplink-auslesen-auswerten

I use the http binding to get several values into items. If you are interested, I could post my item definitions here.


(Örjan Backsell) #3

Hi all!
This is very interesting.
My intentions is to switch my in these days very old woodboiler to an Nibe heatpump.
I have read https://www.marshflattsfarm.org.uk/wordpress/?page_id=3480 and there are a lot of good information there.
I’m not a professional programmer but I do like to do my very best to have these things working. So my plan is to try to build a binding that will use the Nibe API as described.
I my case so will this switch of heating not take part before next summer, so this is still a very young project for me and I have still not yet an Account at Nibe, just done some small investigations regarding to implement OAuth2 in the so far not existing binding.
But I do like to contribute to make a binding which will do the work for us. I use Eclipse and will try to build build the binding in Java as described in http://docs.openhab.org/developers/development/bindings.html#include-the-binding-in-the-build-and-the-distro.

paphko, Please, post your item definitions.

//Örjan


(Mikael Gustafsson) #4

For sure it would be interesting to see. I’m not fluent enough in German or code to read that other forum thoroughly but the part I did understand looks good. As far as I’m concerned getting the data in is enough. The heat pump could then be adjusted via IFTTT.

Mikael


(Patrick) #5

Excerpt from JSON response:

{
        "Status":{
                "Außentemperatur":"20.6°C",
                "mittlere Außentemp.":"19.5°C",
                "Brauchwasser oben":"53.0°C",
                "Brauchwasserbereitung":"46.0°C",
                "Gradminuten":"0GM"
        },
        "ventilation":{
                "Abluft":"25.9°C",
                "Fortluft":"26.4°C",
                "Ventilatordrehzahl":"72%"
        },
...

http binding config:

http:nibe.url=http://<your_webserver>/nibe.php?password=MYPASSWD&email=MY@EMAIL.COM&code=12345

These are three example items:

String nibe_aussentemperatur { http="<[nibe:900000:JSONPATH($.Status.Außentemperatur)]" }
String nibe_ventilation_drehzahl { http="<[nibe:900000:JSONPATH($.ventilation.Ventilatordrehzahl)]" }
String nibe_brauchwasser { http="<[nibe:900000:JSONPATH($.Status.Brauchwasser oben)]" }

(Mikael Gustafsson) #6

That looks very interesting. I wish I could further develop it, but my coding skills simply aren’t good enough. Maybe Örjan could work based on this?

Mikael


(Mikael Gustafsson) #7

Now I think I understand what’s going on. So you host the the php somewhere, say your own RPi. That php connects to Nibe Uplink and parses the page for the values and creates json which is then fed into OpenHAB.
The credentials fed to nibe.php are forwarded to Uplink?
Actually, come to think of it, I think this does everything I need it to do. The control can be done via IFTTT.
Thank you very much for posting this, I think it’s excellent!

Mikael


(Örjan Backsell) #8

Just to clear some things out, is this right?
Address Purpose Purpose
10001 N/A Ventilatordrehzahl
40004 BT1 outdoor temp Außentemperatur
40013 BT6 hot water top Brauchwasser
40014 BT6 hot water load Brauchwasser oben
40025 EB100-BT20 exhaust air temp Abluft
40026 EB100-BT21 vented air temp Fortluft
40033 BT50 room temp S1 Raumtemperatur
40047 N/A Vorlauftemperatur
40048 N/A Rücklauftemperatur
40101 N/A Lufteintrittstemperatur
43009 Calculated supply temp S1 berechnete Vorlauftemperatur
43081 Total operation time addition Heizstab Zeitfaktor
43084 Internal electrical addition Power Heizstab
43144 N/A Verdichter Zeitfaktor
43230 Accumulated energy Betriebszeit Verdichter
43305 N/A Verdichter Zeitfaktor Brauchwasser
43416 Compressor starts EB100-EP14- Verdichterstarts
43424 Total hot water operation time compr Betriebszeit Verdichter Brauchwasser
Thank’s , I will have a lot of help aswell of your examples, in my further investigations and development of a hopefully working binding.

//Örjan


(yozik04) #9

I have created a Python script that checks Nibe Uplink every minute and pushes these values to MQTT. I can publish the code on the github if you want. After a small cleanup.

My script uses Nibe’s Private API. I just reverse engineered their web API. Works fine for 3 weeks already.


(Örjan Backsell) #10

Great, I like to see your code, and no hurry, Please, take all time you need.
I assume that you meen the API’s that you have to authenticate by using OAuth2, and that’s seem to be a little bit tricky.
The link I’m thinking of is like: https://api.nibeuplink.com

//Örjan


(yozik04) #11

No, Undocumented API. =)


(Mikael Gustafsson) #12

Does that mean that you are in fact communicating directly with the machine instead of the cloud service?

Mikael


(yozik04) #13

No. The heatpump itself does not have any usable open ports. I’ve scanned it.
It has only 23/tcp open tcpwrapped
No idea what it is. It closes the connection as soon as I try to connect.
My script uses nibe uplink. But does the same that a user would do. Logs in with your username and password and then queries https://www.nibeuplink.com/PrivateAPI/Values endpoint with a list of variables.


(Mikael Gustafsson) #14

I see, very interesting.

Mikael


(Örjan Backsell) #15

I agree, what confuses me is that there seems to be different links and even different ways to catch up the parameters.
Regarding to https://www.marshflattsfarm.org.uk/wordpress/?page_id=3480 is the interesting parameters catched up one by one. And you must before you even can catch them, make your account authorized and in this process get an token which you then use for further catching of parameters.
In your code, you will login in once and then catch all parameters as you described, right?
Is the result delivered as JSON?
Lot of questions is’nt it:slight_smile:

Locking forward to see your code.

//Örjan


(yozik04) #16

And here is the promised code.

See examples/mqtt.py to make it work as a service (This will authenticate ~ once a day).
All parameters are fetched in one request.

If somebody wants a debian package for the nibe -> mqtt bridge feel free to ask. That will simplify installation for non python people.


(Örjan Backsell) #17

Hi,
Great, I will have a closer look asap, but so far it’s look nice.

//Basse


(David M Brooke) #18

Hi,

I’m the author of https://marshflattsfarm.org.uk and I’m also an OpenHab 2 user though so far I haven’t attempted to integrate NIBE Uplink with OpenHab in any way. Like @yozik04 I’m publishing the parameter values I read from NIBE Uplink using MQTT so that’s how I thought I might get them into OpenHab in the future.

While MQTT should work OK for reading parameter values (e.g. to display the outside temperature in the OpenHab GUI), in order to use the Heat Pump “Manage” facilities (available via the Premium subscription for NIBE Uplink) I suspect we’d want to use some sort of tighter integration than MQTT.

Once you know the list of numeric Parameter IDs you want to retrieve (up to a limit of 15) you can do that via one API call with the Public API using GET https://api.nibeuplink.com/api/v1/systems/{systemId}/parameters (at least according to the API manual - I haven’t actually tried that yet).

The challenge is knowing which set of numeric Parameter IDs apply to a particular Heat Pump installation - they vary by Heat Pump Model and by the presence or absence of optional Heat Pump Accessories in a specific Installation. That’s my excuse for having my script query the “Categories” for a particular Heat Pump “System” (i.e. a particular installation) and then grab the Parameters for each Category (via one API call per Category, and from memory there are 2 Categories for my installation) - plus I wanted to capture all of the available Parameters, and there are more than 15.

Thanks to @Basse_03 for mentioning he was working on this topic when he contacted me via my Blog, which brought me here…

dMb


(Alexander F) #19

Hi there,

I managed to create an Openhab2 binding for Nibe Uplink. It is written in plain java so it is fully integrated into Openhab.
It is still in an early state of development so it supports only read access currently and only a few parameters.

Reverse engeneering of those undocumented parameters is quite a lot of work and unfortunately it depends on the heat pump model. Currently the binding supports only one generic thing which has one channel for each parameter Id.
Maybe it would be better to have one thing for each specific heatpump model and one thing for each additional module (compressor, exhaust/supply fan module, etc). But that would be a lot of effort.

Please check out the binding here:

Alex


(Örjan Backsell) #20

Hi,
Great work, i will have a closer look asap, but first some questions.
You will make the nibeId once, when you are connected to the link described and then use this nibeId for all further collecting of posts, right?
Is it possible to set up an account without any working heatpump?

Regards Örjan