Page 18 of 21

Re: Netatmo authentication changes Oct 2022

Posted: Thursday 27 March 2025 17:48
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

Re: Netatmo authentication changes Oct 2022

Posted: Thursday 27 March 2025 18:57
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.

Re: Netatmo authentication changes Oct 2022

Posted: Thursday 27 March 2025 20:57
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 2711 times

Re: Netatmo authentication changes Oct 2022

Posted: Friday 28 March 2025 19:29
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

Re: Netatmo authentication changes Oct 2022

Posted: Saturday 29 March 2025 4:05
by jcb2
Hello,
Finaly, after one restart of Domoticz, it is already down ...

Re: Netatmo authentication changes Oct 2022

Posted: Saturday 29 March 2025 13:05
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 2468 times
kind regards

Re: Netatmo authentication changes Oct 2022

Posted: Sunday 30 March 2025 9:19
by jcb2
Hello,
With local IP it is not OK.
I have waiting one night and now it is OK ... probably until next reboot !

Re: Netatmo authentication changes Oct 2022

Posted: Tuesday 01 April 2025 8:57
by jcb2
Hello,
No need an reboot, today the communication is down.

Re: Netatmo authentication changes Oct 2022

Posted: Wednesday 02 April 2025 12:55
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

Re: Netatmo authentication changes Oct 2022

Posted: Wednesday 02 April 2025 13:49
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)

Re: Netatmo authentication changes Oct 2022

Posted: Wednesday 02 April 2025 14:34
by waltervl
See also the wiki https://wiki.domoticz.com/Netatmo The instructions should be up to date.

Re: Netatmo authentication changes Oct 2022

Posted: Wednesday 02 April 2025 20:04
by Rob67ert
Not working anymore with 2025.1 (build 16608)
Or does anyone have a solution?

Re: Netatmo authentication changes Oct 2022

Posted: Thursday 03 April 2025 11:15
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 1733 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.

Re: Netatmo authentication changes Oct 2022

Posted: Thursday 03 April 2025 13:52
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

Re: Netatmo authentication changes Oct 2022

Posted: Thursday 03 April 2025 17:55
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.

Re: Netatmo authentication changes Oct 2022

Posted: Thursday 03 April 2025 18:12
by Rob67ert
In de 2025.1 (build 16611) it's fixed :-)

Re: Netatmo authentication changes Oct 2022

Posted: Thursday 03 April 2025 19:36
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

Re: Netatmo authentication changes Oct 2022

Posted: Friday 04 April 2025 9:47
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

Re: Netatmo authentication changes Oct 2022

Posted: Friday 04 April 2025 22:26
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

Re: Netatmo authentication changes Oct 2022

Posted: Friday 04 April 2025 23:06
by homeJLB
this is from the Netatmo website API
POST token.png
POST token.png (90.08 KiB) Viewed 1294 times
But if this change can help lets try this.