From 58888c59804d8cd46f42c7b5e7bdfbc98b305727 Mon Sep 17 00:00:00 2001 From: Brendan Keyport Date: Sun, 3 Sep 2023 17:43:58 -0700 Subject: [PATCH 1/7] Dev testing - backup 1 --- README.md | 8 ++---- config.schema.json | 14 +++++++++- index.js | 69 ++++++++++++++++++++++++++++++++++++---------- package.json | 7 ++--- 4 files changed, 74 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 8de0dff..301712e 100755 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Model - This is to help homekit count the device as unique. Up to you. Serial Number - Any combo of letters and numbers - MUST BE UNIQUE. Homekit and some programs needs this to count the device. -URL - http://ip address/v1/current conditions. Replace "Ip address" with the address of your unit +URL - http://ip address/v1/current conditions. Replace "Ip address" with the address of your unit Trasmitter ID - the station's ID under "Device Configuration" on weatherlink.com. @@ -40,18 +40,16 @@ Units - Does your weather station provide temperature in Fahrenheit or Celsius. Use Internal Measurements - This will switch the plugin to use the internal/indoor measurements rather than external. -Note: The plugin will report "Socket hang up" from time to time. This is normal. I suspect the WLL box isn't able to handle generating the result and scaning the weather stations at the same time. This is why the polling interval is suggested to be different values above. The system will drift naturally and have more successes as it runs. +Note: The plugin will report various errors from time to time. This is normal. I suspect the WLL box isn't able to handle generating the result and scaning the weather stations at the same time. This is why the polling interval is suggested to be different values above. The system will drift naturally and have more successes as it runs. Testing is needed - if you use this - please let me know through github issues - if it works, if it don't, if something else is wrong, or if you can get rid of the "socket hang up" issue. Original Code by pmoon00, modifications and new work by bkeyport +Thanks to sschwetz for airlink data to add to the module. ## Donation As with all of my work, I don't want compensation for this. I would however, like you to donate to L'Arche Tahoma Hope, a 501(c)3 home for the disabled. Please donate to https://www.larchetahomahope.org/donate/ - Mark it in honor of Nancy Tyson or make a comment to the same. Thank you. - - - diff --git a/config.schema.json b/config.schema.json index 055a11a..24836bb 100755 --- a/config.schema.json +++ b/config.schema.json @@ -37,6 +37,18 @@ "description": "What is the complete URL to your Davis unit?", "default": "http:///v1/current_conditions" }, + "sensorType": { + "title": "Type of Sensor?", + "type": "number", + "required": true, + "default": 1, + "description": "What sensor are you using?", + "oneOf": [ + {"title": "External: Normal", "enum": [1] }, + {"title": "Internal: Normal", "enum": [2] }, + {"title": "External: Airlink", "enum": [3] } + ] + }, "txid": { "title": "Transmitter ID #", "type": "number", @@ -63,7 +75,7 @@ ] }, "useInternal": { - "title": "Use Internal Measurements", + "title": "Use Internal Measurements (depreciated, use sensor type above)", "type": "boolean", "default": false, "required": true diff --git a/index.js b/index.js index e811bbc..c3ef499 100755 --- a/index.js +++ b/index.js @@ -18,13 +18,22 @@ function davis(log, config) { this.pollingIntervalSeconds = parseInt(config["pollingIntervalSeconds"] || 300); this.temperatureUnitOfMeasure = (config["temperatureUnitOfMeasure"] || "C").toUpperCase(); this._timeoutID = -1; - this._cachedData = { "temperature": 0, "humidity": 0, "temperaturein": 0, "humidityin": 0 }; + this._cachedData = { "temperature": 0, "humidity": 0, "pm2p5:": 0, "pm10": 0}; this.serial = config["serial"] || "NotSetByUser"; this.getData(this.url); this.txid = config["txid"] || 1; this.useInternal = config ["useInternal"] || false; + this.sensorType = config ["sensorType"] || 1 ; + + //defaults + this.temperature = 0; + this.humidity = 0; + this.pm2p5 = 0; + this.pm10 = 0; + } + davis.prototype = { httpRequest: function (url, body, method, callback) { request({ @@ -104,26 +113,58 @@ davis.prototype = { let weather = jsonResponse.data.conditions; let length = weather.length; + + if (this.useInternal) { + this.sensorType = 2; + } for (let i = 0; i < length; i++) { - if (!this.useInternal) { - if (weather[i].data_structure_type == 1) { - if (weather[i].txid == this.txid) { + /* known to me data structure types: + * Vantage data: https://weatherlink.github.io/weatherlink-live-local-api/ + * Airlink data: https://weatherlink.github.io/airlink-local-api/ + * + * 1: External Current conditions (Vantage known) + * 2: Leaf/Soil Moisture records + * 3: Barometrics (Vantage known) + * 4: Internal Current conditions (weatherlink for sure) + * 5: Airlink Old Format + * 6: Airlink New External Current Conditions + */ + switch (weather[i].data_structure_type) { + case 1: + if (this.sensorType == 1) { + if (weather[i].txid == this.txid) { + this.temperature = weather[i].temp; + this.humidity = weather[i].hum; + } + } + break; + case 4: + if (this.sensorType == 2) { + this.temperature = weather[i].temp_in; + this.humidity = weather[i].hum_in; + } + break; + case 5: + if (this.sensorType == 3) { this.temperature = weather[i].temp; this.humidity = weather[i].hum; - }else{ - this.temperature = 0; - this.humidity = 0; + this.pm10 = weather[i].pm_10p0; + this.pm2p5 = weather[i].pm_2p5; } - } - } else { - if (weather[i].data_structure_type == 4) { - this.temperature = weather[i].temp_in; - this.humidity = weather[i].hum_in; + break; + case 6: + if (this.sensorType == 3) { + this.temperature = weather[i].temp; + this.humidity = weather[i].hum; + this.pm10 = weather[i].pm_10p0; + this.pm2p5 = weather[i].pm_2p5; + } + break; + default: + break; } } - } - this._cachedData = { "temperature": this.temperatureUnitOfMeasure == "F" ? this.convertFromFahrenheitToCelsius(this.temperature) : this.temperature, "humidity": Math.round(this.humidity), diff --git a/package.json b/package.json index c78389b..e6f5897 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-davis", - "version": "0.9.9", + "version": "0.9.10", "description": "Homebridge plugin that allows you to integrate your Davis WeatherLink Live station API.", "main": "index.js", "scripts": { @@ -28,10 +28,9 @@ }, "dependencies": { "request": "^2.87.0" - } - + }, "funding": { "type" : "individual", "url" : "http://bkeyport.mystrikingly.com" - } + } } From 8822825fe95f60c028eeaf02909519a43de93735 Mon Sep 17 00:00:00 2001 From: Brendan Keyport Date: Mon, 11 Sep 2023 15:14:07 -0700 Subject: [PATCH 2/7] 0.9.11 - clarification moves --- README.md | 2 +- config.schema.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 301712e..1f7538c 100755 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Model - This is to help homekit count the device as unique. Up to you. Serial Number - Any combo of letters and numbers - MUST BE UNIQUE. Homekit and some programs needs this to count the device. -URL - http://ip address/v1/current conditions. Replace "Ip address" with the address of your unit +URL - http://ip address/v1/current conditions. Replace "Ip address" with the _direct_ address to your unit. It will not work with any interpeted addresses like WifiLogger. Trasmitter ID - the station's ID under "Device Configuration" on weatherlink.com. diff --git a/config.schema.json b/config.schema.json index 24836bb..ec501e0 100755 --- a/config.schema.json +++ b/config.schema.json @@ -34,7 +34,7 @@ "title": "Access URL", "type": "string", "required": true, - "description": "What is the complete URL to your Davis unit?", + "description": "What is the complete URL DIRECTLY to your Davis unit?", "default": "http:///v1/current_conditions" }, "sensorType": { diff --git a/package.json b/package.json index e6f5897..7857479 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-davis", - "version": "0.9.10", + "version": "0.9.11", "description": "Homebridge plugin that allows you to integrate your Davis WeatherLink Live station API.", "main": "index.js", "scripts": { From f8c50156155b44da39fbe9a858daa2e57eb86001 Mon Sep 17 00:00:00 2001 From: Brendan Keyport Date: Wed, 13 Sep 2023 23:24:59 -0700 Subject: [PATCH 3/7] 0.9.50 Airlink AQI should be working --- README.md | 9 ++-- config.schema.json | 2 +- index.js | 103 ++++++++++++++++++++++++++++++++++++--------- package.json | 27 ++++++++++-- 4 files changed, 113 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 1f7538c..0508a33 100755 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ This will call your Davis WeatherLink Live station API. It will search your Davi You can also select the internal (indoor) temps as evaluated by the Weatherlink Live control box. - The API will be called once at start up and polled periodically. The results will be stored in memory, to prevent slowness when opening the Home app. ## Configuration @@ -32,18 +31,22 @@ Serial Number - Any combo of letters and numbers - MUST BE UNIQUE. Homekit and s URL - http://ip address/v1/current conditions. Replace "Ip address" with the _direct_ address to your unit. It will not work with any interpeted addresses like WifiLogger. -Trasmitter ID - the station's ID under "Device Configuration" on weatherlink.com. +Type of Sensor - Do you have a regular weatherlink or Airlink type unit? Internal is also selected here. + +Transmitter ID - the station's ID under "Device Configuration" on weatherlink.com. Polling interval - How often should it recheck? (Note: Set different values if you're using more than one device on the same Weatherlink hub) Units - Does your weather station provide temperature in Fahrenheit or Celsius. Homebridge needs to convert to Celsius for Homekit. -Use Internal Measurements - This will switch the plugin to use the internal/indoor measurements rather than external. +Use Internal Measurements - Left in for backwards compatibility - please use "type of sensor" above instead. Note: The plugin will report various errors from time to time. This is normal. I suspect the WLL box isn't able to handle generating the result and scaning the weather stations at the same time. This is why the polling interval is suggested to be different values above. The system will drift naturally and have more successes as it runs. Testing is needed - if you use this - please let me know through github issues - if it works, if it don't, if something else is wrong, or if you can get rid of the "socket hang up" issue. +Due to lack of time, support for this module is only provided through issues on Github. Thanks. + Original Code by pmoon00, modifications and new work by bkeyport Thanks to sschwetz for airlink data to add to the module. diff --git a/config.schema.json b/config.schema.json index ec501e0..6c1b122 100755 --- a/config.schema.json +++ b/config.schema.json @@ -75,7 +75,7 @@ ] }, "useInternal": { - "title": "Use Internal Measurements (depreciated, use sensor type above)", + "title": "legacy switch, uncheck if checked, and use internal above", "type": "boolean", "default": false, "required": true diff --git a/index.js b/index.js index c3ef499..0338ff9 100755 --- a/index.js +++ b/index.js @@ -28,11 +28,32 @@ function davis(log, config) { //defaults this.temperature = 0; this.humidity = 0; + //Specific to Airlink this.pm2p5 = 0; this.pm10 = 0; } +function computeAqiFromPm(averagePM25, averagePM10) { + const limits25 = [15, 30, 55, 110] + const limits10 = [25, 50, 90, 180] + if (averagePM25 === 0 && averagePM10 === 0) { + return Characteristic.AirQuality.UNKNOWN; + } + if (averagePM25 <= limits25[0] && averagePM10 <= limits10[0]) { + return Characteristic.AirQuality.EXCELLENT; + } + if (averagePM25 <= limits25[1] && averagePM10 <= limits10[1]) { + return Characteristic.AirQuality.GOOD; + } + if (averagePM25 <= limits25[2] && averagePM10 <= limits10[2]) { + return Characteristic.AirQuality.FAIR; + } + if (averagePM25 <= limits25[3] && averagePM10 <= limits10[3]) { + return Characteristic.AirQuality.INFERIOR; + } + return Characteristic.AirQuality.POOR; +} davis.prototype = { httpRequest: function (url, body, method, callback) { @@ -54,6 +75,18 @@ davis.prototype = { callback(null, this._cachedData.temperature); }, + getAirQuality: function (callback) { + callback(null, this._cachedData.airQuality); + }, + + getPM2p5: function (callback) { + callback(null, this._cachedData.pm2p5); + }, + + getPM10: function (callback) { + callback(null, this._cachedData.pm10); + }, + getServices: function () { var services = [], informationService = new Service.AccessoryInformation(); @@ -75,10 +108,23 @@ davis.prototype = { .getCharacteristic(Characteristic.CurrentRelativeHumidity) .setProps({minValue: 0, maxValue: 100}) .on("get", this.getStateHumidity.bind(this)); - services.push(this.humidityService); - - - return services; + services.push(this.humidityService); + + if (this.sensorType == 3) { + this.airQualityService = new Service.AirQualitySensor(this.name); + this.airQualityService + .getCharacteristic(Characteristic.AirQuality) + .on("get", this.getAirQuality.bind(this)); + this.airQualityService + .getCharacteristic(Characteristic.PM2p5Density) + .on("get", this.getPM2p5.bind(this)); + this.airQualityService + .getCharacteristic(Characteristic.PM10Density) + .on("get", this.getPM10.bind(this)); + services.push(this.airQualityService); + } + + return services; }, getData: function (url) { @@ -94,15 +140,13 @@ davis.prototype = { this.getData(this.url); }.bind(this), this.pollingIntervalSeconds * 1000); }.bind(this); - if (error) { this.log.error("Request to Davis API failed: %s", error.message); queue(); return; } - this.log("Request to Davis API succeeded!"); - + var jsonResponse = JSON.parse(responseBody); if (jsonResponse.data && (!jsonResponse.data.conditions || jsonResponse.data.conditions.length == 0)) { @@ -123,28 +167,30 @@ davis.prototype = { * Vantage data: https://weatherlink.github.io/weatherlink-live-local-api/ * Airlink data: https://weatherlink.github.io/airlink-local-api/ * - * 1: External Current conditions (Vantage known) + * 1: Vantage External (at minimum) * 2: Leaf/Soil Moisture records - * 3: Barometrics (Vantage known) - * 4: Internal Current conditions (weatherlink for sure) - * 5: Airlink Old Format - * 6: Airlink New External Current Conditions + * 3: Barometrics + * 4: Internal (Weatherlink Transmitter) + * 5: Airlink Old Format External + * 6: Airlink New Format External */ switch (weather[i].data_structure_type) { case 1: if (this.sensorType == 1) { if (weather[i].txid == this.txid) { this.temperature = weather[i].temp; - this.humidity = weather[i].hum; + this.humidity = weather[i].hum; } } break; + case 4: if (this.sensorType == 2) { this.temperature = weather[i].temp_in; this.humidity = weather[i].hum_in; } break; + case 5: if (this.sensorType == 3) { this.temperature = weather[i].temp; @@ -153,28 +199,43 @@ davis.prototype = { this.pm2p5 = weather[i].pm_2p5; } break; + case 6: if (this.sensorType == 3) { - this.temperature = weather[i].temp; + this.temperature = weather[i].temp; this.humidity = weather[i].hum; - this.pm10 = weather[i].pm_10p0; + this.pm10 = weather[i].pm_10; this.pm2p5 = weather[i].pm_2p5; + this.log.debug("%s %s %s %s", this.temperature, this.humidity, this.pm10, this.pm2p5); } break; + default: break; } } - this._cachedData = { - "temperature": this.temperatureUnitOfMeasure == "F" ? this.convertFromFahrenheitToCelsius(this.temperature) : this.temperature, - "humidity": Math.round(this.humidity), - - + this.log.debug("%s %s %s %s", this.temperature, this.humidity, this.pm10, this.pm2p5); + + if (this.sensorType == 3) { + this._cachedData = { + "temperature": this.temperatureUnitOfMeasure == "F" ? this.convertFromFahrenheitToCelsius(this.temperature) : this.temperature, + "humidity": Math.round(this.humidity), + "pm2p5": this.pm2p5, + "pm10": this.pm10, + "airQuality": computeAqiFromPm(this.pm2p5, this.pm10), + } + } else { + this._cachedData = { + "temperature": this.temperatureUnitOfMeasure == "F" ? this.convertFromFahrenheitToCelsius(this.temperature) : this.temperature, + "humidity": Math.round(this.humidity), + } }; - this.log.debug("Temp %s, Hum %s", this._cachedData.temperature, this._cachedData.humidity); + this.log.debug("%s %s %s %s", this.temperature, this.humidity, this.pm2p5, this.pm10); + this.log.debug("%s %s %s %s", this._cachedData.temperature, this._cachedData.humidity, this.pm2p5, this.pm10); queue(); }.bind(this)); }, + convertFromFahrenheitToCelsius: function (f) { //MUST BE A NUMBER! return parseFloat(((f - 32) * (5 / 9)).toFixed(1)); } diff --git a/package.json b/package.json index 7857479..2be775c 100755 --- a/package.json +++ b/package.json @@ -1,18 +1,36 @@ { "name": "homebridge-davis", - "version": "0.9.11", + "version": "0.9.50", "description": "Homebridge plugin that allows you to integrate your Davis WeatherLink Live station API.", "main": "index.js", + "homepage": "https://github.com/BKeyport/homebridge-davis", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "author": "Phillip Moon (pmoon00)/Brendan Keyport (Brendan Keyport)", + "author": { + "name": "Brendan Keyport", + "url": "https://github.com/bkeyport/" + }, + "contributors": [ + { + "name": "Phillip Moon (Original Code)", + "url": "https://github.com/pmoon00/" + }, + { + "name": "Jón Tómas Grétarsson (Original Code)", + "url": "https://github.com/jontg/" + }, + { + "name": "Stephen Schwetz (Data for testing airlink)", + "url": "https://github.com/sschwetz/" + } + ], "license": "MIT", "keywords": [ "homebridge-plugin", "homebridge", "homebridge-davisweatherlinklive", - "homebridge-davisfixed", + "homebridge-davis", "temperature", "humidity", "davis weatherlink live", @@ -32,5 +50,8 @@ "funding": { "type" : "individual", "url" : "http://bkeyport.mystrikingly.com" + }, + "bugs": { + "url": "https://github.com/BKeyport/homebridge-davis/issues" } } From f1f9bab19504a356b5b3f1e4ae591f0c468af8b6 Mon Sep 17 00:00:00 2001 From: Brendan Keyport Date: Sat, 30 Sep 2023 18:18:49 -0700 Subject: [PATCH 4/7] 0.9.51 - regress part of AQI code to make things work --- index.js | 42 ++++++++++++++++++++++++------------------ package.json | 2 +- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/index.js b/index.js index 0338ff9..e900c2f 100755 --- a/index.js +++ b/index.js @@ -18,7 +18,7 @@ function davis(log, config) { this.pollingIntervalSeconds = parseInt(config["pollingIntervalSeconds"] || 300); this.temperatureUnitOfMeasure = (config["temperatureUnitOfMeasure"] || "C").toUpperCase(); this._timeoutID = -1; - this._cachedData = { "temperature": 0, "humidity": 0, "pm2p5:": 0, "pm10": 0}; + this._cachedData = { "temperature": 0, "humidity": 0, "PM2p5:": 0, "PM10": 0}; this.serial = config["serial"] || "NotSetByUser"; this.getData(this.url); this.txid = config["txid"] || 1; @@ -29,8 +29,8 @@ function davis(log, config) { this.temperature = 0; this.humidity = 0; //Specific to Airlink - this.pm2p5 = 0; - this.pm10 = 0; + this.PM2p5 = 0; + this.PM10 = 0; } @@ -80,11 +80,11 @@ davis.prototype = { }, getPM2p5: function (callback) { - callback(null, this._cachedData.pm2p5); + callback(null, this._cachedData.PM2p5); }, getPM10: function (callback) { - callback(null, this._cachedData.pm10); + callback(null, this._cachedData.PM10); }, getServices: function () { @@ -112,15 +112,21 @@ davis.prototype = { if (this.sensorType == 3) { this.airQualityService = new Service.AirQualitySensor(this.name); + this.airQualityService .getCharacteristic(Characteristic.AirQuality) .on("get", this.getAirQuality.bind(this)); - this.airQualityService + +/* this.airQualityService .getCharacteristic(Characteristic.PM2p5Density) - .on("get", this.getPM2p5.bind(this)); + .on("get", this.getPM2p5.bind(this)); +*/ + this.airQualityService .getCharacteristic(Characteristic.PM10Density) .on("get", this.getPM10.bind(this)); + + services.push(this.airQualityService); } @@ -195,8 +201,8 @@ davis.prototype = { if (this.sensorType == 3) { this.temperature = weather[i].temp; this.humidity = weather[i].hum; - this.pm10 = weather[i].pm_10p0; - this.pm2p5 = weather[i].pm_2p5; + this.PM10 = weather[i].pm_10p0; + this.PM2p5 = weather[i].pm_2p5; } break; @@ -204,9 +210,9 @@ davis.prototype = { if (this.sensorType == 3) { this.temperature = weather[i].temp; this.humidity = weather[i].hum; - this.pm10 = weather[i].pm_10; - this.pm2p5 = weather[i].pm_2p5; - this.log.debug("%s %s %s %s", this.temperature, this.humidity, this.pm10, this.pm2p5); + this.PM10 = weather[i].pm_10; + this.PM2p5 = weather[i].pm_2p5; + this.log.debug("%s %s %s %s", this.temperature, this.humidity, this.PM10, this.PM2p5); } break; @@ -214,15 +220,15 @@ davis.prototype = { break; } } - this.log.debug("%s %s %s %s", this.temperature, this.humidity, this.pm10, this.pm2p5); + this.log.debug("%s %s %s %s", this.temperature, this.humidity, this.PM10, this.PM2p5); if (this.sensorType == 3) { this._cachedData = { "temperature": this.temperatureUnitOfMeasure == "F" ? this.convertFromFahrenheitToCelsius(this.temperature) : this.temperature, "humidity": Math.round(this.humidity), - "pm2p5": this.pm2p5, - "pm10": this.pm10, - "airQuality": computeAqiFromPm(this.pm2p5, this.pm10), + "PM2p5": this.PM2p5, + "PM10": this.PM10, + "airQuality": computeAqiFromPm(this.PM2p5, this.PM10), } } else { this._cachedData = { @@ -230,8 +236,8 @@ davis.prototype = { "humidity": Math.round(this.humidity), } }; - this.log.debug("%s %s %s %s", this.temperature, this.humidity, this.pm2p5, this.pm10); - this.log.debug("%s %s %s %s", this._cachedData.temperature, this._cachedData.humidity, this.pm2p5, this.pm10); + this.log.debug("%s %s %s %s", this.temperature, this.humidity, this.PM2p5, this.PM10); + this.log.debug("%s %s %s %s", this._cachedData.temperature, this._cachedData.humidity, this.PM2p5, this.PM10); queue(); }.bind(this)); }, diff --git a/package.json b/package.json index 2be775c..6d03ba5 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-davis", - "version": "0.9.50", + "version": "0.9.51", "description": "Homebridge plugin that allows you to integrate your Davis WeatherLink Live station API.", "main": "index.js", "homepage": "https://github.com/BKeyport/homebridge-davis", From 4ae3618f3d81b0959840020da913ee5c7ae42d9a Mon Sep 17 00:00:00 2001 From: Brendan Keyport Date: Sun, 1 Oct 2023 17:25:31 -0700 Subject: [PATCH 5/7] 0.9.55 - Apple is different. Fixed PM2.5 --- index.js | 5 ++--- package.json | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index e900c2f..0e17dce 100755 --- a/index.js +++ b/index.js @@ -117,10 +117,9 @@ davis.prototype = { .getCharacteristic(Characteristic.AirQuality) .on("get", this.getAirQuality.bind(this)); -/* this.airQualityService - .getCharacteristic(Characteristic.PM2p5Density) + this.airQualityService + .getCharacteristic(Characteristic.PM2_5Density) .on("get", this.getPM2p5.bind(this)); -*/ this.airQualityService .getCharacteristic(Characteristic.PM10Density) diff --git a/package.json b/package.json index 6d03ba5..597f4f4 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-davis", - "version": "0.9.51", + "version": "0.9.55", "description": "Homebridge plugin that allows you to integrate your Davis WeatherLink Live station API.", "main": "index.js", "homepage": "https://github.com/BKeyport/homebridge-davis", From be7e6a7d17603cff68edbdc10074aefb39fc895a Mon Sep 17 00:00:00 2001 From: "B. Keyport" <44744076+BKeyport@users.noreply.github.com> Date: Fri, 19 Jul 2024 19:47:23 -0700 Subject: [PATCH 6/7] update to 1.0.0, misc changes --- README.md | 2 -- index.js | 4 ++-- package.json | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0508a33..61291d2 100755 --- a/README.md +++ b/README.md @@ -43,8 +43,6 @@ Use Internal Measurements - Left in for backwards compatibility - please use "ty Note: The plugin will report various errors from time to time. This is normal. I suspect the WLL box isn't able to handle generating the result and scaning the weather stations at the same time. This is why the polling interval is suggested to be different values above. The system will drift naturally and have more successes as it runs. -Testing is needed - if you use this - please let me know through github issues - if it works, if it don't, if something else is wrong, or if you can get rid of the "socket hang up" issue. - Due to lack of time, support for this module is only provided through issues on Github. Thanks. Original Code by pmoon00, modifications and new work by bkeyport diff --git a/index.js b/index.js index 0e17dce..18e0573 100755 --- a/index.js +++ b/index.js @@ -146,11 +146,11 @@ davis.prototype = { }.bind(this), this.pollingIntervalSeconds * 1000); }.bind(this); if (error) { - this.log.error("Request to Davis API failed: %s", error.message); + this.log.error("Request to Davis API failed: %s (infrequent errors is normal)", error.message); queue(); return; } - this.log("Request to Davis API succeeded!"); + this.log.debug("Request to Davis API succeeded!"); var jsonResponse = JSON.parse(responseBody); diff --git a/package.json b/package.json index 597f4f4..244c561 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-davis", - "version": "0.9.55", + "version": "1.0.0", "description": "Homebridge plugin that allows you to integrate your Davis WeatherLink Live station API.", "main": "index.js", "homepage": "https://github.com/BKeyport/homebridge-davis", From 6fd843ea050b30f3e1fb8fd0b66619137a01bf35 Mon Sep 17 00:00:00 2001 From: "B. Keyport" <44744076+BKeyport@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:07:19 -0700 Subject: [PATCH 7/7] Indicate ready for HB 2 Confirmed readyness for HB 2 --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 244c561..f418ff7 100755 --- a/package.json +++ b/package.json @@ -36,9 +36,9 @@ "davis weatherlink live", "davis weatherlink" ], - "engines": { - "homebridge": ">=0.4.0", - "node": ">=0.12.0" + "engines": { + "homebridge": "^1.6.0 || ^2.0.0-beta.0", + "node": "^18.20.4 || ^20.15.1" }, "repository": { "type": "git",