Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 2.19 KB

README.md

File metadata and controls

39 lines (27 loc) · 2.19 KB

Netatmo Data Downloader

Code for downloading public weather data from the Netatmo API.

Setup

  1. Clone this repository to your local machine.
  2. If you haven't already, install a recent version of Node.js (needs to be a version with ES6 support), and NPM.
  3. Go into the root of the netatmo-data-downloader directory.
  4. Download the required packages with:

npm install

  1. 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.
  2. Once logged in the Technical Parameters section will list the Client id and Client secret you will need.
  3. Create a file called .env in the root of the netatmo-data-downloader directory.
  4. 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
NETATMO_USERNAME=YourEmailAddress@email.com
NETATMO_PASSWORD=YourSuperSecretPassword
  1. The code will load these details into process.env in order to configure the code.
  2. This code is currently set up to just get temperature data for Amsterdam for Sept 2016. To do this run:

npm run get-amsterdam

  1. 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.
  2. If you wish to edit the timeframe, location, variables, etc, then edit the file /tasks/get-amsterdam-data/get-data.js
  3. Alternatively create a new folder in the /tasks/ directory and use the Amsterdam code as a basis for your own custom script.

TODOs

  • 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.