Netatmo authentication changes Oct 2022

Moderator: leecollings

wrietvel
Posts: 5
Joined: Wednesday 19 March 2025 15:12
Target OS: Windows
Domoticz version: 2025.1
Contact:

Re: Netatmo authentication changes Oct 2022

Post by wrietvel »

Following my previous post, to be complete, I am on Domoticz Version: 2025.1 (build 16581)
leef22
Posts: 4
Joined: Friday 18 November 2022 14:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by leef22 »

I made it work yesterday in the beta. After upgrade to build 16581, it's not working again and I can't make it work event after disabling and enabling after few hours - reauthentication or deleting and adding again. :( It ends with " Error: Netatmo: Invalid/no data received (refresh tokens)... HTTP/2 403 "
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 »

When using the latest Beta, and disable the Netatmo Hardware.

Than re-enable the Hardware and you see the blocking Error
Also on the Hardware page when you select the Netatmo Hardware you see the Yellow message that the Tokens are not correct.

Then you click on the login button.

You will see a pop-up with the redirect to Netatmo authenthication and you must agree with the Connection from the App.

After this my setup is working with all my devices.

Also done this with a new installation.


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 »

So I to make the Login procedure clear;
Login 1.png
Login 1.png (27.17 KiB) Viewed 1042 times
Klik Login button
Login 2.png
Login 2.png (36.29 KiB) Viewed 1042 times
Give Login from Netatmo (E-mail and Password)

When correct you see a configuration Message;
Login 3.png
Login 3.png (26.09 KiB) Viewed 1042 times
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 »

Then you get A confirmation Question;
Login 4.png
Login 4.png (30.92 KiB) Viewed 1041 times
you scroll to the bottom and click: "yes, I accept"
Login 5.png
Login 5.png (56.6 KiB) Viewed 1041 times
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 »

Great that if worked for you
unfortunately here I am still stuck (using beta 2025.1 build 16581)

Created a new app in dev.netatmo.com
In Domoticz I'v entered the Client ID and Client Secret and selected the weather station.
enabled the netatmo
used the login button.
Log says no:

Code: Select all

2025-03-19 22:10:24.247 Status: Netatmo2: Use refresh token from database...
2025-03-19 22:10:24.247 Status: Netatmo2: Requesting refreshed tokens
2025-03-19 22:10:24.368 Error: Netatmo2: Invalid/no data received (refresh tokens)... HTTP/2 403
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 »

I identified the problem. homestatus no longer works with a URL request as shown in netatmo.dev, only works with a cURL request like this one in PHP that I use via a class:

protected $_apiurl = 'https://api.netatmo.net/';

NO LONGER WORKS with URL request
Edit: Working again after Netatmo fixed the bug this morning

public function getHomestatus()
{
$api_url = $this->_apiurl.'api/homestatus?home_id='.$this->_homeID.'&device_types=NLG&access_token='.$this->_accesstoken;
$response = @file_get_contents($api_url, false);
if ($response === false) return false;
$jsonDatas = json_decode($response, true);
return $jsonDatas['body']['home'];
}

WORKS with cURL request:

public function getHomestatus()
{
$author = 'Authorization: Bearer '.$this->_accesstoken;
$api_url = $this->_apiurl.'api/homestatus?home_id='.$this->_homeID.'&device_types=NLG';
$curl = curl_init($api_url);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$headers = array('accept: application/json',$author,'Content-Type: application/json',);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($curl);
curl_close($curl);
if ($response === false) return false;
$jsonDatas = json_decode($response, true);
return $jsonDatas['body']['home'];
}


Adapt the code according to your use of a function or a class 😉
Last edited by cadkey on Thursday 20 March 2025 15:01, edited 1 time in total.
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 »

Do you get the 5 screens like I posted ?
You must first enable the Hardware and then you enter Client ID / Client Secret and select the correct scope for your device

If you make to much request on the server then your app gets blocked is my understanding.
So I recommend a 30 minutes disable the Netatmo Hardware
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 »

This login procedure I have running on 16579 with docker and 16598 cloned from GitHub
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 »

I am already logged in, so screen 2 and 3 are skipped with me.
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 »

cadkey wrote: Wednesday 19 March 2025 22:24 I identified the problem. homestatus no longer works with a URL request as shown in netatmo.dev, only works with a cURL request like this one in PHP that I use via a class:

protected $_apiurl = 'https://api.netatmo.net/';

NO LONGER WORKS with URL request

public function getHomestatus()
{
$api_url = $this->_apiurl.'api/homestatus?home_id='.$this->_homeID.'&device_types=NLG&access_token='.$this->_accesstoken;
$response = @file_get_contents($api_url, false);
if ($response === false) return false;
$jsonDatas = json_decode($response, true);
return $jsonDatas['body']['home'];
}

WORKS with cURL request:

public function getHomestatus()
{
$author = 'Authorization: Bearer '.$this->_accesstoken;
$api_url = $this->_apiurl.'api/homestatus?home_id='.$this->_homeID.'&device_types=NLG';
$curl = curl_init($api_url);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$headers = array('accept: application/json',$author,'Content-Type: application/json',);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($curl);
curl_close($curl);
if ($response === false) return false;
$jsonDatas = json_decode($response, true);
return $jsonDatas['body']['home'];
}


Adapt the code according to your use of a function or a class 😉
In the Beta we use the

Code: Select all

#define NETATMO_API_URI "https://api.netatmo.com/"
as described by https://dev.netatmo.com/apidocumentation/oauth
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 »

DomoFlits wrote: Wednesday 19 March 2025 22:53 I am already logged in, so screen 2 and 3 are skipped with me.
Do you see the yellow tekst in the Hardware Page ?
can you try to refresh your browser hardware page after enabling and then click the Login button when you see the yellow tekst.

Kind regards
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 »

homeJLB wrote: Wednesday 19 March 2025 23:29 In the Beta we use the

Code: Select all

#define NETATMO_API_URI "https://api.netatmo.com/"
as described by https://dev.netatmo.com/apidocumentation/oauth
Check with nslookup, api.netatmo.com and api.netatmo.net return the same IP addresses. I use both.
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 »

homeJLB wrote: Wednesday 19 March 2025 23:36
DomoFlits wrote: Wednesday 19 March 2025 22:53 I am already logged in, so screen 2 and 3 are skipped with me.
Do you see the yellow tekst in the Hardware Page ?
can you try to refresh your browser hardware page after enabling and then click the Login button when you see the yellow tekst.

Kind regards
Yes I have the yellow text (otherwise the button will be greyed out.)
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 »

Issue fixed with Netatmo, both query methods are now functional again. Everything is back to normal. 👍
dgilbert2
Posts: 95
Joined: Wednesday 16 August 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: UK
Contact:

Re: Netatmo authentication changes Oct 2022

Post by dgilbert2 »

homeJLB wrote: Wednesday 19 March 2025 21:42 When using the latest Beta, and disable the Netatmo Hardware.

Than re-enable the Hardware and you see the blocking Error...........
I'm in the same position as @DomoFlits, I have followed your specific advice but cannot get past "Error: Netatmo: Invalid/no data received".

Have you also experienced this particular error at some point?
leef22
Posts: 4
Joined: Friday 18 November 2022 14:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by leef22 »

cadkey wrote: Thursday 20 March 2025 10:20 Issue fixed with Netatmo, both query methods are now functional again. Everything is back to normal. 👍
What version are you on? What was your solution?
On beta 16581 all tries (remove and add, reauthenticate) ends with the same error " Error: Netatmo: Invalid/no data received (refresh tokens)... HTTP/2 403 " and the yellow message in the hardware page: tokens are invalid or expired. Funny is, the the beta version before seems to be running ok. :( Api.netatmo.com and api.netatmo.net resolve correctly to the same address.
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 »

Hi @cadkey :-)
hum no sure it was really fixed, as It doesn't work now, I checked twice
see my post dated "Tuesday 18 March 2025 16:59"
Phil
Production platform uses domoticz v2023.1
Production platform (for Netatmo and Zigbee) uses domoticz v2024.7
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 »

@phil35
In PHP there are no more problems related to this failure.
I wasn't using a cURL query, I wrote the code yesterday and it worked directly, before this morning's fix. This morning's fix on the Netatmo side allowed my old URL query to work as before. I published my codes if it can help. I make calls to the API every minute and since I wrote the cURL query no errors, which is extremely rare with the homestatus query. At the same time I retested my URL query which was no longer working and it works since the Netatmo update this morning. In my opinion the API was modified yesterday morning, and only the URL query was bugged. For the cURL query I wrote it last night because I wasn't using it, and it worked without any problem by strictly following the homestatus API documentation. Check that you are strictly like the documentation, otherwise take my code with the cURL lines that you can adapt if you call a PHP function.
I only registered on this forum hoping to find a solution, as I don't use Domoticz. I suspected that the URL request could be problematic, so I searched on the cURL request side and posted the complete PHP code.
It is possible that the Netatmo API integration or plugin must be rewritten or modified in Domoticz. Ask the developer.
Last edited by cadkey on Thursday 20 March 2025 16:55, edited 2 times in total.
wrietvel
Posts: 5
Joined: Wednesday 19 March 2025 15:12
Target OS: Windows
Domoticz version: 2025.1
Contact:

Re: Netatmo authentication changes Oct 2022

Post by wrietvel »

The new Netatmo login method as on 16581 stil does not work. Same problem as since Tuesday.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest