Netatmo authentication changes Oct 2022

Moderator: leecollings

DomoFlits
Posts: 36
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 »

It is working for me at the moment after 2 weeks of trying various solutions :D

My steps:
* I'm running the beta: Version: 2025.1 (build 16583)
* I've had the Netatmo hardware disabled for days,
* I've rebooted the pi
* Wait half a day
* Created new app in dev.netatmo.com
* Domoticz settings: allow new hardware/sensors
* Created new Netatmo hardware (with the codes of the new app)
* Logged in

Now I have a new Netatmo hardware device with new sensors in the devices list. (Old Netatmo hardware is still disabled)

Code: Select all

2025-03-27 17:35:24.890 Status: Netatmo4: Worker started...
2025-03-27 17:35:29.891 Status: Netatmo4: Use refresh token from database...
2025-03-27 17:35:29.891 Status: Netatmo4: Requesting refreshed tokens
2025-03-27 17:35:30.590 Status: Netatmo4: Station Data parsed
2025-03-27 17:35:30.590 Status: Netatmo4: Weather 1
2025-03-27 17:35:30.590 Status: Netatmo4: Get HomesData Details
2025-03-27 17:35:30.590 Netatmo4: Temp + Humidity + Baro (Indoor)
2025-03-27 17:35:30.591 Netatmo4: Air Quality (Indoor)
2025-03-27 17:35:30.592 Netatmo4: General/Sound Level (Indoor)
2025-03-27 17:35:30.593 Netatmo4: General/Percentage (Buiten - Bat. Level)
2025-03-27 17:35:30.594 Netatmo4: Temp + Humidity (Buiten)
2025-03-27 17:35:30.797 Status: Netatmo4: Home id huis updated.
2025-03-27 17:35:30.797 Status: Netatmo4: Home Status Details, size (number of homes) is 1
:D
* Add the newly discovered devices.
* Domoticz settings: disable allow new hardware/sensors

Additional steps to merge the old and new sensors:
* Enable the old Netatmo hardware, so the old sensors re-appear.
* For each old sensor, use the edit button: replace; then select the new sensor.
* Disable the old Netatmo hardware again.
* Enabled the scripts that used the Netatmo sensors
Last edited by DomoFlits on Thursday 27 March 2025 20:52, edited 2 times in total.
User avatar
waltervl
Posts: 5609
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 »

If you use the replace function (Edit button on widget) the new devices wil get the name and IDX of the old device so you do not need to change scripts..... The history data is merged.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
DomoFlits
Posts: 36
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 »

Data of old and new sensors is merged (with a gap of 2 weeks)
Example of outdoor temperature:
Outdoor temperature 1 month
Outdoor temperature 1 month
chart.png (112.14 KiB) Viewed 1653 times
jcb2
Posts: 27
Joined: Wednesday 04 January 2023 7:30
Target OS: Linux
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by jcb2 »

Hello,
One new beta version is available.
Now I have found all devices.
But what is it the trigger ? I don't no. (wait one day, new béta version, others ?)

Jean-Charles
jcb2
Posts: 27
Joined: Wednesday 04 January 2023 7:30
Target OS: Linux
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by jcb2 »

Hello,
Finaly, after one restart of Domoticz, it is already down ...
homeJLB
Posts: 102
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 »

can you place the IP and port in the App Settings on dev.netatmo.com

for example like;
Redirect.png
Redirect.png (19.71 KiB) Viewed 1410 times
kind regards
jcb2
Posts: 27
Joined: Wednesday 04 January 2023 7:30
Target OS: Linux
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by jcb2 »

Hello,
With local IP it is not OK.
I have waiting one night and now it is OK ... probably until next reboot !
jcb2
Posts: 27
Joined: Wednesday 04 January 2023 7:30
Target OS: Linux
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by jcb2 »

Hello,
No need an reboot, today the communication is down.
phil35
Posts: 20
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,
Is it possible to have a sumup/confirmation on this issue (netatmo authentification) depending of the version of domoticz ?
My understanding
- with version 2024.7.16157 --> do not work anymore
- with beta version 2024.7.16598 --> do not work anymore
- with beta 2025.1 --> should work [ so the update must be done via sudo ./updatebeta right ? ]

Thanks
Phil
Production platform uses domoticz v2023.1
Production platform (for Netatmo and Zigbee) uses domoticz v2024.7
DomoFlits
Posts: 36
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 »

* In the settings select the beta channel
* Then do a check for updates.
All from the webpage.

See my message from 27 march which steps I did to have it working again. (Not all steps may be required)
User avatar
waltervl
Posts: 5609
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 »

See also the wiki https://wiki.domoticz.com/Netatmo The instructions should be up to date.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Rob67ert
Posts: 20
Joined: Tuesday 24 December 2019 13:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by Rob67ert »

Not working anymore with 2025.1 (build 16608)
Or does anyone have a solution?
chrominator
Posts: 18
Joined: Sunday 25 December 2016 7:27
Target OS: Linux
Domoticz version: 2024.7
Contact:

Re: Netatmo authentication changes Oct 2022

Post by chrominator »

I did a try on the last source available, domoticz Version: 2025.1 (build 16609).

Since I've altered the source by displaying the values of the http posting to renew the token, I've copied the content of httpData from the log to use it with curl on a terminal, specifying the right headers with -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8".
While the reply in domoticz was "Error: Netatmo: Invalid/no data received (refresh tokens)... HTTP/2 403", the outcome from curl was every time a valid refreshed token.

So that implies that the httpData content is the right one. Other parameters are the headers passed to the http posting.
My try was to comment the line where the http headers are assigned to ExtraHeaders variable on line 362.
Capture d'écran 2025-04-03 110944.png
Capture d'écran 2025-04-03 110944.png (6.67 KiB) Viewed 675 times
Compilation and run.
Everything went fine, netatmo contacted and all devices updated.
Restart the hardware, same result, all is fine.
Reboot the computer, same result, everything ok.

I'm the opposite of an expert in C++ and http posting, my only concern here is to share my try and maybe to inspire a track to follow to fix this netatmo issue.
phil35
Posts: 20
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 »

Thanks @chrominator, It seems the issue comes really from domoticz
It will be very helpfull to many persons, if an official version of domoticz implements the comment you made.
-> is GizMoCuz can be contacted for that?

Phil
Production platform uses domoticz v2023.1
Production platform (for Netatmo and Zigbee) uses domoticz v2024.7
chrominator
Posts: 18
Joined: Sunday 25 December 2016 7:27
Target OS: Linux
Domoticz version: 2024.7
Contact:

Re: Netatmo authentication changes Oct 2022

Post by chrominator »

I won't start a PR with that, it's working but it's dirty.
Before this, some other users having the capability to compile could do the change and confirm my conclusion.
I did not manage to understand why commenting this line made netatmo working, however there must be a root cause to this and it has to be found.
Unfortunately I'm not able to do it.
Rob67ert
Posts: 20
Joined: Tuesday 24 December 2019 13:57
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by Rob67ert »

In de 2025.1 (build 16611) it's fixed :-)
Wimpi
Posts: 11
Joined: Sunday 07 January 2024 12:52
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.1
Location: Belgium
Contact:

Re: Netatmo authentication changes Oct 2022

Post by Wimpi »

Not for me, after my update - Version: 2025.1 (build 16611), again problems with Natatmo

It was working again for more than 1 week after the other login problems…

Now again…

2025-04-03 19:31:47.244 Status: Netatmo 2024: Worker started...
2025-04-03 19:31:52.245 Status: Netatmo 2024: Requesting new access_token
2025-04-03 19:31:52.427 Error: Netatmo 2024: Invalid/no data received (refresh tokens)... HTTP/2 403
2025-04-03 19:31:52.427 Status: Netatmo 2024: Retry LOGIN within 45 min.
2025-04-03 19:31:52.428 Status: Netatmo 2024: Login 0
jcb2
Posts: 27
Joined: Wednesday 04 January 2023 7:30
Target OS: Linux
Domoticz version:
Contact:

Re: Netatmo authentication changes Oct 2022

Post by jcb2 »

Hello,
After device off for 2 days and installation of béta 16611 it is OK but after one day and one reboot, already NOK.
Sorry ...
I hope the remark by chrominator » Thursday 03 April 2025 11:15 is one good way to solve this error.

Jean-Charles
chrominator
Posts: 18
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: Thursday 03 April 2025 11:15 I did a try on the last source available, domoticz Version: 2025.1 (build 16609).

Since I've altered the source by displaying the values of the http posting to renew the token, I've copied the content of httpData from the log to use it with curl on a terminal, specifying the right headers with -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8".
While the reply in domoticz was "Error: Netatmo: Invalid/no data received (refresh tokens)... HTTP/2 403", the outcome from curl was every time a valid refreshed token.

So that implies that the httpData content is the right one. Other parameters are the headers passed to the http posting.
My try was to comment the line where the http headers are assigned to ExtraHeaders variable on line 362.
Capture d'écran 2025-04-03 110944.png

Compilation and run.
Everything went fine, netatmo contacted and all devices updated.
Restart the hardware, same result, all is fine.
Reboot the computer, same result, everything ok.

I'm the opposite of an expert in C++ and http posting, my only concern here is to share my try and maybe to inspire a track to follow to fix this netatmo issue.
Bad news, added more debug context in the source to check the content of "ExtraHeaders" and "returnHeader", compile and restart.

Still "Error: Netatmo: Invalid/no data received (refresh tokens)... HTTP/2 403" now.
Even when replacing the last exec with the previous one which worked several days, no way this time.

I will think that is coming from the counterpart, netatmo server...
By the way, curl with the content from the domoticz log still works every time...

log with personal data masked to protect my access.

Code: Select all

2025-04-04 22:15:39.797 Status: Netatmo: Worker stopped...
2025-04-04 22:15:39.798 Status: Netatmo: Worker started...
2025-04-04 22:15:44.799 Status: Netatmo: Requesting new access_token
2025-04-04 22:15:45.031 Status: Netatmo: HttpUrl: https://api.netatmo.com/oauth2/token?
2025-04-04 22:15:45.031 Status: Netatmo: HttpData: grant_type=refresh_token&refresh_token=value1|refreshed_token&client_id=my_client_id&client_secret=my_client_secret
2025-04-04 22:15:45.031 Status: Netatmo: ExtraHeaders: Content-Type: application/x-www-form-urlencoded;charset=UTF-8
2025-04-04 22:15:45.031 Status: Netatmo: returnHeader: HTTP/2 403
2025-04-04 22:15:45.031 Status: Netatmo: returnHeader: date: Fri, 04 Apr 2025 20:15:45 GMT
2025-04-04 22:15:45.031 Status: Netatmo: returnHeader: content-type: text/html
2025-04-04 22:15:45.031 Status: Netatmo: returnHeader: content-length: 1484
2025-04-04 22:15:45.031 Status: Netatmo: returnHeader: cache-control: no-store
2025-04-04 22:15:45.031 Status: Netatmo: returnHeader: x-azure-ref: 20250404T201545Z-17dc6868955srd86hC1PRA13qs00000000v000000000hbcq
2025-04-04 22:15:45.031 Status: Netatmo: returnHeader: x-cache: CONFIG_NOCACHE
2025-04-04 22:15:45.031 Status: Netatmo: returnHeader:
2025-04-04 22:15:45.031 Error: Netatmo: Invalid/no data received (refresh tokens)... HTTP/2 403
2025-04-04 22:15:45.031 Status: Netatmo: Retry LOGIN within 45 min.
2025-04-04 22:15:45.032 Status: Netatmo: Login 0
homeJLB
Posts: 102
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 is from the Netatmo website API
POST token.png
POST token.png (90.08 KiB) Viewed 236 times
But if this change can help lets try this.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests