NETATMO Authentication Problem

I have some trouble with NETATMO Binding, i can only do the authentication of the account if i delete the token file (/var/lib/openhab/netatmo/refreshToken_netatmo_account_myaccount) first:

[Authorize openHAB Bridge at Netatmo Connect]

(http://xxxxxxx:8080/netatmo/connect/aaaaaaaaaaaaaaaa) ← modified

This is the token file i deleted first:
/var/lib/openhab/netatmo/refreshToken_netatmo_account_myaccount

If i do not delete the token i get “Bad Request” message, and i can’t call the webpage to authenticate. But after deletion everything works as expected, except the Binding looses after some days the synchronisation again, then i have to do the same procedure again.

If the file needs to be deleted before, why this is not implemented by the application?

Any idea, does someone found a solution for?

I have experienced the same when authorizing the same client id from multiple systems, could that be the cause for you also?

The handling of access/refresh tokens is changed in 4.0 where this file is no longer needed. Still, you cannot share the same client id.

Thanks for your reply Jacob.

I did not saw anything like this, i tried to open the different Apps on my Devices but did not expirenced any problems. I think it’s more the expiration of a timer or a non responsive authorization site?

What will be changed in 4.0? I thought it was already changed to a specific date, some Auth changes from Netatmo itself?

In 4.0 the binding will use the standard openHAB OAuth2 implementation and storage instead of the custom implementation of token storage and refresh logic. This fixes the issue where reauthorization is not possible without manually deleting the refresh token file:

Hello, I use a Netatmo weather station and have had the Netatmo binding running so far. For about 3 weeks I have had the problem that CommError and Error Bridge are displayed in the Things. The authorization works and shows green but does not change anything in OpenHab!

I am still running OH 2.5 and surprisingly the binding was running fine until Wednesday (2023-07-12), Now i am getting

Network error while connecting to Netatmo API, will retry in 60 s

all the time. Chances are high it is related to the Netatmo API OAuth change… Any chance to get this running with OH2.5 again, or do i need to update to OH 3?

(At least the netatmo/connect/ url is not available in my OH instance, so i can only get the refreshToken from the netatmo site directly.)

openHAB 2 is no longer supported, so you would have to fix this yourself. The best solution would be to backport the OAuth2 changes from 3.4.x and build a new openHAB 2 Netatmo binding. You could also implement OAuth2 yourself outside openHAB and update the refresh token in a .things file so it would be reloaded.

I don’t know your reasons for sticking with openHAB 2, but the easiest path is probably to upgrade to 3.4. The longer you wait, the more breaking changes you will have to attend to when you finally decide to upgrade. 4.0 is expected by the end of the month.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.