├── images └── refresh-token.png ├── .gitignore ├── netatmo-camera.html ├── CHANGELOG.md ├── package.json ├── netatmo-camera.js ├── netatmo-dashboard.html ├── netatmo-dashboard.js └── README.md /images/refresh-token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guidone/node-red-contrib-netatmo-dashboard/HEAD/images/refresh-token.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | /.idea 39 | /.DS_Store 40 | -------------------------------------------------------------------------------- /netatmo-camera.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 23 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | ## 0.5.2 - 2019/01/05 6 | * fixed bug where values could be N.N. instead of 0 7 | 8 | ## 0.5.1 - 2019/01/04 9 | * merged pull request 10 | 11 | ## 0.5.0 - 2018/12/27 12 | * updated to actual versions of netatmo, underscore and request module (vilnerability fixes) 13 | * added changelog file 14 | * fixed bug where dashboard_data not fetched if devices are not reachable which causes crash of module and node-red 15 | * added arrqay with all indoor modules in compact mode 16 | * added reachable info in all modules in compact mode 17 | 18 | ## 0.4.2 - 2018/09/26 19 | * small fix where temperatrue_trend was not fetched correctly for compact mode 20 | 21 | 22 | 23 | ## 0.4.1 - 2018/09/10 24 | * small fixes 25 | * reorganizeed data structure for compact dataset (with more information) and the complete data 26 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Guido Bellomo", 4 | "email": "guido.bellomo@gmail.com" 5 | }, 6 | "name": "node-red-contrib-netatmo-dashboard", 7 | "description": "Get JSON payload for NetAtmo dashboard. See http://netatmo.com, https://dev.netatmo.com/doc", 8 | "dependencies": { 9 | "netatmo": "^2.2.2", 10 | "node-fetch": "^2.6.7", 11 | "np": "^3.0.4", 12 | "prettyjson": "^1.2.1", 13 | "request": "^2.88.0", 14 | "underscore": "^1.9.1" 15 | }, 16 | "version": "0.5.2", 17 | "keywords": [ 18 | "node-red", 19 | "netatmo", 20 | "camera", 21 | "tags", 22 | "sensors", 23 | "weather", 24 | "iot", 25 | "ibm" 26 | ], 27 | "license": "MIT", 28 | "node-red": { 29 | "nodes": { 30 | "netatmo": "netatmo-dashboard.js", 31 | "netatmo-camera": "netatmo-camera.js" 32 | } 33 | }, 34 | "repositories": [ 35 | { 36 | "type": "git", 37 | "url": "https://github.com/guidone/node-red-contrib-netatmo-dashboard.git" 38 | } 39 | ], 40 | "maintainers": [ 41 | { 42 | "name": "Guido Bellomo", 43 | "email": "guido.bellomo@gmail.com", 44 | "web": "http://javascript-jedi.com" 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /netatmo-camera.js: -------------------------------------------------------------------------------- 1 | var netatmo = require('netatmo'); 2 | var _ = require('underscore'); 3 | var request = require('request'); 4 | var prettyjson = require('prettyjson'); 5 | 6 | module.exports = function (RED) { 7 | function NetatmoCamera(config) { 8 | 9 | RED.nodes.createNode(this, config); 10 | this.creds = RED.nodes.getNode(config.creds); 11 | var node = this; 12 | this.on('input', function (msg) { 13 | 14 | var api = new netatmo({ 15 | client_id: this.creds.client_id, 16 | client_secret: this.creds.client_secret, 17 | username: this.creds.username, 18 | password: this.creds.password, 19 | scope: 'access_camera read_station read_thermostat write_thermostat read_camera read_homecoach read_presence' 20 | }); 21 | 22 | api.on('error', function(error) { 23 | node.error(error); 24 | }); 25 | 26 | api.on('warning', function(error) { 27 | node.warn(error); 28 | }); 29 | 30 | api.getHomeData({size: 2}, function(err, data) { 31 | if (err != null) { 32 | node.error('Error on .getHomeData()'); 33 | return; 34 | } 35 | var home = data != null && !_.isEmpty(data.homes) ? data.homes[0] : null; 36 | var camera = home != null && !_.isEmpty(home.cameras) ? home.cameras[0] : null; 37 | if (camera != null) { 38 | var url = camera.vpn_url + '/live/snapshot_720.jpg'; 39 | request({ 40 | url: url, 41 | method: 'GET', 42 | encoding: null 43 | }, function (err, response, body) { 44 | if (err != null) { 45 | node.error('Error fetching url ' + url); 46 | } else { 47 | msg.payload = body; 48 | node.send(msg); 49 | } 50 | }); 51 | } 52 | }); 53 | }); 54 | } 55 | RED.nodes.registerType('netatmo-camera', NetatmoCamera); 56 | }; 57 | -------------------------------------------------------------------------------- /netatmo-dashboard.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 23 | 24 | 27 | 28 | 44 | 45 | 64 | -------------------------------------------------------------------------------- /netatmo-dashboard.js: -------------------------------------------------------------------------------- 1 | const _ = require('underscore'); 2 | const fetch = require('node-fetch'); 3 | const httpTransport = require('https'); 4 | 5 | const callRefreshToken = ({ clientId, clientSecret, refreshToken }) => { 6 | return new Promise((resolve, reject) => { 7 | 8 | const responseEncoding = 'utf8'; 9 | const httpOptions = { 10 | hostname: 'api.netatmo.com', 11 | port: '443', 12 | path: '/oauth2/token', 13 | method: 'POST', 14 | headers: { "Content-Type": "application/x-www-form-urlencoded" } 15 | }; 16 | httpOptions.headers['User-Agent'] = 'node ' + process.version; 17 | 18 | const request = httpTransport.request(httpOptions, (res) => { 19 | let responseBufs = []; 20 | let responseStr = ''; 21 | 22 | res.on('data', (chunk) => { 23 | if (Buffer.isBuffer(chunk)) { 24 | responseBufs.push(chunk); 25 | } 26 | else { 27 | responseStr = responseStr + chunk; 28 | } 29 | }).on('end', () => { 30 | responseStr = responseBufs.length > 0 ? Buffer.concat(responseBufs).toString(responseEncoding) : responseStr; 31 | if (res.statusCode === 200) { 32 | let json; 33 | try { 34 | json = JSON.parse(responseStr); 35 | resolve(json.access_token); 36 | } catch (e) { 37 | reject(e); 38 | } 39 | } else { 40 | reject('Unable to refresh the access token'); 41 | } 42 | }); 43 | }) 44 | .setTimeout(0) 45 | .on('error', (error) => { 46 | callback(error); 47 | }); 48 | request.write(`grant_type=refresh_token&refresh_token=${encodeURI(refreshToken)}&client_id=${clientId}&client_secret=${clientSecret}`); 49 | request.end(); 50 | }); 51 | }; 52 | 53 | module.exports = function (RED) { 54 | function NetatmoDashboard(config) { 55 | 56 | RED.nodes.createNode(this, config); 57 | this.creds = RED.nodes.getNode(config.creds); 58 | var node = this; 59 | this.on('input', async function (msg, send, done) { 60 | // send/done compatibility for node-red < 1.0 61 | send = send || function () { node.send.apply(node, arguments) }; 62 | done = done || function (error) { node.error.call(node, error, msg) }; 63 | 64 | const clientSecret = this.creds.client_secret; 65 | const clientId = this.creds.client_id; 66 | const refreshToken = this.creds.refresh_token; 67 | 68 | let data; 69 | try { 70 | // for some reason the same request with node-fetch is not working 71 | const refreshedToken = await callRefreshToken({ clientSecret, clientId, refreshToken });; 72 | 73 | // Get Station data (GET https://api.netatmo.com/api/getstationsdata?get_favorites=false) 74 | const response = await fetch("https://api.netatmo.com/api/getstationsdata", { 75 | method: 'GET', 76 | headers: { 77 | Authorization: `Bearer ${refreshedToken}` 78 | } 79 | }); 80 | data = await response.json(); 81 | } catch (e) { 82 | done(e); 83 | return; 84 | } 85 | 86 | msg.payload = {}; 87 | msg.payload.compact = {}; 88 | msg.payload.compact.outdoor = {}; 89 | msg.payload.compact.rain = {}; 90 | msg.payload.compact.modules = []; 91 | msg.payload.detailed = {}; 92 | 93 | /** save all detailed information **/ 94 | msg.payload.detailed = data; 95 | 96 | _(data.body.devices).each(function (station) { 97 | if (station.type === 'NAMain') { 98 | msg.payload.compact.reachable = station.reachable || "false"; 99 | msg.payload.compact.station_name = station.station_name; 100 | msg.payload.compact.last_status_store = station.last_status_store; 101 | 102 | if (typeof station.dashboard_data !== "undefined") { 103 | msg.payload.compact.temperature = station.dashboard_data.Temperature !== "undefined" ? station.dashboard_data.Temperature : "N.N."; 104 | msg.payload.compact.temperatureTrend = station.dashboard_data.temp_trend !== "undefined" ? station.dashboard_data.temp_trend : "N.N."; 105 | msg.payload.compact.co2 = station.dashboard_data.CO2 !== "undefined" ? station.dashboard_data.CO2 : "N.N."; 106 | msg.payload.compact.humidity = station.dashboard_data.Humidity !== "undefined" ? station.dashboard_data.Humidity : "N.N."; 107 | msg.payload.compact.noise = station.dashboard_data.Noise !== "undefined" ? station.dashboard_data.Noise : "N.N."; 108 | msg.payload.compact.pressure = station.dashboard_data.Pressure !== "undefined" ? station.dashboard_data.Pressure : "N.N."; 109 | msg.payload.compact.pressureTrend = station.dashboard_data.pressure_trend !== "undefined" ? station.dashboard_data.pressure_trend : "N.N."; 110 | } 111 | else { 112 | msg.payload.compact.temperature = "N.N."; 113 | msg.payload.compact.temperatureTrend = "N.N."; 114 | msg.payload.compact.co2 = "N.N."; 115 | msg.payload.compact.humidity = "N.N."; 116 | msg.payload.compact.noise = "N.N."; 117 | msg.payload.compact.pressure = "N.N."; 118 | msg.payload.compact.pressureTrend = "N.N."; 119 | } 120 | 121 | _(station.modules).each(function (module) { 122 | if (module.type === 'NAModule1') { //Outdoor Sensor 123 | 124 | msg.payload.compact.outdoor.reachable = module.reachable || "false"; 125 | msg.payload.compact.outdoor.battery_percent = module.battery_percent !== "undefined" ? module.battery_percent : "N.N."; 126 | msg.payload.compact.outdoor.rf_status = module.rf_status !== "undefined" ? module.rf_status : "N.N."; 127 | 128 | if (typeof module.dashboard_data !== "undefined") { 129 | msg.payload.compact.outdoor.temperature = module.dashboard_data.Temperature !== "undefined" ? module.dashboard_data.Temperature : "N.N."; 130 | msg.payload.compact.outdoor.humidity = module.dashboard_data.Humidity !== "undefined" ? module.dashboard_data.Humidity : "N.N."; 131 | msg.payload.compact.outdoor.temperatureTrend = station.dashboard_data.temp_trend !== "undefined" ? station.dashboard_data.temp_trend : "N.N."; 132 | } 133 | else { 134 | msg.payload.compact.outdoor.temperature = "N.N."; 135 | msg.payload.compact.outdoor.humidity = "N.N."; 136 | msg.payload.compact.outdoor.temperatureTrend = "N.N."; 137 | } 138 | } 139 | 140 | if (module.type === 'NAModule3') { //Rain Sensor 141 | 142 | msg.payload.compact.rain.reachable = module.reachable || "false"; 143 | msg.payload.compact.rain.battery_percent = module.battery_percent !== "undefined" ? module.battery_percent : "N.N."; 144 | msg.payload.compact.rain.rf_status = module.rf_status !== "undefined" ? module.rf_status : "N.N."; 145 | 146 | if (typeof module.dashboard_data !== "undefined") { 147 | 148 | 149 | msg.payload.compact.rain.rain = module.dashboard_data.Rain !== "undefined" ? module.dashboard_data.Rain : "N.N."; 150 | msg.payload.compact.rain.sum_rain_24 = module.dashboard_data.sum_rain_24 !== "undefined" ? module.dashboard_data.sum_rain_24 : "N.N."; 151 | msg.payload.compact.rain.sum_rain_1 = module.dashboard_data.sum_rain_1 !== "undefined" ? module.dashboard_data.sum_rain_1 : "N.N."; 152 | } 153 | else { 154 | msg.payload.compact.rain.rain = "N.N."; 155 | msg.payload.compact.rain.sum_rain_24 = "N.N."; 156 | msg.payload.compact.rain.sum_rain_1 = "N.N."; 157 | } 158 | } 159 | 160 | if (module.type === 'NAModule4') { 161 | 162 | var tmpObj = {}; 163 | 164 | tmpObj.name = module.module_name || "N.N."; 165 | tmpObj.data_type = module.data_type || "N.N."; 166 | 167 | tmpObj.battery_percent = module.battery_percent !== "undefined" ? module.battery_percent : "N.N."; 168 | tmpObj.rf_status = module.rf_status !== "undefined" ? module.rf_status : "N.N."; 169 | tmpObj.reachable = module.reachable || "false"; 170 | 171 | if (typeof module.dashboard_data !== "undefined") { 172 | tmpObj.dashboard_data = module.dashboard_data || "N.N."; 173 | tmpObj.temperature = module.dashboard_data.Temperature !== "undefined" ? module.dashboard_data.Temperature : "N.N."; 174 | tmpObj.Humidity = module.dashboard_data.Humidity !== "undefined" ? module.dashboard_data.Humidity : "N.N."; 175 | tmpObj.CO2 = module.dashboard_data.CO2 !== "undefined" ? module.dashboard_data.CO2 : "N.N."; 176 | tmpObj.min_temp = module.dashboard_data.min_temp !== "undefined" ? module.dashboard_data.min_temp : "N.N."; 177 | tmpObj.max_temp = module.dashboard_data.max_temp !== "undefined" ? module.dashboard_data.max_temp : "N.N."; 178 | tmpObj.date_min_temp = module.dashboard_data.date_min_temp !== "undefined" ? module.dashboard_data.date_min_temp : "N.N."; 179 | tmpObj.date_max_temp = module.dashboard_data.date_max_temp !== "undefined" ? module.dashboard_data.date_max_temp : "N.N."; 180 | } 181 | else { 182 | tmpObj.dashboard_data = "N.N."; 183 | tmpObj.temperature = "N.N."; 184 | tmpObj.Humidity = "N.N."; 185 | tmpObj.CO2 = "N.N."; 186 | tmpObj.min_temp = "N.N."; 187 | tmpObj.max_temp = "N.N."; 188 | tmpObj.date_min_temp = "N.N."; 189 | tmpObj.date_max_temp = "N.N."; 190 | } 191 | 192 | msg.payload.compact.modules.push(tmpObj); 193 | } 194 | }); 195 | } 196 | }); 197 | send(msg); 198 | done(); 199 | }); 200 | } 201 | RED.nodes.registerType('netatmo-dashboard', NetatmoDashboard); 202 | 203 | function NetatmoConfigNode(n) { 204 | RED.nodes.createNode(this, n); 205 | this.client_id = n.client_id; 206 | this.client_secret = n.client_secret; 207 | this.refresh_token = n.refresh_token; 208 | } 209 | RED.nodes.registerType('netatmo-config-node', NetatmoConfigNode); 210 | 211 | }; 212 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # node-red-contrib-netatmo-dashboard 2 | [Node-RED](http://nodered.org/docs/getting-started/installation) node to fetch all data (temperature, pressure, humidity, co2, noise, etc) from a NetAtmo device. 3 | 4 | Returns a payload which is split up into to parts: 5 | 6 | * a compact object which contains the most relevant information 7 | * a detailed object which contains the complete return from the netatmo api 8 | 9 | __Attention: The reachable status of the complete station seems not to changefor at least a 10 | couple of hours. While the reachable status of devices change after approximately 1h, 11 | the station itselve will shown as reachable even if this is not the case__ 12 | 13 | An Example: 14 | 15 | ``` 16 | { 17 | "compact": 18 | { 19 | "outdoor": 20 | { 21 | "reachable": true, 22 | "temperature":15.1, 23 | "humidity":86, 24 | "temperatureTrend":"down", 25 | "battery_percent":15, 26 | "rf_status":47 27 | }, 28 | "rain": 29 | { 30 | "reachable": true, 31 | "rain":0, 32 | "sum_rain_24":0.4, 33 | "sum_rain_1":0.101, 34 | "battery_percent":45, 35 | "rf_status":40 36 | }, 37 | modules: 38 | [ { 39 | name: 'wohnzimmer', 40 | data_type: [ 'Temperature', 'CO2', 'Humidity' ], 41 | "battery_percent": 14, 42 | "rf_status": 80, 43 | "reachable": true, 44 | "dashboard_data": 45 | { 46 | "time_utc": 1545901333, 47 | "Temperature": 23.1, 48 | "CO2": 1555, 49 | "Humidity": 50, 50 | "min_temp": 22.7, 51 | "max_temp": 23.6, 52 | "date_min_temp": 1545866372, 53 | "date_max_temp": 1545896155, 54 | "temp_trend": 'stable' 55 | }, 56 | "temperature": 23.1, 57 | "Humidity": 50, 58 | "CO2": 1555, 59 | "min_temp": 22.7, 60 | "max_temp": 23.6, 61 | "date_min_temp": 1545866372, 62 | "date_max_temp": 1545896155 }, 63 | { 64 | "name": 'Kinderzimmer', 65 | "data_type": [ 'Temperature', 'CO2', 'Humidity' ], 66 | "battery_percent": 45, 67 | "rf_status": 70, 68 | "reachable": true, 69 | "dashboard_data": 70 | { 71 | "time_utc": 1545901314, 72 | "Temperature": 23.2, 73 | "CO2": 1258, 74 | "Humidity": 48, 75 | "min_temp": 23, 76 | "max_temp": 23.6, 77 | "date_min_temp": 1545888753, 78 | "date_max_temp": 1545865225, 79 | "temp_trend": 'stable' 80 | }, 81 | "temperature": 23.2, 82 | "Humidity": 48, 83 | "CO2": 1258, 84 | "min_temp": 23, 85 | "max_temp": 23.6, 86 | "date_min_temp": 1545888753, 87 | "date_max_temp": 1545865225 88 | }, 89 | { 90 | "name": 'Schlafzimmer', 91 | "data_type": [ 'Temperature', 'CO2', 'Humidity'], 92 | battery_percent: 80, 93 | "rf_status": 68, 94 | "reachable": true, 95 | "dashboard_data": 96 | { 97 | "time_utc": 1545901314, 98 | "Temperature": 22.7, 99 | "CO2": 1497, 100 | "Humidity": 56, 101 | "min_temp": 22.5, 102 | "max_temp": 22.8, 103 | "date_min_temp": 1545865225, 104 | "date_max_temp": 1545885422, 105 | "temp_trend": 'stable' 106 | }, 107 | "temperature": 22.7, 108 | "Humidity": 56, 109 | "CO2: 1497", 110 | "min_temp": 22.5, 111 | "max_temp": 22.8, 112 | "date_min_temp": 1545865225, 113 | "date_max_temp": 1545885422 114 | }, 115 | "temperature":28.9, 116 | "co2":704, 117 | "humidity":43, 118 | "noise":43, 119 | "pressure":1021.3, 120 | "pressureTrend":"down", 121 | "station_name":"Netatmo#Main", 122 | "last_status_store":1536857210, 123 | "reachable": true, 124 | }, 125 | "detailed": 126 | [ 127 | { 128 | "_id":"70:ee:50:02:be:56", 129 | "cipher_id":"{your_cypher}", 130 | "date_setup":1397226153, 131 | "last_setup":1397226153, 132 | "type":"NAMain", 133 | "last_status_store":1536857210, 134 | "module_name":"Office", 135 | "firmware":132, 136 | "last_upgrade":1440050083, 137 | "wifi_status":26, 138 | "co2_calibrating":false, 139 | "station_name":"Netatmo#Main", 140 | "data_type":["Temperature","CO2","Humidity","Noise","Pressure"], 141 | "place":{"altitude":36,"city":"Berlin","country":"DE","timezone":"Europe/Berlin","location":[{lat},{long}]}, 142 | "dashboard_data": 143 | { 144 | "time_utc":1536857196, 145 | "Temperature":28.9, 146 | "CO2":704, 147 | "Humidity":43, 148 | "Noise":43, 149 | "Pressure":1021.3, 150 | "AbsolutePressure":1017, 151 | "min_temp":27.2, 152 | "max_temp":31.9, 153 | "date_min_temp":1536821144, 154 | "date_max_temp":1536813686, 155 | "temp_trend":"up", 156 | "pressure_trend":"down" 157 | }, 158 | "modules": 159 | [ 160 | { 161 | "_id":"03:00:00:00:db:38", 162 | "type":"NAModule4", 163 | "module_name":"wohnzimmer", 164 | "data_type":["Temperature","CO2","Humidity"], 165 | "last_setup":1397227514, 166 | "dashboard_data": 167 | { 168 | "time_utc":1536856881, 169 | "Temperature":26, 170 | "CO2":680, 171 | "Humidity":44, 172 | "min_temp":25.4, 173 | "max_temp":26.8, 174 | "date_min_temp":1536828835, 175 | "date_max_temp":1536791560, 176 | "temp_trend":"stable" 177 | }, 178 | "firmware":44, 179 | "last_message":1536857208, 180 | "last_seen":1536856881, 181 | "rf_status":89, 182 | "battery_vp":5196, 183 | "battery_percent":55 184 | }, 185 | { 186 | "_id":"02:00:00:02:cb:2e", 187 | "type":"NAModule1", 188 | "module_name":"Outdoor", 189 | "data_type":["Temperature","Humidity"], 190 | "last_setup":1397226241, 191 | "dashboard_data": 192 | { 193 | "time_utc":1536857170, 194 | "Temperature":15.1, 195 | "Humidity":86, 196 | "min_temp":13.4, 197 | "max_temp":17.6, 198 | "date_min_temp":1536818729, 199 | "date_max_temp":1536846917, 200 | "temp_trend":"down" 201 | }, 202 | "firmware":44, 203 | "last_message":1536857208, 204 | "last_seen":1536857170, 205 | "rf_status":47, 206 | "battery_vp":3968, 207 | "battery_percent":15 208 | }, 209 | { 210 | "_id":"03:00:00:01:0a:a4", 211 | "type":"NAModule4", 212 | "module_name":"Kinderzimmer", 213 | "data_type":["Temperature","CO2","Humidity"], 214 | "last_setup":1399312524, 215 | "dashboard_data": 216 | { 217 | "time_utc":1536857157, 218 | "Temperature":26.4, 219 | "CO2":721, 220 | "Humidity":42, 221 | "min_temp":25.4, 222 | "max_temp":27.6, 223 | "date_min_temp":1536829474, 224 | "date_max_temp":1536789645, 225 | "temp_trend":"stable" 226 | }, 227 | "firmware":44, 228 | "last_message":1536857208, 229 | "last_seen":1536857208, 230 | "rf_status":60, 231 | "battery_vp":5313, 232 | "battery_percent":62 233 | } 234 | ] 235 | } 236 | ] 237 | } 238 | ``` 239 | 240 | ## Authentication 241 | NetAtmo changed the authentication scheme in October 2022, in order to authenticate with your device you will need to create an application in [Netatmo Connect](https://dev.netatmo.com/) and obtain: *client_id*, *client_secret* and *refresh_token*. 242 | To get the refresh_token a OAuth2 client is needed (i.e. [Paw](https://paw.cloud/) for MacOS): use these params 243 | 244 | * client_id: from your app in Netatmo Connect 245 | * client_secret: from your app in Netamo Connect 246 | * Authorization URL: https://api.netatmo.com/oauth2/authorize 247 | * Access URL: https://api.netatmo.com/oauth2/token 248 | * Redirect URL: http://localhost 249 | 250 | ![Paw Refresh Token](https://raw.githubusercontent.com/guidone/node-red-contrib-netatmo-dashboard/e34cb8ae88fe5fd5c42f55742d74f6b950f6716d/images/refresh-token.png) 251 | 252 | Click on **Get token** and then on the input box of *Refresh token*. 253 | 254 | ## The MIT License 255 | Permission is hereby granted, free of charge, to any person obtaining a copy 256 | of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 257 | 258 | The above copyright notice and this permission notice shall be included in 259 | all copies or substantial portions of the Software. 260 | 261 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 262 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 263 | --------------------------------------------------------------------------------