From 8b9c3f0cea5ac68027594bce070d30621dc61e55 Mon Sep 17 00:00:00 2001 From: Tellicious Date: Tue, 17 Oct 2023 15:33:47 +0200 Subject: [PATCH 1/3] Added flag to enable/disable AirQuality sensor for indoor module --- HISTORY.md | 3 +++ README.md | 1 + accessory/eveatmo-room-accessory.js | 10 ++++++---- config.schema.json | 6 ++++++ index.js | 3 ++- package.json | 2 +- 6 files changed, 19 insertions(+), 6 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 97ed726..2ce8429 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,8 @@ ## version history +## 1.1.1 +- Add new flag to enable/disable AirQuality sensor for indoor modules + ### 1.1.0 - allows new auth method (via refreshtoken) and old one (via password) - added config-schema to configure this via UI diff --git a/README.md b/README.md index ff9613f..ebaa38d 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ You can also configure this plugin via [ConfigUI-X's settings](https://github.co - **weatherstation** Enables support for Netatmo's WeatherStation. Default value is *true* - **airquality** Enables support for Netatmo's Indoor Air Quality monitor. Default value is *false* +- **extra_aq_sensor: (optional)** Adds an extra AirQuality sensor which is available via Apple's stock Home.app, reporting CO2 level. Default value is *false* - **extra_co2_sensor: (optional)** Adds an extra CO2 sensor which is available via Apple's stock Home.app, too. Default value is *false* - **co2_alert_threshold (optional):** Sets the co2-level [ppm] at which the sensors switch to alert-state - **ttl: (optional)** Seconds between two Netatmo API polls. Lower is not neccessarily better! The weatherstation itself collects one value per 5minutes, so going below 300s makes no sense. Default value is *540* (=9min) diff --git a/accessory/eveatmo-room-accessory.js b/accessory/eveatmo-room-accessory.js index 07a0e9b..767269d 100644 --- a/accessory/eveatmo-room-accessory.js +++ b/accessory/eveatmo-room-accessory.js @@ -50,10 +50,12 @@ module.exports = function(pHomebridge) { var HumidityService = require(serviceDir + '/eveatmo-humidity')(homebridge); var serviceHumidity = new HumidityService(this); this.addService(serviceHumidity); - - var EveatmoRoomAirqualityService = require(serviceDir + '/eveatmo-room-airquality')(homebridge); - var serviceAirquality = new EveatmoRoomAirqualityService(this); - this.addService(serviceAirquality); + + if(this.config.extra_aq_sensor) { + var EveatmoRoomAirqualityService = require(serviceDir + '/eveatmo-room-airquality')(homebridge); + var serviceAirquality = new EveatmoRoomAirqualityService(this); + this.addService(serviceAirquality); + } if(this.config.extra_co2_sensor) { var EveatmoRoomCo2Service = require(serviceDir + '/eveatmo-co2')(homebridge); diff --git a/config.schema.json b/config.schema.json index 1eda9b2..492ad0d 100755 --- a/config.schema.json +++ b/config.schema.json @@ -20,6 +20,12 @@ "minimum": 300, "description": "Seconds between two Netatmo API polls (default 540)" }, + "extra_aq_sensor": { + "title": "Extra AirQuality sensor", + "type": "boolean", + "default": false, + "description": "Adds an extra AirQuality sensor reporting CO2 level" + }, "extra_co2_sensor": { "title": "Extra CO2 sensor", "type": "boolean", diff --git a/index.js b/index.js index fe3556f..680bdd9 100755 --- a/index.js +++ b/index.js @@ -17,7 +17,8 @@ class EveatmoPlatform { this.foundAccessories = []; this.config.weatherstation = typeof config.weatherstation !== 'undefined' ? Boolean(config.weatherstation) : true; - this.config.extra_co2_sensor = typeof config.extra_co2_sensor !== 'undefined' ? Boolean(config.extra_co2_sensor) : false; + this.config.extra_aq_sensor = typeof config.extra_aq_sensor !== 'undefined' ? Boolean(config.extra_aq_sensor) : false; + this.config.extra_co2_sensor = typeof config.extra_co2_sensor !== 'undefined' ? Boolean(config.extra_co2_sensor) : false; this.config.co2_alert_threshold = typeof config.co2_alert_threshold !== 'undefined' ? parseInt(config.co2_alert_threshold) : 1000; this.config.module_suffix = typeof config.module_suffix !== 'undefined' ? config.module_suffix : ''; diff --git a/package.json b/package.json index 5c22991..0964d08 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-eveatmo", - "version": "1.1.0", + "version": "1.1.1", "description": "Homebridge plugin which adds a Netatmo weatherstation as HomeKit device and tries to act like Elgato Eve Room/Weather", "license": "ISC", "keywords": [ From 63dcf5c96e3aa85aa06390dd4c1ca8aa88724617 Mon Sep 17 00:00:00 2001 From: Sebastian K Date: Wed, 10 Apr 2024 18:16:48 +0200 Subject: [PATCH 2/3] switched default-state for new aq-sensor-flag from false to true --- HISTORY.md | 5 +++-- config.schema.json | 2 +- index.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 2ce8429..4a69b2c 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,7 +1,8 @@ ## version history -## 1.1.1 -- Add new flag to enable/disable AirQuality sensor for indoor modules +### 1.1.1 +- Thanks to a PR (https://github.com/skrollme/homebridge-eveatmo/pull/76) from @Tellicious: + - Add new flag to enable/disable AirQuality sensor for indoor modules ### 1.1.0 - allows new auth method (via refreshtoken) and old one (via password) diff --git a/config.schema.json b/config.schema.json index 492ad0d..6806b6f 100755 --- a/config.schema.json +++ b/config.schema.json @@ -23,7 +23,7 @@ "extra_aq_sensor": { "title": "Extra AirQuality sensor", "type": "boolean", - "default": false, + "default": true, "description": "Adds an extra AirQuality sensor reporting CO2 level" }, "extra_co2_sensor": { diff --git a/index.js b/index.js index 680bdd9..4a3df3c 100755 --- a/index.js +++ b/index.js @@ -17,7 +17,7 @@ class EveatmoPlatform { this.foundAccessories = []; this.config.weatherstation = typeof config.weatherstation !== 'undefined' ? Boolean(config.weatherstation) : true; - this.config.extra_aq_sensor = typeof config.extra_aq_sensor !== 'undefined' ? Boolean(config.extra_aq_sensor) : false; + this.config.extra_aq_sensor = typeof config.extra_aq_sensor !== 'undefined' ? Boolean(config.extra_aq_sensor) : true; this.config.extra_co2_sensor = typeof config.extra_co2_sensor !== 'undefined' ? Boolean(config.extra_co2_sensor) : false; this.config.co2_alert_threshold = typeof config.co2_alert_threshold !== 'undefined' ? parseInt(config.co2_alert_threshold) : 1000; From 224938959eb862022d028c10a33184939cb0cb53 Mon Sep 17 00:00:00 2001 From: Sebastian K Date: Wed, 10 Apr 2024 18:18:52 +0200 Subject: [PATCH 3/3] fixed readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ebaa38d..8ef8f4c 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ You can also configure this plugin via [ConfigUI-X's settings](https://github.co - **weatherstation** Enables support for Netatmo's WeatherStation. Default value is *true* - **airquality** Enables support for Netatmo's Indoor Air Quality monitor. Default value is *false* -- **extra_aq_sensor: (optional)** Adds an extra AirQuality sensor which is available via Apple's stock Home.app, reporting CO2 level. Default value is *false* +- **extra_aq_sensor: (optional)** Adds an extra AirQuality sensor which is available via Apple's stock Home.app, reporting CO2 level. Default value is *true* - **extra_co2_sensor: (optional)** Adds an extra CO2 sensor which is available via Apple's stock Home.app, too. Default value is *false* - **co2_alert_threshold (optional):** Sets the co2-level [ppm] at which the sensors switch to alert-state - **ttl: (optional)** Seconds between two Netatmo API polls. Lower is not neccessarily better! The weatherstation itself collects one value per 5minutes, so going below 300s makes no sense. Default value is *540* (=9min)