Code for downloading public weather data from the Netatmo API.
- Clone this repository to your local machine.
- If you haven't already, install a recent version of Node.js (needs to be a version with ES6 support), and NPM.
- Go into the root of the netatmo-data-downloader directory.
- Download the required packages with:
npm install
- In order to authenticate with the Netatmo API you will need to specify your Netatmo developer credentials. If you haven't already set up a Netatmo Developer Account.
- Once logged in the Technical Parameters section will list the Client id and Client secret you will need.
- Create a file called
.env
in the root of the netatmo-data-downloader directory. - Enter your Netatmo username and password, along with the client id and secret, in this file as follows:
NETATMO_CLIENT_ID=YourClientIdHere
NETATMO_CLIENT_SECRET=YourClientSecretHere
[email protected]
NETATMO_PASSWORD=YourSuperSecretPassword
- The code will load these details into process.env in order to configure the code.
- This code is currently set up to just get temperature data for Amsterdam for Sept 2016. To do this run:
npm run get-amsterdam
- If you look at the package.json file you will see that all this is doing is running
node tasks/get-amsterdam-data/get-data.js
. If successful the data is saved to csv files in tasks/get-amsterdam-data/data. - If you wish to edit the timeframe, location, variables, etc, then edit the file /tasks/get-amsterdam-data/get-data.js
- Alternatively create a new folder in the /tasks/ directory and use the Amsterdam code as a basis for your own custom script.
- At some point I'd like to update the code to use Promises instead of Callbacks as starting to see Callback Hell!.
- Would also be nice if all the data wasn't held in memory, i.e. data should be continually piped into the csv rather than waiting till all the data has been retrieved from the API before saving.