Skip to content

Commit

Permalink
Merge pull request #11 from jxg81/10-zone-not-showing-fan-speed-not-s…
Browse files Browse the repository at this point in the history
…howing

Update zone detection and "zones push master" logic
  • Loading branch information
jxg81 committed Mar 21, 2023
2 parents 576ea65 + ae2bc22 commit 7847834
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 19 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/masterControllerAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 4 additions & 5 deletions src/queApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
Expand Down
31 changes: 19 additions & 12 deletions src/zoneControllerAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 7847834

Please sign in to comment.