Domoticz RPC for NIBE Uplink

For heating/cooling related questions in Domoticz

Moderator: leecollings

devros
Posts: 183
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by devros »

sorry didnt have time to fix that script, should be quite easy (with my modification it works slave or master)
Maybe dirty solution would be run two script instances (one with modifed sourcecode). Or better to contact script autor to add support for slave devices...
vwg4
Posts: 5
Joined: Friday 19 October 2018 17:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by vwg4 »

...or I can just update/fix/further develop the script by myself... which I did.
It is now reading data for all Master's and Slave's. After all quite easy addition. The original script is well written, modular and well commented.
Need to test some more and finalize it thou.

What is the procedure to get it shared to others? Does script author "review" changes and update script in first post, or?
devros
Posts: 183
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by devros »

great :)
i think just post here updated script is fine for others
looks like original plugin autor isnt active...
devros
Posts: 183
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by devros »

vwg4 wrote: Monday 22 October 2018 13:37 ...or I can just update/fix/further develop the script by myself... which I did.
It is now reading data for all Master's and Slave's. After all quite easy addition. The original script is well written, modular and well commented.
Need to test some more and finalize it thou.

What is the procedure to get it shared to others? Does script author "review" changes and update script in first post, or?
Any chance to test your modifed script ?
vwg4
Posts: 5
Joined: Friday 19 October 2018 17:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by vwg4 »

Sure.
But let me finalize it first. (Need to find time Window for that)

Lähetetty minun G8231 laitteesta Tapatalkilla

Zinken

Re: Domoticz RPC for NIBE Uplink

Post by Zinken »

I got an email yesterday from Nibe saying "NIBE Uplink API will no longer support TLS 1.0 and 1.1."

That means this plugin will crash or burn, right?
devros
Posts: 183
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by devros »

yea received same email...
who knows, we will have to wait for change an try to fix auth code
LMER
Posts: 11
Joined: Tuesday 30 May 2017 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by LMER »

Here are some exampels for authentication in the new API. Anyone who knows how to fix?

Authentication Examples
Example: Authorization Code Grant
The Authorization Code Grant takes place in 4 steps as outlined below. Before starting to authenticate you need to have registered your application and received a client id and secret.
1. Redirect the user's browser to the OAuth2 authorization page.
Redirect the user's browser to the address outlined below. Make sure to exchange the [CLIENT_ID], [SCOPES] and [REDIRECT_URI] with the correct values for your application.
https://api.nibeuplink.com/oauth/author ... ate=[STATE]
2. The user authorizes your application.
The user will now be prompted with a login form (if not already logged in) and the question whether they would like to give your application access to their data.
3. The user is redirected to your application with authorization data.
When the user has authorized your application he/she will be redirected back to the redirect_uri you specified to the authorize endpoint with the data you need to gain access to the account. Always check that the state parameter returned is equal to the one supplied to the authorization endpoint.
[REDIRECT_URI]?code=[AUTHORIZATION_CODE]&state=[STATE]
4. Your application uses this authorization data to gain access to the account.
Using the data you received in the last step you can call the token endpoint and get an access token and a refresh token that can be used in the following communication.
POST /oauth/token HTTP/1.1
Host: api.nibeuplink.com
Content-Type: application/x-www-form-urlencoded;charset=UTF-8

grant_type=authorization_code&client_id=[CLIENT_ID]&client_secret=[CLIENT_SECRET]&code=[AUTHORIZATION_CODE]&redirect_uri=[REDIRECT_URI]&scope=[SCOPES]

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache

{
"access_token":[ACCESS_TOKEN],
"expires_in":300,
"refresh_token":[REFRESH_TOKEN],
"scope":[SCOPES],
"token_type":"bearer"
}
5. Authenticate the subsequent requests.
Once the access token has been retrieved it can be used immediately and until the expires_in seconds has passed to access resources in the NIBE Uplink API. To access token needs to be provided as a bearer token to the API endpoints.
GET /api/v1/systems HTTP/1.1
Host: api.nibeuplink.com
Authorization: Bearer [ACCESS_TOKEN]
Example: Refresh Token
Once the access token has been retrieved it can be used immediately and until the expires_in seconds has passed. After that the access token has to be renewed and this can be done using the refresh_token (only available in the Authorization Code Grant flow). This is done by calling the token endpoint with the refresh token.
POST /oauth/token HTTP/1.1
Host: api.nibeuplink.com
Content-Type: application/x-www-form-urlencoded;charset=UTF-8

grant_type=refresh_token&client_id=[CLIENT_ID]&client_secret=[CLIENT_SECRET]&refresh_token=[REFRESH_TOKEN]

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache

{
"access_token":[ACCESS_TOKEN],
"expires_in":300,
"refresh_token":[REFRESH_TOKEN],
}
Example: Authorization
To authorize your application with any of the API endpoints you need to provide the access token you get from the OAuth token endpoint as a bearer token in the Authorizaton HTTP header.

GET /api/v1/systems HTTP/1.1
Host: api.nibeuplink.com
Authorization: Bearer [ACCESS_TOKEN]
donnie
Posts: 1
Joined: Saturday 17 October 2015 10:10
Target OS: Windows
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by donnie »

What's the status on this plugin? Does it still work or is it considered broken due to changes NIBE made?
RVK1987
Posts: 3
Joined: Thursday 29 December 2016 18:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by RVK1987 »

Any one has a solution?? I want my heatpump back in my domoticz!
vwg4
Posts: 5
Joined: Friday 19 October 2018 17:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by vwg4 »

Funny. Mine is still working fine. Better not restart ;)

Lähetetty minun G8231 laitteesta Tapatalkilla

HierBenIk
Posts: 5
Joined: Saturday 09 September 2017 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by HierBenIk »

Has anyone a solution for the new way of authentication?
I cannot get any information out of the system and the logfiles show the following error message:
"Status: (Error) nibeuplink.py: You need to run 'python /home/pi/domoticz/scripts/NibeUplink/nibeuplink.py' from a console to obtain a new Authorization Code"
I tried to run the script but without success. Any idea how to solve this?
cezarysz
Posts: 4
Joined: Monday 22 July 2019 10:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by cezarysz »

vwg4 wrote: Monday 22 October 2018 13:37 ...or I can just update/fix/further develop the script by myself... which I did.
It is now reading data for all Master's and Slave's. After all quite easy addition. The original script is well written, modular and well commented.
Need to test some more and finalize it thou.

What is the procedure to get it shared to others? Does script author "review" changes and update script in first post, or?
Hi. Can you share your solution to read all Master and Slave's data?
cezarysz
Posts: 4
Joined: Monday 22 July 2019 10:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by cezarysz »

Did anyone tryed to get new Authorization Code?
showquerystrin.000webhostapp is showing "Website is no longer availabe" The authors have deleted this site.
Cossy
Posts: 3
Joined: Wednesday 11 September 2019 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by Cossy »

I did make a simple adjustment by changing the call back url to the following:

redirect_uri = "https://www.marshflattsfarm.org.uk/nibe ... /index.php" # Don't alter this or anything else!

Based on the blog post of: https://www.marshflattsfarm.org.uk/word ... ge_id=3480 which did the trick for me and it now working for multiple hours.

Tempting to do a cleanup later as well, anybody else still working on this code?
cezarysz
Posts: 4
Joined: Monday 22 July 2019 10:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by cezarysz »

Cossy wrote: Wednesday 11 September 2019 19:10 ... anybody else still working on this code?
Yes. Any idea how to read slave data in domoticz?
Cossy
Posts: 3
Joined: Wednesday 11 September 2019 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by Cossy »

cezarysz wrote: Wednesday 11 September 2019 19:26 Yes. Any idea how to read slave data in domoticz?
Sorry not fully sure what you mean with slave data, you mean getting the numbers from the nibe-uplink into the system for the logs and such?
So the counters and the values are represented. Or do you mean something else?
cezarysz
Posts: 4
Joined: Monday 22 July 2019 10:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by cezarysz »

Cossy wrote: Wednesday 11 September 2019 21:43
cezarysz wrote: Wednesday 11 September 2019 19:26 Yes. Any idea how to read slave data in domoticz?
Sorry not fully sure what you mean with slave data, you mean getting the numbers from the nibe-uplink into the system for the logs and such?
So the counters and the values are represented. Or do you mean something else?
I mean getting data from "slave unit" when you have split type pump.
Slave unit data you can read here:
https://www.nibeuplink.com/System/ID/St ... viceInfo/1

Nibeuplink.py can read only Master unit data from:
https://www.nibeuplink.com/System/ID/St ... viceInfo/0
vwg4
Posts: 5
Joined: Friday 19 October 2018 17:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by vwg4 »

cezarysz wrote:
vwg4 wrote: Monday 22 October 2018 13:37 ...or I can just update/fix/further develop the script by myself... which I did.
It is now reading data for all Master's and Slave's. After all quite easy addition. The original script is well written, modular and well commented.
Need to test some more and finalize it thou.

What is the procedure to get it shared to others? Does script author "review" changes and update script in first post, or?
Hi. Can you share your solution to read all Master and Slave's data?
I can check if I have this still somewhere. My raspi died At spring, have not yet fixed. Probably will Need New auth method update...

Lähetetty minun G8231 laitteesta Tapatalkilla

Cossy
Posts: 3
Joined: Wednesday 11 September 2019 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz RPC for NIBE Uplink

Post by Cossy »

vwg4 wrote: Wednesday 11 September 2019 22:17 I can check if I have this still somewhere. My raspi died At spring, have not yet fixed. Probably will Need New auth method update...
That would be great, especially when it not hard coded, so it can adapt to any solution. Otherwise I might need to add an option to give additional ID's for the sub systems. By adding questions to install script.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests