homebridge-melcloud-control 3.8.3-beta.8 → 3.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/deviceata.js +299 -276
- package/src/deviceatw.js +120 -135
- package/src/deviceerv.js +162 -174
- package/src/melcloudata.js +0 -1
- package/src/melcloudatw.js +0 -1
- package/src/melclouderv.js +0 -1
package/src/deviceatw.js
CHANGED
|
@@ -49,10 +49,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
49
49
|
this.mqtt = mqtt;
|
|
50
50
|
this.mqttConnected = false;
|
|
51
51
|
|
|
52
|
-
//variables
|
|
53
|
-
this.useFahrenheit = useFahrenheit ? 1 : 0;
|
|
54
|
-
this.temperatureUnit = TemperatureDisplayUnits[this.useFahrenheit];
|
|
55
|
-
|
|
56
52
|
//function
|
|
57
53
|
this.melCloud = melCloud; //function
|
|
58
54
|
|
|
@@ -98,7 +94,12 @@ class DeviceAtw extends EventEmitter {
|
|
|
98
94
|
this.deviceData = {};
|
|
99
95
|
|
|
100
96
|
//accessory
|
|
101
|
-
this.
|
|
97
|
+
this.accessory = {
|
|
98
|
+
zones: [{}, {}, {}, {}],
|
|
99
|
+
zonesSensors: [{}, {}, {}, {}]
|
|
100
|
+
};
|
|
101
|
+
this.accessory.useFahrenheit = useFahrenheit ? 1 : 0;
|
|
102
|
+
this.accessory.temperatureUnit = TemperatureDisplayUnits[this.accessory.useFahrenheit];
|
|
102
103
|
};
|
|
103
104
|
|
|
104
105
|
async externalIntegrations() {
|
|
@@ -287,20 +288,19 @@ class DeviceAtw extends EventEmitter {
|
|
|
287
288
|
//prepare accessory
|
|
288
289
|
async prepareAccessory(accountInfo, deviceData, deviceId, deviceTypeText, deviceName, accountName) {
|
|
289
290
|
try {
|
|
290
|
-
const
|
|
291
|
-
const
|
|
292
|
-
const
|
|
293
|
-
const
|
|
294
|
-
const
|
|
295
|
-
const
|
|
296
|
-
const
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
const
|
|
301
|
-
const
|
|
302
|
-
const
|
|
303
|
-
const caseZone2Sensor = mielHvac.caseZone2Sensor;
|
|
291
|
+
const presetsOnServer = this.accessory.presets;
|
|
292
|
+
const zonesCount = this.accessory.zonesCount;
|
|
293
|
+
const caseHeatPump = this.accessory.caseHeatPump;
|
|
294
|
+
const caseZone1 = this.accessory.caseZone1;
|
|
295
|
+
const caseHotWater = this.accessory.caseHotWater;
|
|
296
|
+
const caseZone2 = this.accessory.caseZone2;
|
|
297
|
+
const heatCoolModes = this.accessory.heatCoolModes;
|
|
298
|
+
|
|
299
|
+
const zonesSensorsCount = this.accessory.sensorsCount;
|
|
300
|
+
const caseHeatPumpSensor = this.accessory.caseHeatPumpSensor;
|
|
301
|
+
const caseZone1Sensor = this.accessory.caseZone1Sensor;
|
|
302
|
+
const caseHotWaterSensor = this.accessory.caseHotWaterSensor;
|
|
303
|
+
const caseZone2Sensor = this.accessory.caseZone2Sensor;
|
|
304
304
|
|
|
305
305
|
//accessory
|
|
306
306
|
const debug = this.enableDebugMode ? this.emit('debug', `Prepare accessory`) : false;
|
|
@@ -321,7 +321,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
321
321
|
//services
|
|
322
322
|
if (zonesCount > 0) {
|
|
323
323
|
this.melCloudServices = [];
|
|
324
|
-
|
|
324
|
+
this.accessory.zones.forEach((zone, i) => {
|
|
325
325
|
const zoneName = zone.name
|
|
326
326
|
const serviceName = `${deviceTypeText} ${accessoryName}: ${zoneName}`;
|
|
327
327
|
switch (this.displayMode) {
|
|
@@ -331,7 +331,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
331
331
|
melCloudService.setPrimaryService(true);
|
|
332
332
|
melCloudService.getCharacteristic(Characteristic.Active)
|
|
333
333
|
.onGet(async () => {
|
|
334
|
-
const state =
|
|
334
|
+
const state = this.accessory.power;
|
|
335
335
|
return state;
|
|
336
336
|
})
|
|
337
337
|
.onSet(async (state) => {
|
|
@@ -341,7 +341,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
341
341
|
deviceData.Device.Power = [false, true][state];
|
|
342
342
|
deviceData.Device.EffectiveFlags = HeatPump.EffectiveFlags.Power;
|
|
343
343
|
await this.melCloudAtw.send(deviceData);
|
|
344
|
-
const info = this.disableLogInfo ? false : this.emit('
|
|
344
|
+
const info = this.disableLogInfo ? false : this.emit('info', `${zoneName}, Set power: ${state ? 'ON' : 'OFF'}`);
|
|
345
345
|
break;
|
|
346
346
|
};
|
|
347
347
|
} catch (error) {
|
|
@@ -384,7 +384,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
384
384
|
deviceData.Device.EffectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
|
|
385
385
|
break;
|
|
386
386
|
};
|
|
387
|
-
operationModeText = [HeatPump.System[0], HeatPump.System[deviceData.Device.UnitStatus]][
|
|
387
|
+
operationModeText = [HeatPump.System[0], HeatPump.System[deviceData.Device.UnitStatus]][this.accessory.power];
|
|
388
388
|
break;
|
|
389
389
|
case caseZone1: //Zone 1 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
390
390
|
switch (value) {
|
|
@@ -440,7 +440,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
440
440
|
};
|
|
441
441
|
|
|
442
442
|
await this.melCloudAtw.send(deviceData);
|
|
443
|
-
const info = this.disableLogInfo ? false : this.emit('
|
|
443
|
+
const info = this.disableLogInfo ? false : this.emit('info', `${zoneName}, Set operation mode: ${operationModeText}`);
|
|
444
444
|
} catch (error) {
|
|
445
445
|
this.emit('warn', `${zoneName}, Set operation mode error: ${error}`);
|
|
446
446
|
};
|
|
@@ -461,7 +461,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
461
461
|
.setProps({
|
|
462
462
|
minValue: zone.temperaturesSetPropsMinValue,
|
|
463
463
|
maxValue: zone.temperaturesSetPropsMaxValue,
|
|
464
|
-
minStep:
|
|
464
|
+
minStep: this.accessory.temperatureIncrement
|
|
465
465
|
})
|
|
466
466
|
.onGet(async () => {
|
|
467
467
|
const value = zone.setTemperature;
|
|
@@ -513,7 +513,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
513
513
|
};
|
|
514
514
|
|
|
515
515
|
const set = i > 0 ? await this.melCloudAtw.send(deviceData) : false;
|
|
516
|
-
const info = this.disableLogInfo || i === 0 ? false : this.emit('
|
|
516
|
+
const info = this.disableLogInfo || i === 0 ? false : this.emit('info', `${zoneName}, Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
517
517
|
} catch (error) {
|
|
518
518
|
this.emit('warn', `${zoneName}, Set cooling threshold temperature error: ${error}`);
|
|
519
519
|
};
|
|
@@ -525,7 +525,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
525
525
|
.setProps({
|
|
526
526
|
minValue: zone.temperaturesSetPropsMinValue,
|
|
527
527
|
maxValue: zone.temperaturesSetPropsMaxValue,
|
|
528
|
-
minStep:
|
|
528
|
+
minStep: this.accessory.temperatureIncrement
|
|
529
529
|
})
|
|
530
530
|
.onGet(async () => {
|
|
531
531
|
const value = zone.setTemperature;
|
|
@@ -577,7 +577,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
577
577
|
};
|
|
578
578
|
|
|
579
579
|
const set = i > 0 ? await this.melCloudAtw.send(deviceData) : false;
|
|
580
|
-
const info = this.disableLogInfo || i === 0 ? false : this.emit('
|
|
580
|
+
const info = this.disableLogInfo || i === 0 ? false : this.emit('info', `${zoneName}, Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
581
581
|
} catch (error) {
|
|
582
582
|
this.emit('warn', `${zoneName}, Set heating threshold temperature error: ${error}`);
|
|
583
583
|
};
|
|
@@ -613,22 +613,22 @@ class DeviceAtw extends EventEmitter {
|
|
|
613
613
|
};
|
|
614
614
|
|
|
615
615
|
await this.melCloudAtw.send(deviceData);
|
|
616
|
-
const info = this.disableLogInfo ? false : this.emit('
|
|
616
|
+
const info = this.disableLogInfo ? false : this.emit('info', `${zoneName}, Set lock physical controls: ${value ? 'LOCK' : 'UNLOCK'}`);
|
|
617
617
|
} catch (error) {
|
|
618
618
|
this.emit('warn', `${zoneName}, Set lock physical controls error: ${error}`);
|
|
619
619
|
};
|
|
620
620
|
});
|
|
621
621
|
melCloudService.getCharacteristic(Characteristic.TemperatureDisplayUnits)
|
|
622
622
|
.onGet(async () => {
|
|
623
|
-
const value =
|
|
623
|
+
const value = this.accessory.useFahrenheit;
|
|
624
624
|
return value;
|
|
625
625
|
})
|
|
626
626
|
.onSet(async (value) => {
|
|
627
627
|
try {
|
|
628
628
|
accountInfo.UseFahrenheit = [false, true][value];
|
|
629
629
|
await this.melCloud.send(accountInfo);
|
|
630
|
-
|
|
631
|
-
const info = this.disableLogInfo ? false : this.emit('
|
|
630
|
+
this.accessory.useFahrenheit = value;
|
|
631
|
+
const info = this.disableLogInfo ? false : this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
|
|
632
632
|
} catch (error) {
|
|
633
633
|
this.emit('warn', `Set temperature display unit error: ${error}`);
|
|
634
634
|
};
|
|
@@ -680,7 +680,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
680
680
|
deviceData.Device.EffectiveFlags = HeatPump.EffectiveFlags.Power;
|
|
681
681
|
break;
|
|
682
682
|
};
|
|
683
|
-
operationModeText = [HeatPump.System[0], HeatPump.System[deviceData.Device.UnitStatus]][
|
|
683
|
+
operationModeText = [HeatPump.System[0], HeatPump.System[deviceData.Device.UnitStatus]][this.accessory.power];
|
|
684
684
|
break;
|
|
685
685
|
case caseZone1: //Zone 1 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
686
686
|
switch (value) {
|
|
@@ -748,7 +748,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
748
748
|
};
|
|
749
749
|
|
|
750
750
|
await this.melCloudAtw.send(deviceData);
|
|
751
|
-
const info = this.disableLogInfo ? false : this.emit('
|
|
751
|
+
const info = this.disableLogInfo ? false : this.emit('info', `${zoneName}, Set operation mode: ${operationModeText}`);
|
|
752
752
|
} catch (error) {
|
|
753
753
|
this.emit('warn', `${zoneName}, Set operation mode error: ${error}`);
|
|
754
754
|
};
|
|
@@ -767,7 +767,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
767
767
|
.setProps({
|
|
768
768
|
minValue: zone.temperaturesSetPropsMinValue,
|
|
769
769
|
maxValue: zone.temperaturesSetPropsMaxValue,
|
|
770
|
-
minStep:
|
|
770
|
+
minStep: this.accessory.temperatureIncrement
|
|
771
771
|
})
|
|
772
772
|
.onGet(async () => {
|
|
773
773
|
const value = zone.setTemperature;
|
|
@@ -795,22 +795,22 @@ class DeviceAtw extends EventEmitter {
|
|
|
795
795
|
};
|
|
796
796
|
|
|
797
797
|
const set = i > 0 ? await this.melCloudAtw.send(deviceData) : false;
|
|
798
|
-
const info = this.disableLogInfo || i === 0 ? false : this.emit('
|
|
798
|
+
const info = this.disableLogInfo || i === 0 ? false : this.emit('info', `${zoneName}, Set temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
799
799
|
} catch (error) {
|
|
800
800
|
this.emit('warn', `${zoneName}, Set temperature error: ${error}`);
|
|
801
801
|
};
|
|
802
802
|
});
|
|
803
803
|
melCloudServiceT.getCharacteristic(Characteristic.TemperatureDisplayUnits)
|
|
804
804
|
.onGet(async () => {
|
|
805
|
-
const value =
|
|
805
|
+
const value = this.accessory.useFahrenheit;
|
|
806
806
|
return value;
|
|
807
807
|
})
|
|
808
808
|
.onSet(async (value) => {
|
|
809
809
|
try {
|
|
810
810
|
accountInfo.UseFahrenheit = [false, true][value];
|
|
811
811
|
await this.melCloud.send(accountInfo);
|
|
812
|
-
|
|
813
|
-
const info = this.disableLogInfo ? false : this.emit('
|
|
812
|
+
this.accessory.useFahrenheit = value;
|
|
813
|
+
const info = this.disableLogInfo ? false : this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
|
|
814
814
|
} catch (error) {
|
|
815
815
|
this.emit('warn', `Set temperature display unit error: ${error}`);
|
|
816
816
|
};
|
|
@@ -824,7 +824,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
824
824
|
|
|
825
825
|
//sensor services
|
|
826
826
|
if (zonesSensorsCount > 0) {
|
|
827
|
-
|
|
827
|
+
this.accessory.zonesSensors.forEach((zone, i) => {
|
|
828
828
|
const zoneName = zone.name
|
|
829
829
|
const serviceName = `${deviceTypeText} ${accessoryName}: ${zoneName}`;
|
|
830
830
|
switch (i) {
|
|
@@ -1114,7 +1114,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1114
1114
|
};
|
|
1115
1115
|
|
|
1116
1116
|
await this.melCloudAtw.send(deviceData);
|
|
1117
|
-
const info = this.disableLogInfo ? false : this.emit('
|
|
1117
|
+
const info = this.disableLogInfo ? false : this.emit('info', `${state ? 'Set:' : 'Unset:'} ${name}`);
|
|
1118
1118
|
} catch (error) {
|
|
1119
1119
|
this.emit('warn', `Set preset error: ${error}`);
|
|
1120
1120
|
};
|
|
@@ -1277,12 +1277,12 @@ class DeviceAtw extends EventEmitter {
|
|
|
1277
1277
|
HeatPump.EffectiveFlags.ProhibitHeatingZone2;
|
|
1278
1278
|
break;
|
|
1279
1279
|
default:
|
|
1280
|
-
this.emit('
|
|
1280
|
+
this.emit('warn', `Unknown button mode: ${mode}`);
|
|
1281
1281
|
break;
|
|
1282
1282
|
};
|
|
1283
1283
|
|
|
1284
1284
|
await this.melCloudAtw.send(deviceData);
|
|
1285
|
-
const info = this.disableLogInfo ? false : this.emit('
|
|
1285
|
+
const info = this.disableLogInfo ? false : this.emit('info', `${state ? `Set: ${name}` : `Unset: ${name}, Set: ${button.previousValue}`}`);
|
|
1286
1286
|
} catch (error) {
|
|
1287
1287
|
this.emit('warn', `Set button error: ${error}`);
|
|
1288
1288
|
};
|
|
@@ -1417,33 +1417,27 @@ class DeviceAtw extends EventEmitter {
|
|
|
1417
1417
|
const returnTemperatureZone2 = deviceData.Device.ReturnTemperatureZone2;
|
|
1418
1418
|
|
|
1419
1419
|
//accessory
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
sensorsCount: zonesSensorsCount,
|
|
1442
|
-
useFahrenheit: this.useFahrenheit,
|
|
1443
|
-
temperatureUnit: this.useFahrenheit,
|
|
1444
|
-
zones: [{}, {}, {}, {}],
|
|
1445
|
-
zonesSensors: [{}, {}, {}, {}]
|
|
1446
|
-
};
|
|
1420
|
+
this.accessory.presets = presetsOnServer;
|
|
1421
|
+
this.accessory.power = power ? 1 : 0;
|
|
1422
|
+
this.accessory.unitStatus = unitStatus;
|
|
1423
|
+
this.accessory.idleZone1 = idleZone1;
|
|
1424
|
+
this.accessory.idleZone2 = idleZone2;
|
|
1425
|
+
this.accessory.temperatureIncrement = temperatureIncrement;
|
|
1426
|
+
this.accessory.hasHeatPump = hasHeatPump;
|
|
1427
|
+
this.accessory.hasZone1 = hasZone1;
|
|
1428
|
+
this.accessory.hasHotWaterTank = hasHotWaterTank;
|
|
1429
|
+
this.accessory.hasZone2 = hasZone2;
|
|
1430
|
+
this.accessory.heatCoolModes = heatCoolModes;
|
|
1431
|
+
this.accessory.caseHeatPump = caseHeatPump;
|
|
1432
|
+
this.accessory.caseZone1 = caseZone1;
|
|
1433
|
+
this.accessory.caseHotWater = caseHotWater;
|
|
1434
|
+
this.accessory.caseZone2 = caseZone2;
|
|
1435
|
+
this.accessory.zonesCount = zonesCount;
|
|
1436
|
+
this.accessory.caseHeatPumpSensor = caseHeatPumpSensor;
|
|
1437
|
+
this.accessory.caseZone1Sensor = caseZone1Sensor;
|
|
1438
|
+
this.accessory.caseHotWaterSensor = caseHotWaterSensor;
|
|
1439
|
+
this.accessory.caseZone2Sensor = caseZone2Sensor;
|
|
1440
|
+
this.accessory.sensorsCount = zonesSensorsCount;
|
|
1447
1441
|
|
|
1448
1442
|
//default values
|
|
1449
1443
|
let name = 'Heat Pump'
|
|
@@ -1461,7 +1455,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
1461
1455
|
let temperatureSetPropsMinValue = -35;
|
|
1462
1456
|
let temperatureSetPropsMaxValue = 100;
|
|
1463
1457
|
|
|
1464
|
-
//zones
|
|
1465
1458
|
for (let i = 0; i < zonesCount; i++) {
|
|
1466
1459
|
switch (this.displayMode) {
|
|
1467
1460
|
case 1: //Heater Cooler
|
|
@@ -1570,7 +1563,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1570
1563
|
.updateCharacteristic(Characteristic.TargetHeaterCoolerState, targetOperationMode)
|
|
1571
1564
|
.updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
|
|
1572
1565
|
.updateCharacteristic(Characteristic.LockPhysicalControls, lockPhysicalControl)
|
|
1573
|
-
.updateCharacteristic(Characteristic.TemperatureDisplayUnits,
|
|
1566
|
+
.updateCharacteristic(Characteristic.TemperatureDisplayUnits, this.accessory.useFahrenheit);
|
|
1574
1567
|
const updateDefCool = heatCoolModes === 0 || heatCoolModes === 2 ? this.melCloudServices[i].updateCharacteristic(Characteristic.CoolingThresholdTemperature, setTemperature) : false;
|
|
1575
1568
|
const updateDefHeat = heatCoolModes === 0 || heatCoolModes === 1 ? this.melCloudServices[i].updateCharacteristic(Characteristic.HeatingThresholdTemperature, setTemperature) : false;
|
|
1576
1569
|
}
|
|
@@ -1676,68 +1669,65 @@ class DeviceAtw extends EventEmitter {
|
|
|
1676
1669
|
.updateCharacteristic(Characteristic.TargetHeatingCoolingState, targetOperationMode)
|
|
1677
1670
|
.updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
|
|
1678
1671
|
.updateCharacteristic(Characteristic.TargetTemperature, setTemperature)
|
|
1679
|
-
.updateCharacteristic(Characteristic.TemperatureDisplayUnits,
|
|
1672
|
+
.updateCharacteristic(Characteristic.TemperatureDisplayUnits, this.accessory.useFahrenheit);
|
|
1680
1673
|
}
|
|
1681
1674
|
break;
|
|
1682
1675
|
};
|
|
1683
1676
|
|
|
1684
|
-
//add
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
operationModesSetPropsValidValues: operationModeSetPropsValidValues,
|
|
1698
|
-
};
|
|
1699
|
-
obj.zones[i] = objZ;
|
|
1677
|
+
//add value to zones arrays
|
|
1678
|
+
this.accessory.zones[i].name = name;
|
|
1679
|
+
this.accessory.zones[i].operationMode = operationModeZone;
|
|
1680
|
+
this.accessory.zones[i].currentOperationMode = currentOperationMode;
|
|
1681
|
+
this.accessory.zones[i].targetOperationMode = targetOperationMode;
|
|
1682
|
+
this.accessory.zones[i].roomTemperature = roomTemperature;
|
|
1683
|
+
this.accessory.zones[i].setTemperature = setTemperature;
|
|
1684
|
+
this.accessory.zones[i].lockPhysicalControl = lockPhysicalControl;
|
|
1685
|
+
this.accessory.zones[i].temperaturesSetPropsMinValue = temperatureSetPropsMinValue;
|
|
1686
|
+
this.accessory.zones[i].temperaturesSetPropsMaxValue = temperatureSetPropsMaxValue;
|
|
1687
|
+
const setPropsMinValue = this.startPrepareAccessory ? this.accessory.zones[i].operationModesSetPropsMinValue = operationModeSetPropsMinValue : false;
|
|
1688
|
+
const setPropsMaxValue = this.startPrepareAccessory ? this.accessory.zones[i].operationModesSetPropsMaxValue = operationModeSetPropsMaxValue : false;
|
|
1689
|
+
const setPropsValidValues = this.startPrepareAccessory ? this.accessory.zones[i].operationModesSetPropsValidValues = operationModeSetPropsValidValues : false;
|
|
1700
1690
|
|
|
1701
1691
|
//log current state
|
|
1702
1692
|
if (!this.disableLogInfo) {
|
|
1703
1693
|
let operationModeText = '';
|
|
1704
1694
|
switch (i) {
|
|
1705
1695
|
case caseHeatPump: //Heat Pump - HEAT, COOL, OFF
|
|
1706
|
-
this.emit('
|
|
1707
|
-
this.emit('
|
|
1708
|
-
this.emit('
|
|
1709
|
-
this.emit('
|
|
1710
|
-
this.emit('
|
|
1696
|
+
this.emit('info', `${heatPumpName}, Power: ${power ? 'ON' : 'OFF'}`)
|
|
1697
|
+
this.emit('info', `${heatPumpName}, Operation mode: ${HeatPump.System[unitStatus]}`);
|
|
1698
|
+
this.emit('info', `${heatPumpName},'Outdoor temperature: ${roomTemperature}${this.accessory.temperatureUnit}`);
|
|
1699
|
+
this.emit('info', `${heatPumpName}, Temperature display unit: ${this.accessory.temperatureUnit}`);
|
|
1700
|
+
this.emit('info', `${heatPumpName}, Lock physical controls: ${lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
|
|
1711
1701
|
break;
|
|
1712
1702
|
case caseZone1: //Zone 1 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
1713
1703
|
operationModeText = idleZone1 ? HeatPump.ZoneOperation[6] : HeatPump.ZoneOperation[operationModeZone1];
|
|
1714
|
-
this.emit('
|
|
1715
|
-
this.emit('
|
|
1716
|
-
this.emit('
|
|
1717
|
-
this.emit('
|
|
1718
|
-
this.emit('
|
|
1704
|
+
this.emit('info', `${zone1Name}, Operation mode: ${operationModeText}`);
|
|
1705
|
+
this.emit('info', `${zone1Name}, Temperature: ${roomTemperature}${this.accessory.temperatureUnit}`);
|
|
1706
|
+
this.emit('info', `${zone1Name}, Target temperature: ${setTemperature}${this.accessory.temperatureUnit}`)
|
|
1707
|
+
this.emit('info', `${zone1Name}, Temperature display unit: ${this.accessory.temperatureUnit}`);
|
|
1708
|
+
this.emit('info', `${zone1Name}, Lock physical controls: ${lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
|
|
1719
1709
|
break;
|
|
1720
1710
|
case caseHotWater: //Hot Water - AUTO, HEAT NOW
|
|
1721
1711
|
operationModeText = operationMode === 1 ? HeatPump.ForceDhw[1] : HeatPump.ForceDhw[forcedHotWaterMode ? 1 : 0];
|
|
1722
|
-
this.emit('
|
|
1723
|
-
this.emit('
|
|
1724
|
-
this.emit('
|
|
1725
|
-
this.emit('
|
|
1726
|
-
this.emit('
|
|
1712
|
+
this.emit('info', `${hotWaterName}, Operation mode: ${operationModeText}`);
|
|
1713
|
+
this.emit('info', `${hotWaterName}, Temperature: ${roomTemperature}${this.accessory.temperatureUnit}`);
|
|
1714
|
+
this.emit('info', `${hotWaterName}, Target temperature: ${setTemperature}${this.accessory.temperatureUnit}`)
|
|
1715
|
+
this.emit('info', `${hotWaterName}, Temperature display unit: ${this.accessory.temperatureUnit}`);
|
|
1716
|
+
this.emit('info', `${hotWaterName}, Lock physical controls: ${lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
|
|
1727
1717
|
break;
|
|
1728
1718
|
case caseZone2: //Zone 2 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
1729
1719
|
operationModeText = idleZone2 ? HeatPump.ZoneOperation[6] : HeatPump.ZoneOperation[operationModeZone2];
|
|
1730
|
-
this.emit('
|
|
1731
|
-
this.emit('
|
|
1732
|
-
this.emit('
|
|
1733
|
-
this.emit('
|
|
1734
|
-
this.emit('
|
|
1720
|
+
this.emit('info', `${zone2Name}, Operation mode: ${operationModeText}`);
|
|
1721
|
+
this.emit('info', `${zone2Name}, Temperature: ${roomTemperature}${this.accessory.temperatureUnit}`);
|
|
1722
|
+
this.emit('info', `${zone2Name}, Target temperature: ${setTemperature}${this.accessory.temperatureUnit}`)
|
|
1723
|
+
this.emit('info', `${zone2Name}, Temperature display unit: ${this.accessory.temperatureUnit}`);
|
|
1724
|
+
this.emit('info', `${zone2Name}, Lock physical controls: ${lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
|
|
1735
1725
|
break;
|
|
1736
1726
|
};
|
|
1737
1727
|
};
|
|
1738
1728
|
};
|
|
1739
1729
|
|
|
1740
|
-
//sensors
|
|
1730
|
+
//update sensors characteristics
|
|
1741
1731
|
for (let i = 0; i < zonesSensorsCount; i++) {
|
|
1742
1732
|
switch (i) {
|
|
1743
1733
|
case caseHeatPumpSensor: //Heat Pump
|
|
@@ -1830,45 +1820,39 @@ class DeviceAtw extends EventEmitter {
|
|
|
1830
1820
|
break;
|
|
1831
1821
|
};
|
|
1832
1822
|
|
|
1833
|
-
//add
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
returnTemperature: returnTemperature
|
|
1839
|
-
};
|
|
1840
|
-
obj.zonesSensors[i] = objS;
|
|
1823
|
+
//add value to sensors arrays
|
|
1824
|
+
this.accessory.zonesSensors[i].name = name;
|
|
1825
|
+
this.accessory.zonesSensors[i].roomTemperature = roomTemperature;
|
|
1826
|
+
this.accessory.zonesSensors[i].flowTemperature = flowTemperature;
|
|
1827
|
+
this.accessory.zonesSensors[i].returnTemperature = returnTemperature;
|
|
1841
1828
|
|
|
1842
1829
|
//log current state
|
|
1843
1830
|
if (!this.disableLogInfo) {
|
|
1844
1831
|
switch (i) {
|
|
1845
1832
|
case caseHeatPumpSensor: //Heat Pump - HEAT, COOL, OFF
|
|
1846
|
-
const info = outdoorTemperature !== null ? this.emit('
|
|
1847
|
-
const info0 = flowTemperatureHeatPump !== null ? this.emit('
|
|
1848
|
-
const info1 = returnTemperatureHeatPump !== null ? this.emit('
|
|
1833
|
+
const info = outdoorTemperature !== null ? this.emit('info', `${heatPumpName}, Outdoor temperature: ${outdoorTemperature}${this.accessory.temperatureUnit}`) : false;
|
|
1834
|
+
const info0 = flowTemperatureHeatPump !== null ? this.emit('info', `${heatPumpName}, Flow temperature: ${flowTemperatureHeatPump}${this.accessory.temperatureUnit}`) : false;
|
|
1835
|
+
const info1 = returnTemperatureHeatPump !== null ? this.emit('info', `${heatPumpName}, Return temperature: ${returnTemperatureHeatPump}${this.accessory.temperatureUnit}`) : false;
|
|
1849
1836
|
break;
|
|
1850
1837
|
case caseZone1Sensor: //Zone 1 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
1851
|
-
const info2 = roomTemperatureZone1 !== null ? this.emit('
|
|
1852
|
-
const info3 = flowTemperatureZone1 !== null ? this.emit('
|
|
1853
|
-
const info4 = returnTemperatureZone1 !== null ? this.emit('
|
|
1838
|
+
const info2 = roomTemperatureZone1 !== null ? this.emit('info', `${zone1Name}, Room temperature: ${roomTemperatureZone1}${this.accessory.temperatureUnit}`) : false;
|
|
1839
|
+
const info3 = flowTemperatureZone1 !== null ? this.emit('info', `${zone1Name}, Flow temperature: ${flowTemperatureZone1}${this.accessory.temperatureUnit}`) : false;
|
|
1840
|
+
const info4 = returnTemperatureZone1 !== null ? this.emit('info', `${zone1Name}, Return temperature: ${returnTemperatureZone1}${this.accessory.temperatureUnit}`) : false;
|
|
1854
1841
|
break;
|
|
1855
1842
|
case caseHotWaterSensor: //Hot Water - AUTO, HEAT NOW
|
|
1856
|
-
const info5 = tankWaterTemperature !== null ? this.emit('
|
|
1857
|
-
const info6 = flowTemperatureWaterTank !== null ? this.emit('
|
|
1858
|
-
const info7 = returnTemperatureWaterTank !== null ? this.emit('
|
|
1843
|
+
const info5 = tankWaterTemperature !== null ? this.emit('info', `${hotWaterName}, Temperature: ${tankWaterTemperature}${this.accessory.temperatureUnit}`) : false;
|
|
1844
|
+
const info6 = flowTemperatureWaterTank !== null ? this.emit('info', `${hotWaterName}, Flow temperature: ${flowTemperatureWaterTank}${this.accessory.temperatureUnit}`) : false;
|
|
1845
|
+
const info7 = returnTemperatureWaterTank !== null ? this.emit('info', `${hotWaterName}, Return temperature: ${returnTemperatureWaterTank}${this.accessory.temperatureUnit}`) : false;
|
|
1859
1846
|
break;
|
|
1860
1847
|
case caseZone2Sensor: //Zone 2 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
1861
|
-
const info8 = roomTemperatureZone2 !== null ? this.emit('
|
|
1862
|
-
const info9 = flowTemperatureZone2 !== null ? this.emit('
|
|
1863
|
-
const info10 = returnTemperatureZone2 !== null ? this.emit('
|
|
1848
|
+
const info8 = roomTemperatureZone2 !== null ? this.emit('info', `${zone2Name}, Room temperature: ${roomTemperatureZone2}${this.accessory.temperatureUnit}`) : false;
|
|
1849
|
+
const info9 = flowTemperatureZone2 !== null ? this.emit('info', `${zone2Name}, Flow temperature: ${flowTemperatureZone2}${this.accessory.temperatureUnit}`) : false;
|
|
1850
|
+
const info10 = returnTemperatureZone2 !== null ? this.emit('info', `${zone2Name}, Return temperature: ${returnTemperatureZone2}${this.accessory.temperatureUnit}`) : false;
|
|
1864
1851
|
break;
|
|
1865
1852
|
};
|
|
1866
1853
|
};
|
|
1867
1854
|
};
|
|
1868
1855
|
|
|
1869
|
-
//add obj to mielHvac
|
|
1870
|
-
this.mielHvac = obj;
|
|
1871
|
-
|
|
1872
1856
|
//update presets state
|
|
1873
1857
|
if (this.presetsConfigured.length > 0) {
|
|
1874
1858
|
this.presetsConfigured.forEach((preset, i) => {
|
|
@@ -1897,7 +1881,8 @@ class DeviceAtw extends EventEmitter {
|
|
|
1897
1881
|
|
|
1898
1882
|
//update buttons state
|
|
1899
1883
|
if (this.buttonsConfiguredCount > 0) {
|
|
1900
|
-
this.
|
|
1884
|
+
for (let i = 0; i < this.buttonsConfiguredCount; i++) {
|
|
1885
|
+
const button = this.buttonsConfigured[i];
|
|
1901
1886
|
const mode = button.mode;
|
|
1902
1887
|
switch (mode) {
|
|
1903
1888
|
case 0: //POWER ON,OFF
|
|
@@ -1980,7 +1965,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1980
1965
|
this.buttonsServices[i]
|
|
1981
1966
|
.updateCharacteristic(characteristicType, button.state)
|
|
1982
1967
|
};
|
|
1983
|
-
}
|
|
1968
|
+
};
|
|
1984
1969
|
};
|
|
1985
1970
|
|
|
1986
1971
|
//prepare accessory
|