Data download via API
I would like to download the data from my Netatmo Home Coach and Netatmo Weather station using Python.
All Python libraries for Netatmo seem to be outdated, broken, missing examples or have other issues.
I further struggle with the API documentation provided (https://dev.netatmo.com/apidocumentation/oauth). I manged to create an app. But I couldn't get it working on my own.
I am comfortable with Python and have accessed sensor APIs from multiple other brands without issues. It is significantly more difficult with Netatmo devices.
Hence, I was wondering if I am missing something? Am I using the right documentation?
Am I using the right documentation?
Comments
13 comments
Hello Mario,
In a nutshell, here is the process to follow :
Have a good day,
Leslie - Community Manager
Hi Leslie,
Thank you for the quick response.
Is there always a human interaction required to read out my own sensor data?
If the fresh token expires, does a human again need to authorize access?
Hi again,
Human interaction is only mandatory for the /authorize request in order to get the user's consent. You can then automate the retrieval of the code value and the next steps
Indeed, if for any reason the refresh_token value is not correct or correctly used to refresh the access_token, you will have to redo the whole process. But please note that the refresh_token doesn't have an expiration date
Have a good day,
Leslie - Community Manager
Hi Leslie,
Thank you again very much for your quick response.
It helped to clarify a misunderstanding on my side. I managed to get it working.
It appears that the 'scale' parameter for the '/getmeasure/ endpoint is limited to {30min, 1hour, 3hours, 1day, 1week, 1month}.
Is there a way to get data with a higher sampling rate from the API?
Hello Mario,
Indeed, there are the only available scales via the /getmeasure call
As far as I remember (I'm pretty sure but to be confirmed) data coming from the /gethomecoachsdata endpoint are updated every 10 minutes. It's the minimum scale we propose via API for this device
Have a good day,
Leslie - Community Manager
Hi Mario,
I'm in the same position as you. I'm experienced in python and working with other APIs, but I keep getting errors too. Would you be able to share a little code snippet for how you got it working? Thanks in advance
Hi Bill,
Below are the code snippets that "works". This works for a few days and then I have to manually create new access and refresh tokens on https://dev.netatmo.com/ and update them in the code.
I couldn't figure out how to make it work for longer without human intervention.
Credentials
Fetch data
Refresh token
Thanks so much.
> This works for a few days and then I have to manually create new access and refresh token
Yes. I am also getting this problem. This is very frustrating. I get the Netatmo wants to keep our data safe, but I feel like if I want to access my own data, there should be a simpler approach.
I agree.
I've bought a few more sensors from other reputable brands and it took me less than an hour to interface their API's and read out the data. And for those the setup is now working for weeks and months without any issues.
Can you tell me some other brands that work? I'm getting fed up with Netatmo and their lack of decent support and constant fiddling with their APIs.
I've been very happy with the following devices:
- Airgradient: https://www.airgradient.com/indoor/
- Ubibot AQS1: https://www.ubibot.com/ubibot-aqs1/
- Atmo Cube: https://atmotube.com/atmocube
Setting up the APIs took about one hour each, and it has worked reliably for several months.
Amazing, thanks, will try one of those.
I agree entirely - I am sick to the teeth with this auth. It used to work so well. I am giving up with the product and going elsewhere.
Please sign in to leave a comment.