diff --git a/README.md b/README.md index d1675ac..1f3290a 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ This is an 'almost' feature complete implementation of the Que platform 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.7 + - Allow master controller to also operate as a zone controller + - Resolved issue with logic controlling "Zones Push Master" temp adjustments which was causing setting to fail on first attempt + 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 default heating/cooling threshold temperatures via plugin configuration diff --git a/package.json b/package.json index db61acb..7d5cb4d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": false, "displayName": "Homebridge Actron Que", "name": "homebridge-actron-que", - "version": "1.2.6", + "version": "1.2.7", "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 4022362..70eda25 100644 --- a/src/masterControllerAccessory.ts +++ b/src/masterControllerAccessory.ts @@ -2,7 +2,7 @@ import { Service, PlatformAccessory, CharacteristicValue, HAPStatus } from 'home import { ClimateMode, CompressorMode, FanMode, PowerState } from './types'; import { ActronQuePlatform } from './platform'; -// This class represents the master controller, a separate class is used for representing zones (or will be once i write it) +// This class represents the master controller, a separate class is used for representing zones export class MasterControllerAccessory { private hvacService: Service; private humidityService: Service; diff --git a/src/queApi.ts b/src/queApi.ts index 7716526..8a0409c 100644 --- a/src/queApi.ts +++ b/src/queApi.ts @@ -365,10 +365,9 @@ export default class QueApi { loopIndex++; const sensorId = Object.keys(zone['Sensors'])[0]; - // Skip the zone entries that aren't populated with a remote sensor, these seem to all have 'MASTER_CONTROLLER' as the - // 'NV_Kind'. This works for my system, you may want to check the response data here if you have zone - // detection issues on your system - if (zone['Sensors'][sensorId]['NV_Kind'] === 'MASTER_CONTROLLER') { + // Have updated the logic from version 1.2.7 to check field NV_Exists to determine if zone is populated as have found an example + // where the master controller is also the zone controller. Validated this logic should work across four different sample systems. + if (!zone['NV_Exists']) { continue; } @@ -388,7 +387,7 @@ export default class QueApi { minCoolSetPoint: zone['MinCoolSetpoint'], currentHeatingSetTemp: zone['TemperatureSetpoint_Heat_oC'], currentCoolingSetTemp: zone['TemperatureSetpoint_Cool_oC'], - zoneSensorBattery: zone['Sensors'][sensorId]['Battery_pc'], + zoneSensorBattery: zone['Sensors'][sensorId]['Battery_pc'] === undefined ? 100 : zone['Sensors'][sensorId]['Battery_pc'], currentHumidity: zone['LiveHumidity_pc'] === undefined ? 'notSupported' : zone['LiveHumidity_pc'], }; zoneCurrentStatus.push(zoneData); diff --git a/src/zoneControllerAccessory.ts b/src/zoneControllerAccessory.ts index 35dfaea..66b403d 100644 --- a/src/zoneControllerAccessory.ts +++ b/src/zoneControllerAccessory.ts @@ -3,7 +3,7 @@ import { ClimateMode, CompressorMode } from './types'; import { ActronQuePlatform } from './platform'; import { HvacZone } from './hvacZone'; -// This class represents the master controller, a separate class is used for representing zones (or will be once i write it) +// This class represents the zone controller export class ZoneControllerAccessory { private hvacService: Service; // some versions of the zone sensor do not support humidity @@ -232,11 +232,12 @@ export class ZoneControllerAccessory { await this.platform.hvacInstance.setHeatTemp(value as number + 2); await this.platform.hvacInstance.getStatus(); } - } - if (value > this.zone.maxHeatSetPoint) { - value = this.zone.maxHeatSetPoint; - } else if (value < this.zone.minHeatSetPoint) { - value = this.zone.minHeatSetPoint; + } else { + if (value > this.zone.maxHeatSetPoint) { + value = this.zone.maxHeatSetPoint; + } else if (value < this.zone.minHeatSetPoint) { + value = this.zone.minHeatSetPoint; + } } await this.zone.setHeatTemp(value as number); this.platform.log.debug(`Set Zone ${this.zone.zoneName} Target Heating Temperature -> `, value); @@ -251,18 +252,24 @@ export class ZoneControllerAccessory { async setCoolingThresholdTemperature(value: CharacteristicValue) { this.checkHvacComms(); if (this.platform.hvacInstance.zonesPushMaster === true) { + this.platform.log.debug('zones push master is set to True'); if (value > this.zone.maxCoolSetPoint) { - await this.platform.hvacInstance.setCoolTemp(value as number + 2); + await this.platform.hvacInstance.setCoolTemp(value as number - 2); + this.platform.log.debug(`Value is greater than MAX cool set point of ${this.zone.maxCoolSetPoint}, SETTING MASTER TO -> `, value); await this.platform.hvacInstance.getStatus(); } else if (value < this.zone.minCoolSetPoint) { await this.platform.hvacInstance.setCoolTemp(value as number); + this.platform.log.debug(`Value is less than MIN cool set point of ${this.zone.minCoolSetPoint}, SETTING MASTER TO -> `, value); await this.platform.hvacInstance.getStatus(); } - } - if (value > this.zone.maxCoolSetPoint) { - value = this.zone.maxCoolSetPoint; - } else if (value < this.zone.minCoolSetPoint) { - value = this.zone.minCoolSetPoint; + } else { + if (value > this.zone.maxCoolSetPoint) { + value = this.zone.maxCoolSetPoint; + this.platform.log.debug(`Value is greater than max cool set point of ${this.zone.maxCoolSetPoint}, CHANGING TO -> `, value); + } else if (value < this.zone.minCoolSetPoint) { + value = this.zone.minCoolSetPoint; + this.platform.log.debug(`Value is less than MIN cool set point of ${this.zone.minCoolSetPoint}, CHANGING TO -> `, value); + } } await this.zone.setCoolTemp(value as number); this.platform.log.debug(`Set Zone ${this.zone.zoneName} Target Cooling Temperature -> `, value);