-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
netatmo driver don't work anymore #21
Comments
Netatmo has deprecated the "client credential" grant type (ie, The method was officially deprecated in October 2022 but appears to have actually taken effect in July 2023. Netatmo's suggestion is to pivot to the authorization code grant type. However, a casual perusal of the code suggests this is a slightly more involved change than my sleep-deprived brain can handle right now. Maybe @matthewwall can take a look? |
you can use this fork : https://github.com/Buco7854/weewx-netatmo you must generate a refresh_token in https://dev.netatmo.com/apps/
|
Thanks a lot bucolo for updating the code. My Station: https://www.harrynet.mine.nu/weewx/sofa/ is up and running again. |
Thanks for taking the time to code a fix! Unfortunately I'm seeing the same problem (HTTP 400). Any ideas?
Exerpt from
|
Have you try to recreate a new app in https://dev.netatmo.com/apps/createanapp#form ? for me it's always ok you can delete username (and device_id i think) |
@bucolo - tried using an existing app with new tokens and also a brand-new app with new tokens. I’ve enabled all the relevant scopes and even a token with R+W access to all scopes. No dice, still getting 400 errors in the logs. This is very odd :-/ |
It's very strange indeed. I do not see. I didn't write the fork |
Try to make the request in a tool like postman or reqbin (if you dont want to download anything). Pass the same params (the one that you can see in the error message) and use the |
Hi, I did this update. |
If it did work before it will work now, I changed nothing more than the authentication. |
@Buco7854 |
This is indeed pretty weird. The API clearly states it should take a |
Agreed - I've coded some integrations for my solar system that make some "informed" guesses regarding efficiency by interrogating my weather station via Netatmo's servers too. In short, this shouldn't work...but it does 🤷🏻♂️ Thanks for the work on pivoting the authentication method though! You rock 👍 |
The fork you created is missing this rain fix, which is not in the original fork Could it be integrated? |
could you try the following, I'm unable to do so for now. https://github.com/Buco7854/weewx-netatmo/tree/rain_fix_test Click on code, download the zip, upload it to your server, rename it to |
I replaced the old fix (v 0.14) with the new one (v0.17) . it works ! |
ok thanks Buco78, the rain is coming on Saturday, I text it and let you know if it's ok |
Ok, thanks 😀 |
Thanks for your work. Tried this fix and got following |
How was it without rain fix? |
Last version I used was a fork from jkrasinger. Did work until this week and needed that thing with refresh token. |
What I basically did is just merge jkrasinger branch into mine. I had to do it manually since there was some conflict due to my previous changes. I double checked and it seems I unintentionally didnt delete a line that put the data into the collector before the rain data was sent (even if it was sent again right after, that could possibly change the result). It is the only thing that was changed and I will not be able to help further if the latest version of the rain_fix doesnt work. I recommend you to retry with the latest fix, and if it doesn't match your expectations then just compare the master and rain_fix branch to see if there is at least some improvements because the latest fix should work. Please let me know if the fix works so that I can put it into the master branch. |
Nevermind, I changed the link for now. You can just follow |
Hi Buco, tonight I tested with the rain that came. Still underestimates. |
Did you download the zip again? there was some change. |
it's good now, the accumulations of yesterday and this night are good. you can change the version number for more clarity. |
I downloaded the one from 3 days ago. I'll try to put the new one on and I'll tell you how the test goes |
When I generate a token for [ ] read station, I get both an Access token and a Refresh token.
|
No need since with the refresh token you can get the access one, and since we need to know when the token will expire we request one on startup to get this information thats why you dont need to provide one yourself. |
Looks good now after two checks. Thank you. |
I replaced the master branch, thanks for the feedbacks. |
Just added the fix for the lacking data thing should work properly now. |
confirm you, everything is ok. It recorded the correct rain. Thank you very much |
First of all many thanks to @bucolo \ @Buco7854 for providing this branch and the fix for Netatmo Authentication. I first noticed a lack of data on Sep 11th after a power cut at home, so up to this point the old Authentication method was working, or maybe the connection had not expired. I ended up updating Debian, Python and Weewx to try to track down a problem I had after I installed this fix, namely an error as below.
I tracked this down to line 28 in netatmo.py - not sure if this is just my setup but as it looked like the try and except lines were there to resolve a Python 2 \ Python 3 possible issue I just commented out line 28 and let the next bit of code sort it out.
At this point I could then see the authentication error:
I'd like to thank @Buco7854 again for the pointer to reqbin which was a great way to test the credentials, as usual it was a typo with the client id that was causing the issue. For others new to reqbin and this stuff, it was just a case of putting https://api.netatmo.com/oauth2/token in the URL box, selecting "Form URL Encoded" in the type dropdown and pasting the right text in the box below
Select POST and click SEND, response should look like this
When I had the wrong data I just got a error code 10023. So thanks for all the help, I do have a gap in my data now - anyone know how to get the old data in there? https://www.wiggytoo.co.uk/reports/ Regards, |
More on this thread for later changes |
Hi
I posted this on Github in https://github.com/weewx/weewx under issues. There it was closed, because of not beeing a supported weewx driver. I was told to contact the author.
My netatmo-driver don't work anymore since 11th of July 2023.
I think something on the netatmo api has changed. I get the following error:
"netatmo: netatmo-client: failed attempt 1 of 5 to get data: HTTP Error 400
netatmo: netatmo-client: url: https://api.netatmo.net/oauth2/token data: b'grant_type=password&client_id=64146554164654464554654&client_secret=456545465464644654874841579874468&username=........................."
(client_id and client_secret was changed by me in this posting)
Maybee "grant_type=password" is not allowed anymore.
Can you tell me if this can get fixed. Thanks in advance.
The text was updated successfully, but these errors were encountered: