Package: netatmo
netatmo.pyPython 3 API to retrieve data from the Netatmo connectedweather station.The library implements theauthentication, thetoken refreshand the both weather station methodsGetstationdataandGetmeasure.Although Netatmo providessampleswritten in Python, this library provides - I hope! - more high level methods to access the data.InstallationThe easiest way to install the library is usingpip:pip3installnetatmoYou can also download or clone the GitHub repository and install the module:cd/path/to/repo
python3setup.pyinstallFinally, you may get thenetatmo.pysource file and use it in your projects.RequirementsPython 3 (sorry if you live inlegacy)Therequestsmodule (should be included in any decent Python distribution)A valid Netatmo account with at least one weather stationA client_id / client_secret pair from Netatmo developper program (seeCreate your app)Command-line usageHelpnetatmo-h
netatmo<command>-hwhere<command>can be one of these keywords:config,fetch,list,test,dump.CredentialsThe library reads the username/password and client id/secret from a .rc file. By default, it is ~/.netatmorc. It could be edited by hand, or written by the library with theconfigcommand.netatmoconfig-uuser@mail-ppassword-iclient_id-sclient_secret-d70:ee:50:xx:xx:xxWithout any option,configonly prints the current configuration.$ netatmo config
Read config
username: user@mail
password: password
client_id: 1234567890abcdef12345678
client_secret: ABCdefg123456hijklmn7890pqrs
default_station: 70:ee:50:xx:xx:xxDisplay the authorized stationsnetatmo listFetch data into CSV filesnetatmo fetchThis command will write two CSV files,netatmo_station.csvandnetatmo_module.csv. The most recent measures are appended to these files depending on the last timestamps.Other commands and optionstesttests the connection. On success, exit code is zero. On failure, non zero, like any shell command.dumpdisplays more data from the weather station.Each option-vincreases the verbosity. The option-ccan be use to use an alternate configuration file.Both-vand-chave to be placed before the command.Usage as a Python module#! /usr/bin/env python3importnetatmo# fetch data using ~/.netatmorc credentialsnetatmo.fetch()# credentials as parametersws=netatmo.WeatherStation({'client_id':'1234567890abcdef12345678','client_secret':'ABCdefg123456hijklmn7890pqrs','username':'user@mail','password':'password','device':'70:ee:50:XX:XX:XX'})ws.get_data()print(ws.devices)License and warrantyNone and none.It is NOT an official software from Netatmo and it is not endorsed or supported by this company.This library has been written as a personal work. Feel free to improve or adapt it to your own needs.NotesOther Netatmo devicesThis library has been tested only with the weather station and its interior module. I don't know if it works well with the windgauge or the pluviometer. Other devices are unsupported, but their methods could be easily added. SeeNetatmo Connect APIs.Installation on a Synology NASSynology provides a Python 3 package that lacks therequestsmodule. Here is an simple download method, without git, pip or setup.py:curl-sLhttps://api.github.com/repos/kennethreitz/requests/tarball/v2.20.0|tar-xzf---strip-components=1--wildcards'*/requests'Alternately, you can useAnacondaas Python3 distribution.