Netatmo authentication changes Oct 2022

Moderator: leecollings

cadkey
Posts: 14
Joined: Wednesday 19 March 2025 17:08
Target OS: Linux
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by cadkey »

You can follow my post above to check your access_token and access to the Netatmo server.
DomoFlits
Posts: 39
Joined: Thursday 06 October 2016 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Bld16583
Location: The Netherlands
Contact:

Re: Netatmo authentication changes Oct 2022

Post by DomoFlits »

jcb2 wrote: Monday 24 March 2025 12:01 always one other error : "No access granted, forcing login again (Refresh tokens): invalid_client"
You have another error than most of us here have. We have:
Invalid/no data received (refresh tokens)... HTTP/2 403

You should check your client ID, Client secret and tick the scope(s) you own in Domoticz.
chrominator
Posts: 19
Joined: Sunday 25 December 2016 7:27
Target OS: Linux
Domoticz version: 2024.7
Contact:

Re: Netatmo authentication changes Oct 2022

Post by chrominator »

Log with new PR #6281:
Capture d'écran 2025-03-24 163250.png
Capture d'écran 2025-03-24 163250.png (20.9 KiB) Viewed 1918 times
... Waiting for 45 mn.... Keep you posted.
phil35
Posts: 21
Joined: Wednesday 02 September 2020 8:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: France
Contact:

Re: Netatmo authentication changes Oct 2022

Post by phil35 »

Hello,
@jpaul : I am this owner of netatmo_manage_tokens.php , and it works like a a charm. I tested every day with the other script netatmo-floodlight Public , by these days ;-) ,
The archictecture is:
sonoff button -> domoticz via zigbee -> a script handles (one click, double click and long click) and uses the access_token, stored and managed by netatmo_manage_tokens.php to perform the action on the camera.
[https://www.domadoo.fr/fr/peripheriques ... ee-30.html]

What is the build number 16583? and where to find it?
on the domoticz download page there is only stable 2024.7.16140 or beta 2024.7.16586
Thank you.
Phil
Last edited by phil35 on Monday 24 March 2025 16:59, edited 1 time in total.
Production platform uses domoticz v2023.1
Production platform (for Netatmo and Zigbee) uses domoticz v2024.7
chrominator
Posts: 19
Joined: Sunday 25 December 2016 7:27
Target OS: Linux
Domoticz version: 2024.7
Contact:

Re: Netatmo authentication changes Oct 2022

Post by chrominator »

chrominator wrote: Monday 24 March 2025 16:36 Log with new PR #6281:

... Waiting for 45 mn.... Keep you posted.
No time to wait.
Added some debug lines to the source:
Capture d'écran 2025-03-24 164811.png
Capture d'écran 2025-03-24 164811.png (56.89 KiB) Viewed 1913 times
compile and restart:

Got a good reply from the Netatmo server then, it worked directly, no relation with my changes in the source.
Capture d'écran 2025-03-24 164029.png
Capture d'écran 2025-03-24 164029.png (52.24 KiB) Viewed 1913 times
Still working randomly, I'm saved probably until the next restart.
jcb2
Posts: 34
Joined: Wednesday 04 January 2023 7:30
Target OS: Linux
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by jcb2 »

With last beta, after one renew of ID and password and one restart I have always one error :

2025-03-24 17:52:28.197 Status: Domoticz V2025.1 (build 16586) (c)2012-2025 GizMoCuz
2025-03-24 17:52:37.668 Error: Météo: Invalid/no data received (refresh tokens)... HTTP/2 403

When I try to use the button connexion into hardware I have this error :
2025-03-24_11-13-44.png
2025-03-24_11-13-44.png (68.24 KiB) Viewed 1896 times
jpaul
Posts: 16
Joined: Saturday 30 December 2017 8:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Contact:

Re: Netatmo authentication changes Oct 2022

Post by jpaul »

Hello @phil35,
phil35 wrote: Monday 24 March 2025 16:43 I am this owner of netatmo_manage_tokens.php , and it works like a a charm.
I know your module netatmo_manage_tokens.php works. But I had to create a new App on dev.netmatmo website. With my historical App, used by Domoticz for a while, I'm unable to refresh the token with netatmo_manage_tokens.php (even when Netmatmo plugin is disabled in Domoticz).
That's why I suspect Netatmo of banning or blacklisting some Apps when they generate with too many errors.
jpaul
Posts: 16
Joined: Saturday 30 December 2017 8:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Contact:

Re: Netatmo authentication changes Oct 2022

Post by jpaul »

Hi dev team,

Could it be an issue with the HTTPClient lib ?
I added debug in httpclient/HTTPClient.cpp , this line
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
in HTTPClient::POSTBinary and HTTPClient::GETBinary methods,
and it seems the headers are not exactly the same between Domotiz and netatmo_manage_tokens.php
homeJLB
Posts: 109
Joined: Tuesday 16 October 2018 23:01
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Belgium
Contact:

Re: Netatmo authentication changes Oct 2022

Post by homeJLB »

jcb2 wrote: Monday 24 March 2025 12:01 Hello,
One new PR is available into new beta about issue of Netatmo.
For me this is always not good. I have wait 20 minutes but always one other error : "No access granted, forcing login again (Refresh tokens): invalid_client"
I have check and check again, make a new app but nothing ...
With this Error You are having a issue with your ClientID or ClientSecret, maybe you have a space in front or in back.
homeJLB
Posts: 109
Joined: Tuesday 16 October 2018 23:01
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Belgium
Contact:

Re: Netatmo authentication changes Oct 2022

Post by homeJLB »

jpaul wrote: Monday 24 March 2025 19:32 Hi dev team,

Could it be an issue with the HTTPClient lib ?
I added debug in httpclient/HTTPClient.cpp , this line
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
in HTTPClient::POSTBinary and HTTPClient::GETBinary methods,
and it seems the headers are not exactly the same between Domotiz and netatmo_manage_tokens.php
As a user off Domoticz myself I invested time in the New-API from Netatmo
The authentication and the HTTPClient library I have less experience with but I'm willing to test and find a solution.

kind regards
homeJLB
Posts: 109
Joined: Tuesday 16 October 2018 23:01
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Belgium
Contact:

Re: Netatmo authentication changes Oct 2022

Post by homeJLB »

chrominator wrote: Monday 24 March 2025 16:56
chrominator wrote: Monday 24 March 2025 16:36 Log with new PR #6281:

... Waiting for 45 mn.... Keep you posted.
No time to wait.
Added some debug lines to the source:
Capture d'écran 2025-03-24 164811.png

compile and restart:

Got a good reply from the Netatmo server then, it worked directly, no relation with my changes in the source.
Capture d'écran 2025-03-24 164029.png

Still working randomly, I'm saved probably until the next restart.
If you enable Debug on Domoticz then you can see the httpUrl and httpData without any changes

Code: Select all

Debug(DEBUG_HARDWARE, "Netatmo URL %s with %s", httpUrl.c_str(), httpData.c_str());
for enabeling Debug on a Domoticz.service for example;

Code: Select all

      ExecStart=/domoticz/domoticz -www 8080 -sslwww 443 -log "/var/log/domoticz-1.log" -loglevel all -debuglevel normal,hardware
#      ExecStart=/domoticz/domoticz -www 8080 -sslwww 443 -log "/var/log/domoticz-1.log" -loglevel all
with the # you can easily change between the normal and debug. (comment out the unused line)

kind regards
jcb2
Posts: 34
Joined: Wednesday 04 January 2023 7:30
Target OS: Linux
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by jcb2 »

OK I have found one error into my config : I have now cleared the field redirect URI. OK I have the page for accepting the scope.

Now I have these errors :
2025-03-25 11:42:57.920 Error: Météo: Error connecting to Server (refresh tokens): HTTP/1.1 28 Timeout was reached
2025-03-25 11:42:57.920 Status: Météo: Login 0
2025-03-25 11:43:00.279 Status: [web:8080] Incoming connection from: 127.0.0.1
2025-03-25 11:43:27.927 Status: Météo: Use refresh token from database...
2025-03-25 11:43:27.933 Status: Météo: Requesting refreshed tokens
2025-03-25 11:43:28.190 Error: Météo: Invalid/no data received (refresh tokens)... HTTP/2 403
2025-03-25 11:43:28.191 Status: Météo: Retry LOGIN within 45 min.
2025-03-25 11:43:28.192 Status: Météo: Login 0
User avatar
waltervl
Posts: 5759
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Netatmo authentication changes Oct 2022

Post by waltervl »

The wiki https://wiki.domoticz.com/Netatmo has been updated to show hopefully the correct way of adding/modifying the software.
This implementation of adding Netatmo in Domoticz is very different from any other plugin/gateway.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
jcb2
Posts: 34
Joined: Wednesday 04 January 2023 7:30
Target OS: Linux
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by jcb2 »

Hello,
After many try I have one connexion.
But no update of my devices. I have deleted all devices and hope one automatic new creation (with params for allow new device) but nothing !
One idea ?
Thanks,
Jean-Charles

Log :
2025-03-25 21:14:01.982 Status: Météo: Use refresh token from database...
2025-03-25 21:14:01.982 Status: Météo: Requesting refreshed tokens
2025-03-25 21:14:02.423 Status: Météo: We refresh our token ...
2025-03-25 21:14:02.423 Status: Météo: Login 1
2025-03-25 21:14:02.639 Status: Météo: Station Data parsed Buanderie
2025-03-25 21:14:02.640 Status: Météo: Station Data parsed Météo abri
2025-03-25 21:14:02.640 Status: Météo: Weather 1
2025-03-25 21:14:02.640 Status: Météo: Get HomesData Details
2025-03-25 21:14:02.902 Status: Météo: Home id METEO updated.
2025-03-25 21:14:02.902 Status: Météo: Home id Buanderie et cave updated.
2025-03-25 21:14:02.902 Status: Météo: Home id Abri et serre updated.
2025-03-25 21:14:02.902 Status: Météo: Home Status Details, size (number of homes) is 3
2025-03-25 21:14:03.829 Status: Météo: Parse Persons
2025-03-25 21:14:03.829 Status: Météo: HomeStatus parsed
2025-03-25 21:14:04.106 Status: Météo: Scenarios Data Recieved
2025-03-25 21:14:04.284 Status: Météo: Parse Persons
2025-03-25 21:14:04.285 Status: Météo: HomeStatus parsed
2025-03-25 21:14:04.513 Status: Météo: Scenarios Data Recieved
2025-03-25 21:14:04.514 Status: Météo: Status 1
homeJLB
Posts: 109
Joined: Tuesday 16 October 2018 23:01
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Belgium
Contact:

Re: Netatmo authentication changes Oct 2022

Post by homeJLB »

jcb2 wrote: Tuesday 25 March 2025 21:21 Hello,
After many try I have one connexion.
But no update of my devices. I have deleted all devices and hope one automatic new creation (with params for allow new device) but nothing !
One idea ?
Thanks,
Jean-Charles

Log :
2025-03-25 21:14:01.982 Status: Météo: Use refresh token from database...
2025-03-25 21:14:01.982 Status: Météo: Requesting refreshed tokens
2025-03-25 21:14:02.423 Status: Météo: We refresh our token ...
2025-03-25 21:14:02.423 Status: Météo: Login 1
2025-03-25 21:14:02.639 Status: Météo: Station Data parsed Buanderie
2025-03-25 21:14:02.640 Status: Météo: Station Data parsed Météo abri
2025-03-25 21:14:02.640 Status: Météo: Weather 1
2025-03-25 21:14:02.640 Status: Météo: Get HomesData Details
2025-03-25 21:14:02.902 Status: Météo: Home id METEO updated.
2025-03-25 21:14:02.902 Status: Météo: Home id Buanderie et cave updated.
2025-03-25 21:14:02.902 Status: Météo: Home id Abri et serre updated.
2025-03-25 21:14:02.902 Status: Météo: Home Status Details, size (number of homes) is 3
2025-03-25 21:14:03.829 Status: Météo: Parse Persons
2025-03-25 21:14:03.829 Status: Météo: HomeStatus parsed
2025-03-25 21:14:04.106 Status: Météo: Scenarios Data Recieved
2025-03-25 21:14:04.284 Status: Météo: Parse Persons
2025-03-25 21:14:04.285 Status: Météo: HomeStatus parsed
2025-03-25 21:14:04.513 Status: Météo: Scenarios Data Recieved
2025-03-25 21:14:04.514 Status: Météo: Status 1
For answering this you need to enable debug to see which devices are received?

Did you use 16586 ?
jcb2
Posts: 34
Joined: Wednesday 04 January 2023 7:30
Target OS: Linux
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by jcb2 »

Hello,
Yes it is with version 16586.
But the connection up durring the night and is down this morning.
Very strange. Below I provide the log about this error and hope it is an help.
Thanks,
Jean-Charles

Log this night and morning :
2025-03-26 02:29:31.744 Status: Météo: Use refresh token from database...
2025-03-26 02:29:31.744 Status: Météo: Requesting refreshed tokens
2025-03-26 02:29:31.928 Status: Météo: Retry LOGIN within 45 min.
2025-03-26 02:29:31.928 Status: Météo: Login 0
2025-03-26 03:14:32.306 Status: Météo: Use refresh token from database...
2025-03-26 03:14:32.306 Status: Météo: Requesting refreshed tokens
2025-03-26 03:14:32.505 Status: Météo: Retry LOGIN within 45 min.
2025-03-26 03:14:32.505 Status: Météo: Login 0
2025-03-26 03:59:32.876 Status: Météo: Use refresh token from database...
2025-03-26 03:59:32.876 Status: Météo: Requesting refreshed tokens
2025-03-26 03:59:33.052 Status: Météo: Retry LOGIN within 45 min.
2025-03-26 03:59:33.052 Status: Météo: Login 0
2025-03-26 04:44:33.447 Status: Météo: Use refresh token from database...
2025-03-26 04:44:33.447 Status: Météo: Requesting refreshed tokens
2025-03-26 04:44:33.606 Status: Météo: Retry LOGIN within 45 min.
2025-03-26 04:44:33.607 Status: Météo: Login 0
2025-03-26 05:29:34.000 Status: Météo: Use refresh token from database...
2025-03-26 05:29:34.000 Status: Météo: Requesting refreshed tokens
2025-03-26 05:29:34.174 Status: Météo: Retry LOGIN within 45 min.
2025-03-26 05:29:34.175 Status: Météo: Login 0
2025-03-26 06:14:34.546 Status: Météo: Use refresh token from database...
2025-03-26 06:14:34.546 Status: Météo: Requesting refreshed tokens
2025-03-26 06:14:34.712 Status: Météo: Retry LOGIN within 45 min.
2025-03-26 06:14:34.712 Status: Météo: Login 0
2025-03-26 06:59:35.079 Status: Météo: Use refresh token from database...
2025-03-26 06:59:35.079 Status: Météo: Requesting refreshed tokens
2025-03-26 06:59:35.252 Error: Météo: Invalid/no data received (refresh tokens)... HTTP/2 403
2025-03-26 06:59:35.252 Status: Météo: Retry LOGIN within 45 min.
2025-03-26 06:59:35.252 Status: Météo: Login 0
2025-03-26 07:44:35.614 Status: Météo: Use refresh token from database...
2025-03-26 07:44:35.614 Status: Météo: Requesting refreshed tokens
2025-03-26 07:44:35.786 Error: Météo: Invalid/no data received (refresh tokens)... HTTP/2 403
2025-03-26 07:44:35.786 Status: Météo: Retry LOGIN within 45 min.
2025-03-26 07:44:35.786 Status: Météo: Login 0
2025-03-26 07:46:45.118 Status: Météo: Worker stopped...

Into debug mode I have these informations :

Error :
2025-03-26 08:16:46.736 [7fd1ce7fc6c0] Error: Météo: Invalid/no data received (refresh tokens)... HTTP/2 403
Log info :
2025-03-26 08:16:46.568 [7fd1ce7fc6c0] Debug: Météo: Netatmo URL https://api.netatmo.com/oauth2/token? with grant_type=refresh_token&refresh_token=5f4d36d****************&client_id=67e2ee72e3***********&client_secret=CVGzSpWbyw*********************
2025-03-26 08:16:46.730 [7fd1ce7fc6c0] Debug: Météo: Netatmo Invalid ... <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
2025-03-26 08:16:46.730 <html xmlns='http://www.w3.org/1999/xhtml'>
2025-03-26 08:16:46.730
2025-03-26 08:16:46.730 <head>
2025-03-26 08:16:46.730 <meta content='text/html; charset=utf-8' http-equiv='content-type' />
2025-03-26 08:16:46.730 <style type='text/css'>
2025-03-26 08:16:46.730 body {
2025-03-26 08:16:46.730 font-family: Arial;
2025-03-26 08:16:46.730 margin-left: 40px;
2025-03-26 08:16:46.730 }
2025-03-26 08:16:46.730
2025-03-26 08:16:46.730 img {
2025-03-26 08:16:46.730 border: 0 none;
2025-03-26 08:16:46.730 }
2025-03-26 08:16:46.730
2025-03-26 08:16:46.730 #content {
2025-03-26 08:16:46.730 margin-left: auto;
2025-03-26 08:16:46.730 margin-right: auto
2025-03-26 08:16:46.730 }
2025-03-26 08:16:46.730
2025-03-26 08:16:46.730 #message h1 {
2025-03-26 08:16:46.730 font-size: 24px;
2025-03-26 08:16:46.730 font-weight: normal;
2025-03-26 08:16:46.730 color: #000000;
2025-03-26 08:16:46.730 margin: 34px 0px 0px 0px
2025-03-26 08:16:46.730 }
2025-03-26 08:16:46.730
2025-03-26 08:16:46.730 #message h2 {
2025-03-26 08:16:46.730 font-size: 20px;
2025-03-26 08:16:46.730 font-weight: normal;
2025-03-26 08:16:46.730 color: #000000;
2025-03-26 08:16:46.730 margin: 34px 0px 0px 0px
2025-03-26 08:16:46.730 }
2025-03-26 08:16:46.730
2025-03-26 08:16:46.730 #message p {
2025-03-26 08:16:46.730 font-size: 16px;
2025-03-26 08:16:46.730 color: #000000;
2025-03-26 08:16:46.730 margin: 8px 0px 0px 0px
2025-03-26 08:16:46.730 }
2025-03-26 08:16:46.730
2025-03-26 08:16:46.730 #message hr {
2025-03-26 08:16:46.730 margin: 15px 0px
2025-03-26 08:16:46.730 }
2025-03-26 08:16:46.730
2025-03-26 08:16:46.730 #errorref {
2025-03-26 08:16:46.730 font-size: 11px;
2025-03-26 08:16:46.730 color: #737373;
2025-03-26 08:16:46.730 margin-top: 41px
2025-03-26 08:16:46.730 }
2025-03-26 08:16:46.730 </style>
2025-03-26 08:16:46.730 <title>Service unavailable</title>
2025-03-26 08:16:46.730 </head>
2025-03-26 08:16:46.730
2025-03-26 08:16:46.730 <body>
2025-03-26 08:16:46.730 <div id='content'>
2025-03-26 08:16:46.730 <div id='message'>
2025-03-26 08:16:46.730 <h2>The request is blocked.</h2>
2025-03-26 08:16:46.730 </div>
2025-03-26 08:16:46.730 <div id='errorref'>
2025-03-26 08:16:46.730 <span>20250326T071646Z-185fd8ffd9fqklwzhC1BRUcv2400000004p0000000006t6y </span>
2025-03-26 08:16:46.730 </div>
2025-03-26 08:16:46.730 </div>
2025-03-26 08:16:46.730 </body>
2025-03-26 08:16:46.730 </html>
2025-03-26 08:16:46.730
2025-03-26 08:16:46.737 [7fd1ce7fc6c0] Debug: Météo: Refresh Token Flag 1 ...
homeJLB
Posts: 109
Joined: Tuesday 16 October 2018 23:01
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Belgium
Contact:

Re: Netatmo authentication changes Oct 2022

Post by homeJLB »

My test system did also have a block after the 20 min wait.
so I stopped that system and restart today.

Code: Select all

 2025-03-25 19:38:10.509  Error: Netatmo: Invalid/no data received (refresh tokens)... HTTP/2 403 
2025-03-25 19:38:10.513  Status: Netatmo: Retry LOGIN within 45 min. 
2025-03-25 19:38:10.513  Debug: Netatmo: Refresh Token Flag 1 ...
2025-03-25 19:38:10.513  Status: Netatmo: Login 0

2025-03-25 19:38:21.784  Status: Mainworker Stopped...

2025-03-26 20:09:34.060  Status: Netatmo: Status 1
So sometimes the wait is needed and longer or you can make a new App on dev.netatmo.com

Kind regards
ninicob93
Posts: 15
Joined: Monday 14 March 2022 15:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by ninicob93 »

Hi,

i have the same problem. Have you found a solution?
Abidos
Posts: 1
Joined: Thursday 27 March 2025 15:15
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by Abidos »

Hi,

As far as I'm concerned, I had exactly the same problem.
After seeing "Retry LOGIN within 45 min." several times, I decided to reauthenticate. With no success. Then I rebooted my RPI: that did the trick! After reboot, it worked.
It's worth giving it a try... ;)
ninicob93
Posts: 15
Joined: Monday 14 March 2022 15:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by ninicob93 »

Abidos wrote: Thursday 27 March 2025 15:26 Hi,

As far as I'm concerned, I had exactly the same problem.
After seeing "Retry LOGIN within 45 min." several times, I decided to reauthenticate. With no success. Then I rebooted my RPI: that did the trick! After reboot, it worked.
It's worth giving it a try... ;)
Thanks. For my part I found the solution by allowing the addition of equipment. Another NETATMO device was added and everything was in order. Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest