From 86b3014c78d12ec3b7cd31830f3ebf22755f8812 Mon Sep 17 00:00:00 2001 From: Julian Greensmith Date: Mon, 24 Oct 2022 00:15:16 +1100 Subject: [PATCH 1/5] Adjust schema manadatory items --- package-lock.json | 4 ++-- package.json | 2 +- src/schema.ts | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9dfe9bc..0be4256 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "homebridge-actron-que", - "version": "1.2.3-beta.1", + "version": "1.2.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "homebridge-actron-que", - "version": "1.2.3-beta.1", + "version": "1.2.3", "license": "Apache-2.0", "dependencies": { "jtd": "^0.1.1", diff --git a/package.json b/package.json index 96651a3..501c527 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": false, "displayName": "Homebridge Actron Que", "name": "homebridge-actron-que", - "version": "1.2.3", + "version": "1.2.4-beta", "description": "Homebridge plugin for controlling Actron Que controller systems", "license": "Apache-2.0", "repository": { diff --git a/src/schema.ts b/src/schema.ts index 585f195..4bcad1d 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -40,7 +40,7 @@ export const SystemStatusSchema: Schema = { type: 'string', }, OutdoorUnit: { - properties: { + optionalProperties: { AmbTemp: { type: 'float64', }, @@ -114,10 +114,12 @@ export const SystemStatusSchema: Schema = { }, RemoteZoneInfo: { elements: { - properties: { + optionalProperties: { CanOperate: { type: 'boolean', }, + }, + properties: { LiveTemp_oC: { type: 'float64', }, From dc9f7267f30093d177360948e8d46bde2e55e5ae Mon Sep 17 00:00:00 2001 From: Julian Greensmith Date: Mon, 24 Oct 2022 00:20:00 +1100 Subject: [PATCH 2/5] fix beta version before npm publish --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 501c527..bb740f8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": false, "displayName": "Homebridge Actron Que", "name": "homebridge-actron-que", - "version": "1.2.4-beta", + "version": "1.2.4-beta.0", "description": "Homebridge plugin for controlling Actron Que controller systems", "license": "Apache-2.0", "repository": { From 221af3e85361b23eaae7ac9e69417f88eaf5031c Mon Sep 17 00:00:00 2001 From: Julian Greensmith Date: Mon, 24 Oct 2022 12:16:23 +1100 Subject: [PATCH 3/5] Configurable temperature thresholds --- config.schema.json | 163 ++++++++++++++++++++----------- package.json | 2 +- src/masterControllerAccessory.ts | 8 +- src/platform.ts | 28 ++++++ 4 files changed, 137 insertions(+), 64 deletions(-) diff --git a/config.schema.json b/config.schema.json index 1ac7f5f..bad7a04 100644 --- a/config.schema.json +++ b/config.schema.json @@ -1,63 +1,108 @@ { - "pluginAlias": "ActronQue", - "pluginType": "platform", - "singular": true, - "schema": { - "type": "object", - "properties": { - "name": { - "title": "Name", - "type": "string", - "required": true, - "default": "ActronQue" - }, - "username": { - "title": "Que Account Username", - "type": "string", - "required": true, - "placeholder": "myname@domain.com" - }, - "password": { - "title": "Que Account Password", - "type": "string", - "required": true, - "placeholder": "password" - }, - "zonesFollowMaster": { - "title": " Set ALL Zones to Master Temp on Master Temp Change", - "description": "Sets 'Control All Zones' for master temp changes. Recommended to leave this setting on.", - "type": "boolean", - "required": false, - "default": true - }, - "zonesPushMaster": { - "title": " Adjust Master Temp if Zone Set Outside of Permitted Thresholds", - "description": "If zone is set outside of allowed +/- 2 degree variance then push the master temp to allow setting", - "type": "boolean", - "required": false, - "default": true - }, - "clientName": { - "title": "Client Name", - "description": "Used to register plugin on Que Cloud as an 'Authorised Device' & default HomeKit name.", - "type": "string", - "required": true, - "default": "homebridgeQue" - }, - "refreshInterval": { - "title": "Periodic Refresh Interval", - "description": "Time in seconds to refresh device state information from Que API and in HomeKit.", - "type": "integer", - "required": false, - "default": 60 - }, - "deviceSerial": { - "title": "Que System Serial Number", - "description": "Only required if you have multiple systems in your Que cloud account.", - "type": "string", - "required": false, - "placeholder": "Leave Blank If You Have A Single Que System - Plugin Will Auto Discover" + "pluginAlias": "ActronQue", + "pluginType": "platform", + "singular": true, + "schema": { + "type": "object", + "properties": { + "name": { + "title": "Name", + "type": "string", + "required": true, + "default": "ActronQue" + }, + "username": { + "title": "Que Account Username", + "type": "string", + "required": true, + "placeholder": "myname@domain.com" + }, + "password": { + "title": "Que Account Password", + "type": "string", + "required": true, + "placeholder": "password" + }, + "zonesFollowMaster": { + "title": " Set ALL Zones to Master Temp on Master Temp Change", + "description": "Sets 'Control All Zones' for master temp changes. Recommended to leave this setting on.", + "type": "boolean", + "required": false, + "default": true + }, + "zonesPushMaster": { + "title": " Adjust Master Temp if Zone Set Outside of Permitted Thresholds", + "description": "If zone is set outside of allowed +/- 2 degree variance then push the master temp to allow setting", + "type": "boolean", + "required": false, + "default": true + }, + "clientName": { + "title": "Client Name", + "description": "Used to register plugin on Que Cloud as an 'Authorised Device' & default HomeKit name.", + "type": "string", + "required": true, + "default": "homebridgeQue" + }, + "refreshInterval": { + "title": "Periodic Refresh Interval", + "description": "Time in seconds to refresh device state information from Que API and in HomeKit.", + "type": "integer", + "required": false, + "default": 60 + }, + "deviceSerial": { + "title": "Que System Serial Number", + "description": "Only required if you have multiple systems in your Que cloud account.", + "type": "string", + "required": false, + "placeholder": "Leave Blank If You Have A Single Que System - Plugin Will Auto Discover" + }, + "adjustThresholds": { + "title": " Modify default heating cooling threshold temperatures", + "description": "Cooling default min/max = 20/32. Heating default min/max = 10/26", + "type": "boolean" + }, + "maxCoolingTemp": { + "title": "Maximum Cooling Temp", + "description": "Maximum temp setting for cooling in degrees celsius", + "type": "integer", + "required": false, + "default": 32, + "condition": { + "functionBody": "return model.adjustThresholds === true;" + } + }, + "minCoolingTemp": { + "title": "Minimum Cooling Temp", + "description": "Minimum temp setting for cooling in degrees celsius", + "type": "integer", + "required": false, + "default": 20, + "condition": { + "functionBody": "return model.adjustThresholds === true;" + } + }, + "maxHeatingTemp": { + "title": "Maximum Heating Temp", + "description": "Maximum temp setting for heating in degrees celsius", + "type": "integer", + "required": false, + "default": 26, + "condition": { + "functionBody": "return model.adjustThresholds === true;" + } + }, + "minHeatingTemp": { + "title": "Minimum Heating Temp", + "description": "Minimum temp setting for hetaing in degrees celsius", + "type": "integer", + "required": false, + "default": 10, + "condition": { + "functionBody": "return model.adjustThresholds === true;" } } } - } \ No newline at end of file + } +} \ No newline at end of file diff --git a/package.json b/package.json index bb740f8..a26ad40 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": false, "displayName": "Homebridge Actron Que", "name": "homebridge-actron-que", - "version": "1.2.4-beta.0", + "version": "1.2.4-beta.1", "description": "Homebridge plugin for controlling Actron Que controller systems", "license": "Apache-2.0", "repository": { diff --git a/src/masterControllerAccessory.ts b/src/masterControllerAccessory.ts index ba020a0..335dc29 100644 --- a/src/masterControllerAccessory.ts +++ b/src/masterControllerAccessory.ts @@ -50,8 +50,8 @@ export class MasterControllerAccessory { // The min/max values here are based on the hardcoded data taken from my unit this.hvacService.getCharacteristic(this.platform.Characteristic.HeatingThresholdTemperature) .setProps({ - minValue: 10, - maxValue: 26, + minValue: this.platform.minHeatingTemp, + maxValue: this.platform.maxHeatingTemp, minStep: 0.5, }) .onGet(this.getHeatingThresholdTemperature.bind(this)) @@ -60,8 +60,8 @@ export class MasterControllerAccessory { // The min/max values here are based on the hardcoded data taken from my unit this.hvacService.getCharacteristic(this.platform.Characteristic.CoolingThresholdTemperature) .setProps({ - minValue: 20, - maxValue: 32, + minValue: this.platform.minCoolingTemp, + maxValue: this.platform.maxCoolingTemp, minStep: 0.5, }) .onGet(this.getCoolingThresholdTemperature.bind(this)) diff --git a/src/platform.ts b/src/platform.ts index 11e1dac..e1e6028 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -22,6 +22,10 @@ export class ActronQuePlatform implements DynamicPlatformPlugin { readonly zonesPushMaster: boolean = true; readonly hardRefreshInterval: number = 60000; readonly softRefreshInterval: number = 5000; + readonly maxCoolingTemp: number = 32; + readonly minCoolingTemp: number = 20; + readonly maxHeatingTemp: number = 26; + readonly minHeatingTemp: number = 10; hvacInstance!: HvacUnit; constructor( @@ -56,6 +60,30 @@ export class ActronQuePlatform implements DynamicPlatformPlugin { } else { this.hardRefreshInterval = 60000; } + if (config['maxCoolingTemp']) { + this.maxCoolingTemp = config['maxCoolingTemp']; + this.log.debug('Cooling threshold max set to', this.maxCoolingTemp); + } else { + this.maxCoolingTemp = 32; + } + if (config['minCoolingTemp']) { + this.minCoolingTemp = config['minCoolingTemp']; + this.log.debug('Cooling threshold min set to', this.minCoolingTemp); + } else { + this.minCoolingTemp = 20; + } + if (config['maxHeatingTemp']) { + this.maxHeatingTemp = config['maxHeatingTemp']; + this.log.debug('Heating threshold max set to', this.maxHeatingTemp); + } else { + this.maxHeatingTemp = 26; + } + if (config['minHeatingTemp']) { + this.minHeatingTemp = config['minHeatingTemp']; + this.log.debug('Heating threshold min set to', this.minHeatingTemp); + } else { + this.minHeatingTemp = 26; + } // Check Required Config Fields if (!this.username) { From 7ca9fee68913d139443a74772b89fd650eb22a18 Mon Sep 17 00:00:00 2001 From: Julian Greensmith Date: Mon, 24 Oct 2022 12:19:04 +1100 Subject: [PATCH 4/5] Fix default min heating temp --- src/platform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform.ts b/src/platform.ts index e1e6028..48f8f7c 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -82,7 +82,7 @@ export class ActronQuePlatform implements DynamicPlatformPlugin { this.minHeatingTemp = config['minHeatingTemp']; this.log.debug('Heating threshold min set to', this.minHeatingTemp); } else { - this.minHeatingTemp = 26; + this.minHeatingTemp = 10; } // Check Required Config Fields From 7e7812f4e85599d8696f2eb04fedc9fb65f0e967 Mon Sep 17 00:00:00 2001 From: Julian Greensmith Date: Mon, 24 Oct 2022 13:12:16 +1100 Subject: [PATCH 5/5] Doc updates and add threshold option to zones --- README.md | 53 +++++++++++++++++++++++++++++++++- package.json | 2 +- src/zoneControllerAccessory.ts | 8 ++--- 3 files changed, 57 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f67e55f..03eb4f8 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ This is an 'almost' feature complete implementation of the Que platfrom in HomeK - Report battery level on zone sensors and get low battery alerts in the home app - Support for homebridge config UI +Fixes/Improvements in version 1.2.4 + - Improved support for variations in API data returned for differing models of Que systems + - Added option to override the defualt heating/cooling threshold temperatures via plugin configuration + Fixes/Improvements in version 1.2.3 - Resolve intermitent crash on device status refresh -> `https://github.com/jxg81/homebridge-actron-que/issues/3` - Implemented JSON Typedef schema validation for all Que API responses, see [Schema Validation Errors](#schema-validation-errors) @@ -96,7 +100,11 @@ If you are not using the Humbridge config UI you can add the following to your h             "zonesFollowMaster": true | false,             "zonesPushMaster": true | false, "refreshInterval": 60, - "deviceSerial": "" + "deviceSerial": "", + "maxCoolingTemp": 32, + "minCoolingTemp": 20, + "maxHeatingTemp": 26, + "minHeatingTemp": 10,         }] ``` @@ -162,13 +170,56 @@ default: true Setting this to true will make it so that chnages to the zone temprature setting in homekit will push the master unit threshold temps for heat and cool if required. There is a +/- 2 degree variation permitted between the master temp and zone temps. Normally the Que native controls will restrict you to this temp range unless you manually adjust the master temp first. This option simply pushes the master temp to a new setting if you set the zone outside of the variance. Setting this to true has greatly increased my familys satisfaction with the controls. #### `deviceSerial` + type: string (lowercase) default: "" In most cases you can exclude this option or leave it blank. If you only have a single air con system in your Que account the plugin will auto-discover the target device serial number. If you have multiple Que systems in your account you will need to specify which system you want to control by entering the serail number here. You can get your device serail numbers by logging in to que.actronair.com.au and looking at the list of authorised devices. +#### `maxCoolingTemp` + +type: number + +Unit: celsius + +default: 32 + +Highest temp that the cooling mode can be set. Refer to you Que system settings for the correct value. +This setting is optional and only needs to be set if the defaults do not align with your system configuration. + +#### `minCoolingTemp` + +type: number + +Unit: celsius + +default: 20 + +Lowest temp that the cooling mode can be set. Refer to you Que system settings for the correct value. +This setting is optional and only needs to be set if the defaults do not align with your system configuration. + +#### `maxHeatingTemp` + +type: number + +Unit: celsius + +default: 26 + +Highest temp that the heating mode can be set. Refer to you Que system settings for the correct value. +This setting is optional and only needs to be set if the defaults do not align with your system configuration. + +#### `minHeatingTemp` + +type: number + +Unit: celsius + +default: 10 +Lowest temp that the heating mode can be set. Refer to you Que system settings for the correct value. +This setting is optional and only needs to be set if the defaults do not align with your system configuration. ### HTTP Error Handling The plugin has been designed to manage the following HTTP error states diff --git a/package.json b/package.json index a26ad40..e3ce873 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": false, "displayName": "Homebridge Actron Que", "name": "homebridge-actron-que", - "version": "1.2.4-beta.1", + "version": "1.2.4", "description": "Homebridge plugin for controlling Actron Que controller systems", "license": "Apache-2.0", "repository": { diff --git a/src/zoneControllerAccessory.ts b/src/zoneControllerAccessory.ts index 291d5e9..1d896a5 100644 --- a/src/zoneControllerAccessory.ts +++ b/src/zoneControllerAccessory.ts @@ -70,8 +70,8 @@ export class ZoneControllerAccessory { // The min/max values here are based on the hardcoded data taken from my unit this.hvacService.getCharacteristic(this.platform.Characteristic.HeatingThresholdTemperature) .setProps({ - minValue: 10, - maxValue: 26, + minValue: this.platform.minHeatingTemp, + maxValue: this.platform.maxHeatingTemp, minStep: 0.5, }) .onGet(this.getHeatingThresholdTemperature.bind(this)) @@ -80,8 +80,8 @@ export class ZoneControllerAccessory { // The min/max values here are based on the hardcoded data taken from my unit this.hvacService.getCharacteristic(this.platform.Characteristic.CoolingThresholdTemperature) .setProps({ - minValue: 20, - maxValue: 32, + minValue: this.platform.minCoolingTemp, + maxValue: this.platform.maxCoolingTemp, minStep: 0.5, }) .onGet(this.getCoolingThresholdTemperature.bind(this))