Nibe REST API

Okay, after deleting cache & tmp, build number is updated:

203 │ Active │  80 │ 2.5.13.202102021721     │ openHAB Add-ons :: Bundles :: NibeUplinkRest Binding

Hopefully this is not the normal procedure for all updates…

No, it should detect that the file has changed and update the bundle automatically, not sure why the old one was kept instead. Hope everything is working now. You might have to delete your system thing and rediscover it to make it discover the problematic channel correctly.

1 Like

Now everything seems to work ok, even air velocity sensor shows correct value!

Glad to hear it!

Hi, for the S-series, Nibe uses other server to register / connect: api.myuplink.com

Is there a way to make the binding work for this? (or am I just missing something)

I haven’t got an account there, so don’t know how it looks, but I would assume it’s not compatible I’m afraid. It would probably need a separate binding, or at least a rather big addition to this one.

Today I’ve experienced multiple connection problems with Nibe uplink. @pacive, have you seen anything similar with your setup? Now this seems to have stabilized, as last error was 8 hours ago.

Yes, Nibe uplink seems to have had issues earlier. I even had to restart my heatpump because it didn’t reconnect on its own. It happens from time to time, most of the time the put a notice on the web page that they’re performing maintenance, but not always.

I’d be interested in this as well.
I quickly compared https://api.nibeuplink.com/docs/v1 to https://dev.myuplink.com/ (you an log into both using same credentials). and the only difference I noticed was the version. (v1 compared to v2). Otherwise they look the same. This obviously doesn’t mean there can’t be differences in deeper layers.
Nevertheless @pacive, if you go down the rabbti hole and need testers I’ll volunteer.

Thanks for the hint, managed to log in with my existing account. Unfortunately, both the api endpoints and the data structure seems to have changed, so would have to add quite a lot. I could try using the documentation, but would be impossible for me to test since I don’t have a compatible system. If anyone else would like to try the source code is at my github. I will gladly answer any questions to help out with the development!

I used the API explorer and got it to work - V2 offers less data than v1… noting on things like status. Contacted nibe locally, but no answer yet. The usefull data is the things o. Datapoints you see in the documentation

I can’t promise anything (quite swamped with work at the moment) but if you can provide some sample data from the different endpoints I could have a look at it.

The myuplink api also seems to support simpler authentication, you just need to supply the client id and client secret to get a authorization token (no need for a complete oauth flow) so it should be possible to implement just using rules with the sendHttp*Request actions (or if using jsr223 rules a http library from the script language).

Used documentation on Swagger UI

This is the call & result. Mobile app has a lot more data - had hoped that is accessible through API

curl -X GET “https://api.myuplink.com/v2/devices/xxxxxxxx-xxxx-xx-xx-xx-x-xx/points” -H “accept: text/plain” -H “Authorization: Bearer xxxxx”
[{“category”:“NIBE S1155-12 EM 3X230V”,“parameterId”:“4”,“parameterName”:“Current outdoor temper­ature (BT1)”,“parameterUnit”:“°C”,“writable”:false,“timestamp”:“2021-03-25T21:36:54+00:00”,“value”:9.6,“strVal”:""},{“category”:“NIBE S1155-12 EM 3X230V”,“parameterId”:“8”,“parameterName”:“Supply line (BT2)”,“parameterUnit”:“°C”,“writable”:false,“timestamp”:“2021-03-25T21:47:12+00:00”,“value”:29.6,“strVal”:""},{“category”:“NIBE S1155-12 EM 3X230V”,“parameterId”:“10”,“parameterName”:“Return line (BT3)”,“parameterUnit”:“°C”,“writable”:false,“timestamp”:“2021-03-25T21:45:52+00:00”,“value”:26.1,“strVal”:""},{“category”:“NIBE S1155-12 EM 3X230V”,“parameterId”:“12”,“parameterName”:“Hot water char­ging (BT6)”,“parameterUnit”:“°C”,“writable”:false,“timestamp”:“2021-03-25T21:43:37+00:00”,“value”:50.0,“strVal”:""},{“category”:“NIBE S1155-12 EM 3X230V”,“parameterId”:“13”,“parameterName”:“Brine in (BT10)”,“parameterUnit”:“°C”,“writable”:false,“timestamp”:“2021-03-25T18:13:04+00:00”,“value”:0.5,“strVal”:""},{“category”:“NIBE S1155-12 EM 3X230V”,“parameterId”:“14”,“parameterName”:“Brine out (BT11)”,“parameterUnit”:“°C”,“writable”:false,“timestamp”:“2021-03-25T21:48:05+00:00”,“value”:-2.2,“strVal”:""},{“category”:“NIBE S1155-12 EM 3X230V”,“parameterId”:“54”,“parameterName”:“Average temper­ature (BT1)”,“parameterUnit”:“°C”,“writable”:false,“timestamp”:“2021-03-24T15:38:49+00:00”,“value”:11.0,“strVal”:""},{“category”:“NIBE S1155-12 EM 3X230V”,“parameterId”:“781”,“parameterName”:“Degree minutes”,“parameterUnit”:“DM”,“writable”:true,“timestamp”:“2021-03-25T21:45:06+00:00”,“value”:-93.0,“strVal”:""},{“category”:“NIBE S1155-12 EM 3X230V”,“parameterId”:“1708”,“parameterName”:“Calcu­lated supply climate system 1”,“parameterUnit”:“°C”,“writable”:false,“timestamp”:“2021-03-25T21:41:13+00:00”,“value”:29.3,“strVal”:""}]

I know virtually nothing about OAuth etc. How exactly does one obtain the needed client_id and secret? I see alot of stuff in the swagger docs but can’t figure out how to get the tokens.

The client id and secret should be provided to you when you register an application at myUplink Developer Web. Then you need to make a post request to /oauth/token (the documentation doesn’t specify how, but I guess www-form formatted) to get a token. This in turn needs to be provided in the Authorization http header for the rest of the requests. The token is only valid for a short time, so it needs to be renewed periodically.

Edit: after examining the network traffic to the api via swagger, the client id and secret should be passed via http basic auth. and the request body should be grant_type=client_credentials&scope=READSYSTEM+WRITESYSTEM.
You then get a json response with the token, and the expire time (1 hour).

If you try the /v2/systems/{systemId}/categories endpoint, do you get more data? The json you posted seems to be comparable to the STATUS category in the v1 api, where only some general info is shown, but there are other categories with parameter relating to the different subsystems (compressor, ventilation, different heating circuits etc.)

Thank you!

I somehow, honesty I don’t know how, managed to get an access token using the Swagger documentation (no idea how to actually use curl to get a token).
Anyway, when querying /points I seem to get a somehat longer list:

[
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"4",
      "parameterName":"Current outdoor temper­ature (BT1)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T08:13:17+00:00",
      "value":3.4,
      "strVal":""
   },
   {
      "category":"Muu talo",
      "parameterId":"7",
      "parameterName":"Supply line (EP21-BT2)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T07:43:07+00:00",
      "value":26.7,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"8",
      "parameterName":"Supply line (BT2)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T07:44:49+00:00",
      "value":28.4,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"10",
      "parameterName":"Return line (BT3)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T07:43:29+00:00",
      "value":26.4,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"11",
      "parameterName":"Hot water top (BT7)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T08:14:17+00:00",
      "value":40.5,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"12",
      "parameterName":"Hot water char­ging (BT6)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T07:43:59+00:00",
      "value":39.8,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"13",
      "parameterName":"Brine in (BT10)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-25T21:06:24+00:00",
      "value":4.3,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"14",
      "parameterName":"Brine out (BT11)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T07:57:45+00:00",
      "value":0.5,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"15",
      "parameterName":"Con­denser (BT12)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T07:43:48+00:00",
      "value":28.5,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"16",
      "parameterName":"Discharge (BT14)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T08:10:01+00:00",
      "value":49.1,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"17",
      "parameterName":"Liquid line (BT15)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T07:47:05+00:00",
      "value":26.3,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"19",
      "parameterName":"Suction gas (BT17)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T08:22:11+00:00",
      "value":7.8,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"54",
      "parameterName":"Average temper­ature (BT1)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-25T16:02:24+00:00",
      "value":3.6,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"58",
      "parameterName":"Flow sensor (BF1)",
      "parameterUnit":"l/m",
      "writable":false,
      "timestamp":"2021-03-26T08:19:12+00:00",
      "value":9.1,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"64",
      "parameterName":"Current (BE1)",
      "parameterUnit":"A",
      "writable":false,
      "timestamp":"2021-03-26T05:24:41+00:00",
      "value":1.0,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"65",
      "parameterName":"Current (BE2)",
      "parameterUnit":"A",
      "writable":false,
      "timestamp":"2021-03-26T07:15:55+00:00",
      "value":0.8,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"66",
      "parameterName":"Current (BE3)",
      "parameterUnit":"A",
      "writable":false,
      "timestamp":"2021-03-26T08:18:05+00:00",
      "value":2.6,
      "strVal":""
   },
   {
      "category":"Muu talo",
      "parameterId":"98",
      "parameterName":"Return line (EP21-BT3)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T07:42:59+00:00",
      "value":25.4,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"781",
      "parameterName":"Degree minutes",
      "parameterUnit":"DM",
      "writable":true,
      "timestamp":"2021-03-26T08:22:24+00:00",
      "value":-91.0,
      "strVal":""
   },
   {
      "category":"Muu talo",
      "parameterId":"1707",
      "parameterName":"Calcu­lated supply climate system 2",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T06:29:39+00:00",
      "value":26.2,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"1708",
      "parameterName":"Calcu­lated supply climate system 1",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T05:57:38+00:00",
      "value":28.2,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"1965",
      "parameterName":"Oper­ating mode com­pressor",
      "parameterUnit":"",
      "writable":false,
      "timestamp":"2021-03-25T12:34:44+00:00",
      "value":60.0,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"1975",
      "parameterName":"Heating medium pump speed (GP1)",
      "parameterUnit":"%",
      "writable":false,
      "timestamp":"2021-03-26T07:41:22+00:00",
      "value":49.0,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"1977",
      "parameterName":"Brine pump speed (GP2)",
      "parameterUnit":"%",
      "writable":false,
      "timestamp":"2021-03-26T07:59:33+00:00",
      "value":19.0,
      "strVal":""
   },
   {
      "category":"Heat meter",
      "parameterId":"2716",
      "parameterName":"Hot water, includ­ing int. add. heat",
      "parameterUnit":"kWh",
      "writable":false,
      "timestamp":"2021-03-26T07:38:11+00:00",
      "value":668.0,
      "strVal":""
   },
   {
      "category":"Heat meter",
      "parameterId":"2717",
      "parameterName":"Heating, includ­ing int. add. heat",
      "parameterUnit":"kWh",
      "writable":false,
      "timestamp":"2021-03-26T08:21:29+00:00",
      "value":8432.1,
      "strVal":""
   },
   {
      "category":"Heat meter",
      "parameterId":"2720",
      "parameterName":"Hot water, com­pressor only",
      "parameterUnit":"kWh",
      "writable":false,
      "timestamp":"2021-03-26T07:38:11+00:00",
      "value":667.9,
      "strVal":""
   },
   {
      "category":"Heat meter",
      "parameterId":"2721",
      "parameterName":"Heating, com­pressor only",
      "parameterUnit":"kWh",
      "writable":false,
      "timestamp":"2021-03-26T08:21:29+00:00",
      "value":8432.2,
      "strVal":""
   },
   {
      "category":"Muu talo",
      "parameterId":"3670",
      "parameterName":"Heating offset climate system 2",
      "parameterUnit":"",
      "writable":true,
      "timestamp":"2021-03-25T12:19:52+00:00",
      "value":0.0,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"3671",
      "parameterName":"Heating offset climate system 1",
      "parameterUnit":"",
      "writable":true,
      "timestamp":"2021-03-22T14:23:42+00:00",
      "value":0.0,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"5927",
      "parameterName":"Current compres­sor fre­quency",
      "parameterUnit":"Hz",
      "writable":false,
      "timestamp":"2021-03-26T07:39:39+00:00",
      "value":21.0,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"7086",
      "parameterName":"More hot water",
      "parameterUnit":"",
      "writable":true,
      "timestamp":"2021-03-17T14:42:44+00:00",
      "value":0.0,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"10845",
      "parameterName":"Season over­view, brine in (EB100-BT10)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-25T17:21:59+00:00",
      "value":3.5,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"10863",
      "parameterName":"Season over­view, brine out (EB100-BT11)",
      "parameterUnit":"°C",
      "writable":false,
      "timestamp":"2021-03-26T07:57:32+00:00",
      "value":-0.1,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"10905",
      "parameterName":"Pump: Heating medium (GP1)",
      "parameterUnit":"",
      "writable":false,
      "timestamp":"2021-03-17T14:42:44+00:00",
      "value":1.0,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"10906",
      "parameterName":"Pump: Brine (GP2)",
      "parameterUnit":"",
      "writable":false,
      "timestamp":"2021-03-25T12:34:24+00:00",
      "value":1.0,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"55000",
      "parameterName":"Priority",
      "parameterUnit":"",
      "writable":false,
      "timestamp":"2021-03-26T07:39:22+00:00",
      "value":30.0,
      "strVal":""
   },
   {
      "category":"NIBE S1255-6 R EM 3X400V",
      "parameterId":"55027",
      "parameterName":"Int elec add heat",
      "parameterUnit":"",
      "writable":false,
      "timestamp":"2021-03-17T14:42:44+00:00",
      "value":5.0,
      "strVal":""
   }
]

querying /categories gives me an empty response.

The curl command to get the token would be:

curl -X POST "https://api.myuplink.com/oauth/token" -u '<client id>:<client secret>' -d 'grant_type=client_credentials&scope=READSYSTEM+WRITESYSTEM'

Then for subsequent requests you use:

curl -H 'Authorization: Bearer <your token>' ...