A module to integrate data from a Netatmo weather station into MagicMirror.
Prerequisites
- requires MagicMirror v2.0.0+
- Access to a Netatmo weather station account
To use this module, just clone this repository to your modules folder of your MagicMirror:
git clone https://github.com/KrunchMuffin/MMM-Netatmo.git
Now just add the module to your config.js file (config entries).
To be able to access your data, you need to have an Netatmo Application and grant this application access to your data.
Your can register a new app here. Afterwards you will get an CLIENT_ID and an CLIENT_SECRET which you will need to enter in the config entries.
To allow the app to access your data, you need to send a POST request to the auth server and register the app.
One option is to use the command line tool cURL.
curl --data "grant_type=password&client_id=CLIENT_ID&client_secret=CLIENT_SECRET&username=NETATMO_USERNAME&password=NETATMO_PASSWORD&scope=read_station" "https://api.netatmo.com/oauth2/token"
The POST request will return data similar to the following:
{"access_token":"xyzmdgidkd|jdkmfkgmklmfism9ims","refresh_token":"xyzmdgidkd|dmdjekrlslkdolsk","scope":["read_station"],"expires_in":10800,"expire_in":10800}
The REFRESH_TOKEN will be needed in the config entries.
You can also use Postman to get these values.
The module needs the default configuration block in your config.js to work.
{
module: 'MMM-Netatmo',
position: 'top_right', // the location where the module should be displayed
config: {
clientId: '', // your app id
clientSecret: '', // your app secret
refreshToken: '' // your generated refresh token
}
}
The following properties can be configured:
Option | Description |
---|---|
clientId | The ID of your Netatmo application. This value is REQUIRED |
clientSecret | The app secret of your Netatmo application. This value is REQUIRED |
refreshToken | The generated refresh token you got from the POST request to the auth api. This value is REQUIRED |
refreshInterval | How often does the content needs to be updated? (Minutes) Data is updated by netatmo every 10 minutes. Default value: 10 |
moduleOrder | The rendering order of your weather modules, ommit a module to hide the output. Example: ["Kitchen","Kid's Bedroom","Garage","Garden"] Be aware that you need to use the module names that you set in the netatmo configuration. |
dataOrder | The rendering order of the data types of a module, ommit a data type to hide the output. Example: ["Noise","Pressure","CO2","Humidity","Temperature","Rain"] |
showTrend | Show trending temp and pressure. Default: true |
hideLoadTimer | Show ot hide the load timer Default: false |
design | Change the design and appearance. Options: classic (Default) or bubbles |
horizontal | Show vertically(false) or horizontally(true) (Default) |
lastMessageThreshold | 600 (in seconds (10 minutes)) |
showLastMessage | true (Default) |
showBattery | true (default) |
showRadio | true (default) |
showWiFi | true (default) |
showTrend | true (default) |