Page 6 of 9

Re: Domoticz RPC for NIBE Uplink

Posted: Sunday 21 October 2018 0:31
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...

Re: Domoticz RPC for NIBE Uplink

Posted: Monday 22 October 2018 13:37
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?

Re: Domoticz RPC for NIBE Uplink

Posted: Monday 22 October 2018 14:33
by devros
great :)
i think just post here updated script is fine for others
looks like original plugin autor isnt active...

Re: Domoticz RPC for NIBE Uplink

Posted: Tuesday 23 October 2018 23:05
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 ?

Re: Domoticz RPC for NIBE Uplink

Posted: Wednesday 24 October 2018 6:25
by vwg4
Sure.
But let me finalize it first. (Need to find time Window for that)

Lähetetty minun G8231 laitteesta Tapatalkilla


Re: Domoticz RPC for NIBE Uplink

Posted: Friday 23 November 2018 9:52
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?

Re: Domoticz RPC for NIBE Uplink

Posted: Friday 23 November 2018 11:35
by devros
yea received same email...
who knows, we will have to wait for change an try to fix auth code

Re: Domoticz RPC for NIBE Uplink

Posted: Tuesday 27 November 2018 16:45
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]

Re: Domoticz RPC for NIBE Uplink

Posted: Wednesday 06 February 2019 8:47
by donnie
What's the status on this plugin? Does it still work or is it considered broken due to changes NIBE made?

Re: Domoticz RPC for NIBE Uplink

Posted: Thursday 28 February 2019 20:42
by RVK1987
Any one has a solution?? I want my heatpump back in my domoticz!

Re: Domoticz RPC for NIBE Uplink

Posted: Thursday 28 February 2019 20:57
by vwg4
Funny. Mine is still working fine. Better not restart ;)

Lähetetty minun G8231 laitteesta Tapatalkilla


Re: Domoticz RPC for NIBE Uplink

Posted: Tuesday 02 April 2019 19:16
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?

Re: Domoticz RPC for NIBE Uplink

Posted: Monday 22 July 2019 10:39
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?

Re: Domoticz RPC for NIBE Uplink

Posted: Thursday 25 July 2019 9:01
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.

Re: Domoticz RPC for NIBE Uplink

Posted: Wednesday 11 September 2019 19:10
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?

Re: Domoticz RPC for NIBE Uplink

Posted: Wednesday 11 September 2019 19:26
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?

Re: Domoticz RPC for NIBE Uplink

Posted: Wednesday 11 September 2019 21:43
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?

Re: Domoticz RPC for NIBE Uplink

Posted: Wednesday 11 September 2019 22:10
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

Re: Domoticz RPC for NIBE Uplink

Posted: Wednesday 11 September 2019 22:17
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


Re: Domoticz RPC for NIBE Uplink

Posted: Thursday 12 September 2019 14:36
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.