Page 1 of 1

getstationsdata python

Posted: 20 May 2020, 17:08
by christian.foerster
Hi there,

I'm trying to retrieve data from weather stations,.
First I get a list of all stations around Z├╝rich:

Code: Select all

def _query(url, token="...."):
    response = requests.get(
            "accept": "application/json",
            "Authorization": f"Bearer {token}"
    return response
url =
data = _query(url)

Within the data body I find all the stations... For example

Code: Select all

{'_id': '70:ee:50:00:45:30',
 'place': {'location': [8.634436400000027, 47.42281870000001],
  'timezone': 'Europe/Zurich',
  'country': 'CH',
  'altitude': 454,
  'city': 'Wangen-Br├╝ttisellen',
  'street': 'Chileweg'},
 'mark': 12,
 'measures': {'02:00:00:00:5a:9a': {'res': {'1589985581': [23.8, 40]},
   'type': ['temperature', 'humidity']},
  '70:ee:50:00:45:30': {'res': {'1589985609': [1022.4]}, 'type': ['pressure']},
  '05:00:00:00:37:fc': {'rain_60min': 0,
   'rain_24h': 0,
   'rain_live': 0,
   'rain_timeutc': 1589985600},
  '06:00:00:01:4b:54': {'wind_strength': 7,
   'wind_angle': 72,
   'gust_strength': 16,
   'gust_angle': 79,
   'wind_timeutc': 1589985607}},
 'modules': ['02:00:00:00:5a:9a', '06:00:00:01:4b:54', '05:00:00:00:37:fc'],
 'module_types': {'02:00:00:00:5a:9a': 'NAModule1',
  '06:00:00:01:4b:54': 'NAModule2',
  '05:00:00:00:37:fc': 'NAModule3'}}
I get the station id from the _id field.

To retrieve the station data I run:

Code: Select all

url =
data = _query(url)
Unfortunately I get an error response:

Code: Select all

{'error': {'code': 9, 'message': 'Device not found'}}
What am I doing wrong? And yes I use the read_station to create the token.

Thank you very much!!

Re: getstationsdata python

Posted: 28 May 2020, 11:12
by Daegil_Netatmo

As I would rather help you privately (RGPD), please contact us on our support:
Select Support integrating Netatmo's products via API/Webhooks and fill the form.

Best regards,

Re: getstationsdata python

Posted: 15 Jun 2020, 15:41
by humpty83