Skip to content

Commit 7847834

Browse files
authored
Merge pull request #11 from jxg81/10-zone-not-showing-fan-speed-not-showing
Update zone detection and "zones push master" logic
2 parents 576ea65 + ae2bc22 commit 7847834

5 files changed

Lines changed: 29 additions & 19 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ This is an 'almost' feature complete implementation of the Que platform in HomeK
2626
- Report battery level on zone sensors and get low battery alerts in the home app
2727
- Support for homebridge config UI
2828

29+
Fixes/Improvements in version 1.2.7
30+
- Allow master controller to also operate as a zone controller
31+
- Resolved issue with logic controlling "Zones Push Master" temp adjustments which was causing setting to fail on first attempt
32+
2933
Fixes/Improvements in version 1.2.4
3034
- Improved support for variations in API data returned for differing models of Que systems
3135
- Added option to override the default heating/cooling threshold temperatures via plugin configuration

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": false,
33
"displayName": "Homebridge Actron Que",
44
"name": "homebridge-actron-que",
5-
"version": "1.2.6",
5+
"version": "1.2.7",
66
"description": "Homebridge plugin for controlling Actron Que controller systems",
77
"license": "Apache-2.0",
88
"repository": {

src/masterControllerAccessory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Service, PlatformAccessory, CharacteristicValue, HAPStatus } from 'home
22
import { ClimateMode, CompressorMode, FanMode, PowerState } from './types';
33
import { ActronQuePlatform } from './platform';
44

5-
// This class represents the master controller, a separate class is used for representing zones (or will be once i write it)
5+
// This class represents the master controller, a separate class is used for representing zones
66
export class MasterControllerAccessory {
77
private hvacService: Service;
88
private humidityService: Service;

src/queApi.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,9 @@ export default class QueApi {
365365
loopIndex++;
366366
const sensorId = Object.keys(zone['Sensors'])[0];
367367

368-
// Skip the zone entries that aren't populated with a remote sensor, these seem to all have 'MASTER_CONTROLLER' as the
369-
// 'NV_Kind'. This works for my system, you may want to check the response data here if you have zone
370-
// detection issues on your system
371-
if (zone['Sensors'][sensorId]['NV_Kind'] === 'MASTER_CONTROLLER') {
368+
// 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
369+
// where the master controller is also the zone controller. Validated this logic should work across four different sample systems.
370+
if (!zone['NV_Exists']) {
372371
continue;
373372
}
374373

@@ -388,7 +387,7 @@ export default class QueApi {
388387
minCoolSetPoint: zone['MinCoolSetpoint'],
389388
currentHeatingSetTemp: zone['TemperatureSetpoint_Heat_oC'],
390389
currentCoolingSetTemp: zone['TemperatureSetpoint_Cool_oC'],
391-
zoneSensorBattery: zone['Sensors'][sensorId]['Battery_pc'],
390+
zoneSensorBattery: zone['Sensors'][sensorId]['Battery_pc'] === undefined ? 100 : zone['Sensors'][sensorId]['Battery_pc'],
392391
currentHumidity: zone['LiveHumidity_pc'] === undefined ? 'notSupported' : zone['LiveHumidity_pc'],
393392
};
394393
zoneCurrentStatus.push(zoneData);

src/zoneControllerAccessory.ts

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ClimateMode, CompressorMode } from './types';
33
import { ActronQuePlatform } from './platform';
44
import { HvacZone } from './hvacZone';
55

6-
// This class represents the master controller, a separate class is used for representing zones (or will be once i write it)
6+
// This class represents the zone controller
77
export class ZoneControllerAccessory {
88
private hvacService: Service;
99
// some versions of the zone sensor do not support humidity
@@ -232,11 +232,12 @@ export class ZoneControllerAccessory {
232232
await this.platform.hvacInstance.setHeatTemp(value as number + 2);
233233
await this.platform.hvacInstance.getStatus();
234234
}
235-
}
236-
if (value > this.zone.maxHeatSetPoint) {
237-
value = this.zone.maxHeatSetPoint;
238-
} else if (value < this.zone.minHeatSetPoint) {
239-
value = this.zone.minHeatSetPoint;
235+
} else {
236+
if (value > this.zone.maxHeatSetPoint) {
237+
value = this.zone.maxHeatSetPoint;
238+
} else if (value < this.zone.minHeatSetPoint) {
239+
value = this.zone.minHeatSetPoint;
240+
}
240241
}
241242
await this.zone.setHeatTemp(value as number);
242243
this.platform.log.debug(`Set Zone ${this.zone.zoneName} Target Heating Temperature -> `, value);
@@ -251,18 +252,24 @@ export class ZoneControllerAccessory {
251252
async setCoolingThresholdTemperature(value: CharacteristicValue) {
252253
this.checkHvacComms();
253254
if (this.platform.hvacInstance.zonesPushMaster === true) {
255+
this.platform.log.debug('zones push master is set to True');
254256
if (value > this.zone.maxCoolSetPoint) {
255-
await this.platform.hvacInstance.setCoolTemp(value as number + 2);
257+
await this.platform.hvacInstance.setCoolTemp(value as number - 2);
258+
this.platform.log.debug(`Value is greater than MAX cool set point of ${this.zone.maxCoolSetPoint}, SETTING MASTER TO -> `, value);
256259
await this.platform.hvacInstance.getStatus();
257260
} else if (value < this.zone.minCoolSetPoint) {
258261
await this.platform.hvacInstance.setCoolTemp(value as number);
262+
this.platform.log.debug(`Value is less than MIN cool set point of ${this.zone.minCoolSetPoint}, SETTING MASTER TO -> `, value);
259263
await this.platform.hvacInstance.getStatus();
260264
}
261-
}
262-
if (value > this.zone.maxCoolSetPoint) {
263-
value = this.zone.maxCoolSetPoint;
264-
} else if (value < this.zone.minCoolSetPoint) {
265-
value = this.zone.minCoolSetPoint;
265+
} else {
266+
if (value > this.zone.maxCoolSetPoint) {
267+
value = this.zone.maxCoolSetPoint;
268+
this.platform.log.debug(`Value is greater than max cool set point of ${this.zone.maxCoolSetPoint}, CHANGING TO -> `, value);
269+
} else if (value < this.zone.minCoolSetPoint) {
270+
value = this.zone.minCoolSetPoint;
271+
this.platform.log.debug(`Value is less than MIN cool set point of ${this.zone.minCoolSetPoint}, CHANGING TO -> `, value);
272+
}
266273
}
267274
await this.zone.setCoolTemp(value as number);
268275
this.platform.log.debug(`Set Zone ${this.zone.zoneName} Target Cooling Temperature -> `, value);

0 commit comments

Comments
 (0)