homebridge-melcloud-control 3.3.12-beta.26 → 3.3.12-beta.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/package.json +1 -1
- package/src/constants.json +6 -0
- package/src/deviceata.js +132 -42
- package/src/deviceatw.js +112 -0
- package/src/deviceerv.js +74 -14
- package/src/melcloudata.js +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "3.3.12-beta.
|
|
4
|
+
"version": "3.3.12-beta.3",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
package/src/constants.json
CHANGED
package/src/deviceata.js
CHANGED
|
@@ -252,6 +252,7 @@ class DeviceAta extends EventEmitter {
|
|
|
252
252
|
const temperatureIncrement = deviceData.Device.TemperatureIncrement ?? 1;
|
|
253
253
|
const outdoorTemperature = deviceData.Device.OutdoorTemperature;
|
|
254
254
|
|
|
255
|
+
this.emit('message', `Target temp: ${TargetTemperature}`);
|
|
255
256
|
//accessory
|
|
256
257
|
this.accessory.presets = presetsOnServer;
|
|
257
258
|
this.accessory.hasAutomaticFanSpeed = hasAutomaticFanSpeed;
|
|
@@ -294,7 +295,7 @@ class DeviceAta extends EventEmitter {
|
|
|
294
295
|
this.accessory.targetOperationMode = 1; //AUTO, HEAT, COOL
|
|
295
296
|
break;
|
|
296
297
|
case 2: //DRY
|
|
297
|
-
this.accessory.currentOperationMode = 1;
|
|
298
|
+
this.accessory.currentOperationMode = roomTemperature < setTemperature ? 1 : 3;
|
|
298
299
|
this.accessory.targetOperationMode = this.autoDryFanMode === 2 ? 0 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : this.accessory.targetOperationMode;
|
|
299
300
|
break;
|
|
300
301
|
case 3: //COOL
|
|
@@ -306,7 +307,20 @@ class DeviceAta extends EventEmitter {
|
|
|
306
307
|
this.accessory.targetOperationMode = this.autoDryFanMode === 3 ? 0 : this.heatDryFanMode === 3 ? 1 : this.coolDryFanMode === 3 ? 2 : this.accessory.targetOperationMode;
|
|
307
308
|
break;
|
|
308
309
|
case 8: //AUTO
|
|
309
|
-
|
|
310
|
+
const curentModeInAuto = roomTemperature < defaultHeatingSetTemperature ? 'HEATING' : roomTemperature > defaultCoolingSetTemperature ? 'COOLING' : '';
|
|
311
|
+
switch (curentModeInAuto) {
|
|
312
|
+
case 'HEATING': //HEATING
|
|
313
|
+
const heatingToFan = roomTemperature > defaultHeatingSetTemperature + 1;
|
|
314
|
+
this.accessory.currentOperationMode = heatingToFan ? 1 : 2;
|
|
315
|
+
break;
|
|
316
|
+
case 'COOLING': //COOLING
|
|
317
|
+
const coolingToFan = roomTemperature < defaultCoolingSetTemperature - 1;
|
|
318
|
+
this.accessory.currentOperationMode = coolingToFan ? 1 : 3;
|
|
319
|
+
break;
|
|
320
|
+
default: //FAN
|
|
321
|
+
this.accessory.currentOperationMode = roomTemperature <= defaultHeatingSetTemperature ? 2 : roomTemperature >= defaultCoolingSetTemperature ? 3 : 1;
|
|
322
|
+
break;
|
|
323
|
+
};
|
|
310
324
|
this.accessory.targetOperationMode = 0;
|
|
311
325
|
break;
|
|
312
326
|
case 9: //ISEE HEAT
|
|
@@ -314,7 +328,7 @@ class DeviceAta extends EventEmitter {
|
|
|
314
328
|
this.accessory.targetOperationMode = 1;
|
|
315
329
|
break;
|
|
316
330
|
case 10: //ISEE DRY
|
|
317
|
-
this.accessory.currentOperationMode = 1;
|
|
331
|
+
this.accessory.currentOperationMode = roomTemperature < setTemperature ? 1 : 3;
|
|
318
332
|
this.accessory.targetOperationMode = this.autoDryFanMode === 2 ? 0 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : this.accessory.targetOperationMode;
|
|
319
333
|
break;
|
|
320
334
|
case 11: //ISEE COOL;
|
|
@@ -374,9 +388,9 @@ class DeviceAta extends EventEmitter {
|
|
|
374
388
|
.updateCharacteristic(Characteristic.TargetHeaterCoolerState, this.accessory.targetOperationMode)
|
|
375
389
|
.updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
|
|
376
390
|
.updateCharacteristic(Characteristic.LockPhysicalControls, this.accessory.lockPhysicalControl)
|
|
377
|
-
.updateCharacteristic(Characteristic.TemperatureDisplayUnits, this.accessory.useFahrenheit)
|
|
378
|
-
|
|
379
|
-
const
|
|
391
|
+
.updateCharacteristic(Characteristic.TemperatureDisplayUnits, this.accessory.useFahrenheit);
|
|
392
|
+
const updateDefHeat = modelSupportsHeat ? this.melCloudService.updateCharacteristic(Characteristic.HeatingThresholdTemperature, operationMode === 8 ? defaultHeatingSetTemperature : setTemperature) : false;
|
|
393
|
+
const updateDefCool = modelSupportsCool ? this.melCloudService.updateCharacteristic(Characteristic.CoolingThresholdTemperature, operationMode === 8 ? defaultCoolingSetTemperature : setTemperature) : false;
|
|
380
394
|
const updateRS = modelSupportsFanSpeed ? this.melCloudService.updateCharacteristic(Characteristic.RotationSpeed, this.accessory.fanSpeed) : false;
|
|
381
395
|
const updateSM = swingFunction ? this.melCloudService.updateCharacteristic(Characteristic.SwingMode, this.accessory.swingMode) : false;
|
|
382
396
|
};
|
|
@@ -388,35 +402,48 @@ class DeviceAta extends EventEmitter {
|
|
|
388
402
|
case true:
|
|
389
403
|
switch (operationMode) {
|
|
390
404
|
case 1: //HEAT
|
|
391
|
-
this.accessory.currentOperationMode =
|
|
405
|
+
this.accessory.currentOperationMode = 1; //OFF, HEATING, COOLING
|
|
392
406
|
this.accessory.targetOperationMode = 1; //OFF, HEAT, COOL, AUTO
|
|
393
407
|
break;
|
|
394
408
|
case 2: //DRY
|
|
395
|
-
this.accessory.currentOperationMode =
|
|
409
|
+
this.accessory.currentOperationMode = 2;
|
|
396
410
|
this.accessory.targetOperationMode = this.autoDryFanMode === 2 ? 3 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : this.accessory.targetOperationMode;
|
|
397
411
|
break;
|
|
398
412
|
case 3: //COOL
|
|
399
|
-
this.accessory.currentOperationMode =
|
|
413
|
+
this.accessory.currentOperationMode = 2;
|
|
400
414
|
this.accessory.targetOperationMode = 2;
|
|
401
415
|
break;
|
|
402
416
|
case 7: //FAN
|
|
403
|
-
this.accessory.currentOperationMode =
|
|
417
|
+
this.accessory.currentOperationMode = 2;
|
|
404
418
|
this.accessory.targetOperationMode = this.autoDryFanMode === 3 ? 3 : this.heatDryFanMode === 3 ? 1 : this.coolDryFanMode === 3 ? 2 : this.accessory.targetOperationMode;
|
|
405
419
|
break;
|
|
406
420
|
case 8: //AUTO
|
|
407
|
-
|
|
421
|
+
const curentModeInAuto = roomTemperature < defaultHeatingSetTemperature ? 'HEATING' : roomTemperature > defaultCoolingSetTemperature ? 'COOLING' : '';
|
|
422
|
+
switch (curentModeInAuto) {
|
|
423
|
+
case 'HEATING': //HEATING
|
|
424
|
+
const heatingToFan = roomTemperature > defaultHeatingSetTemperature + 1;
|
|
425
|
+
this.accessory.currentOperationMode = heatingToFan ? 0 : 1;
|
|
426
|
+
break;
|
|
427
|
+
case 'COOLING': //COOLING
|
|
428
|
+
const coolingToFan = roomTemperature < defaultCoolingSetTemperature - 1;
|
|
429
|
+
this.accessory.currentOperationMode = cooling ? 0 : 2;
|
|
430
|
+
break;
|
|
431
|
+
default: //FAN
|
|
432
|
+
this.accessory.currentOperationMode = roomTemperature <= defaultHeatingSetTemperature ? 1 : roomTemperature >= defaultCoolingSetTemperature ? 2 : 0;
|
|
433
|
+
break;
|
|
434
|
+
};
|
|
408
435
|
this.accessory.targetOperationMode = 3;
|
|
409
436
|
break;
|
|
410
437
|
case 9: //ISEE HEAT
|
|
411
|
-
this.accessory.currentOperationMode =
|
|
438
|
+
this.accessory.currentOperationMode = 1
|
|
412
439
|
this.accessory.targetOperationMode = 1;
|
|
413
440
|
break;
|
|
414
441
|
case 10: //ISEE DRY
|
|
415
|
-
this.accessory.currentOperationMode =
|
|
442
|
+
this.accessory.currentOperationMode = 2;
|
|
416
443
|
this.accessory.targetOperationMode = this.autoDryFanMode === 2 ? 3 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : this.accessory.targetOperationMode;
|
|
417
444
|
break;
|
|
418
445
|
case 11: //ISEE COOL;
|
|
419
|
-
this.accessory.currentOperationMode =
|
|
446
|
+
this.accessory.currentOperationMode = 2;
|
|
420
447
|
this.accessory.targetOperationMode = 2;
|
|
421
448
|
break;
|
|
422
449
|
default:
|
|
@@ -444,6 +471,8 @@ class DeviceAta extends EventEmitter {
|
|
|
444
471
|
.updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
|
|
445
472
|
.updateCharacteristic(Characteristic.TargetTemperature, setTemperature)
|
|
446
473
|
.updateCharacteristic(Characteristic.TemperatureDisplayUnits, this.accessory.useFahrenheit);
|
|
474
|
+
const updateDefHeat = modelSupportsAuto && modelSupportsHeat ? this.melCloudService.updateCharacteristic(Characteristic.HeatingThresholdTemperature, defaultHeatingSetTemperature) : false;
|
|
475
|
+
const updateDefCool = modelSupportsAuto && modelSupportsCool ? this.melCloudService.updateCharacteristic(Characteristic.CoolingThresholdTemperature, defaultCoolingSetTemperature) : false;
|
|
447
476
|
};
|
|
448
477
|
break;
|
|
449
478
|
};
|
|
@@ -610,14 +639,16 @@ class DeviceAta extends EventEmitter {
|
|
|
610
639
|
this.emit('message', `Power: ${power ? 'ON' : 'OFF'}`);
|
|
611
640
|
this.emit('message', `Target operation mode: ${CONSTANTS.AirConditioner.DriveMode[operationMode]}`);
|
|
612
641
|
this.emit('message', `Current operation mode: ${this.displayMode === 1 ? CONSTANTS.AirConditioner.CurrentOperationModeHeatherCooler[this.accessory.currentOperationMode] : CONSTANTS.AirConditioner.CurrentOperationModeThermostat[this.accessory.currentOperationMode]}`);
|
|
613
|
-
this.emit('message', `Target temperature: ${setTemperature}${this.accessory.temperatureUnit}`);
|
|
642
|
+
const info0 = operationMode !== 8 ? this.emit('message', `Target temperature: ${setTemperature}${this.accessory.temperatureUnit}`) : false;
|
|
614
643
|
this.emit('message', `Current temperature: ${roomTemperature}${this.accessory.temperatureUnit}`);
|
|
615
644
|
const info = hasOutdoorTemperature && deviceData.Device.OutdoorTemperature !== null ? this.emit('message', `Outdoor temperature: ${outdoorTemperature}${this.accessory.temperatureUnit}`) : false;
|
|
645
|
+
const info1 = operationMode === 8 && modelSupportsHeat ? this.emit('message', `Heating threshold temperature: ${defaultHeatingSetTemperature}${this.accessory.temperatureUnit}`) : false;
|
|
646
|
+
const info2 = operationMode === 8 && modelSupportsCool ? this.emit('message', `Cooling threshold temperature: ${defaultCoolingSetTemperature}${this.accessory.temperatureUnit}`) : false;
|
|
616
647
|
const info3 = modelSupportsFanSpeed ? this.emit('message', `Target fan speed: ${CONSTANTS.AirConditioner.FanSpeed[fanSpeed]}`) : false;
|
|
617
648
|
const info4 = modelSupportsFanSpeed ? this.emit('message', `Current fan speed: ${CONSTANTS.AirConditioner.FanSpeed[actualFanSpeed]}`) : false;
|
|
618
649
|
const info5 = vaneHorizontalDirection !== null ? this.emit('message', `Vane horizontal: ${CONSTANTS.AirConditioner.HorizontalVane[vaneHorizontalDirection]}`) : false;
|
|
619
650
|
const info6 = vaneVerticalDirection !== null ? this.emit('message', `Vane vertical: ${CONSTANTS.AirConditioner.VerticalVane[vaneVerticalDirection]}`) : false;
|
|
620
|
-
const info7 = swingFunction ? this.emit('message', `Air direction: ${CONSTANTS.AirConditioner.AirDirection[this.accessory.swingMode]}`) : false;
|
|
651
|
+
const info7 = swingFunction ? this.emit('message', `Air direction: ${CONSTANTS.AirConditioner.AirDirection[this.accessory.swingMode ? 7 : 0]}`) : false;
|
|
621
652
|
this.emit('message', `Temperature display unit: ${this.accessory.temperatureUnit}`);
|
|
622
653
|
this.emit('message', `Lock physical controls: ${this.accessory.lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
|
|
623
654
|
};
|
|
@@ -891,32 +922,41 @@ class DeviceAta extends EventEmitter {
|
|
|
891
922
|
deviceData.Device.VaneVertical = value ? 7 : 0;
|
|
892
923
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.VaneHorizontal + CONSTANTS.AirConditioner.EffectiveFlags.VaneVertical;
|
|
893
924
|
await this.melCloudAta.send(deviceData);
|
|
894
|
-
const info = this.disableLogInfo ? false : this.emit('message', `Set air direction mode: ${CONSTANTS.AirConditioner.AirDirection[value]}`);
|
|
925
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set air direction mode: ${CONSTANTS.AirConditioner.AirDirection[value ? 7 : 0]}`);
|
|
895
926
|
} catch (error) {
|
|
896
927
|
this.emit('warn', `Set vane swing mode error: ${error}`);
|
|
897
928
|
};
|
|
898
929
|
});
|
|
899
930
|
};
|
|
900
|
-
|
|
901
|
-
.
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
931
|
+
if (modelSupportsCool) {
|
|
932
|
+
this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
|
|
933
|
+
.setProps({
|
|
934
|
+
minValue: 16,
|
|
935
|
+
maxValue: 31,
|
|
936
|
+
minStep: this.accessory.temperatureIncrement
|
|
937
|
+
})
|
|
938
|
+
.onGet(async () => {
|
|
939
|
+
const value = this.accessory.operationMode === 8 ? this.accessory.defaultCoolingSetTemperature : this.accessory.setTemperature;
|
|
940
|
+
return value;
|
|
941
|
+
})
|
|
942
|
+
.onSet(async (value) => {
|
|
943
|
+
try {
|
|
944
|
+
switch (this.accessory.operationMode) {
|
|
945
|
+
case 8: //AUTO - AUTO
|
|
946
|
+
deviceData.Device.DefaultCoolingSetTemperature = value;
|
|
947
|
+
break;
|
|
948
|
+
default:
|
|
949
|
+
deviceData.Device.SetTemperature = value;
|
|
950
|
+
break
|
|
951
|
+
};
|
|
952
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
953
|
+
await this.melCloudAta.send(deviceData);
|
|
954
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
955
|
+
} catch (error) {
|
|
956
|
+
this.emit('warn', `Set cooling threshold temperature error: ${error}`);
|
|
957
|
+
};
|
|
958
|
+
});
|
|
959
|
+
};
|
|
920
960
|
if (modelSupportsHeat) {
|
|
921
961
|
this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
|
|
922
962
|
.setProps({
|
|
@@ -925,19 +965,23 @@ class DeviceAta extends EventEmitter {
|
|
|
925
965
|
minStep: this.accessory.temperatureIncrement
|
|
926
966
|
})
|
|
927
967
|
.onGet(async () => {
|
|
928
|
-
const value = this.accessory.
|
|
968
|
+
const value = this.accessory.operationMode === 8 ? this.accessory.defaultHeatingSetTemperature : this.accessory.setTemperature;
|
|
929
969
|
return value;
|
|
930
970
|
})
|
|
931
971
|
.onSet(async (value) => {
|
|
932
972
|
try {
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
973
|
+
switch (this.accessory.operationMode) {
|
|
974
|
+
case 8: //AUTO - AUTO
|
|
975
|
+
deviceData.Device.DefaultHeatingSetTemperature = value;
|
|
976
|
+
break;
|
|
977
|
+
default:
|
|
978
|
+
deviceData.Device.SetTemperature = value;
|
|
979
|
+
break
|
|
936
980
|
};
|
|
937
981
|
|
|
938
982
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
939
983
|
await this.melCloudAta.send(deviceData);
|
|
940
|
-
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
984
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
941
985
|
} catch (error) {
|
|
942
986
|
this.emit('warn', `Set heating threshold temperature error: ${error}`);
|
|
943
987
|
};
|
|
@@ -1052,6 +1096,52 @@ class DeviceAta extends EventEmitter {
|
|
|
1052
1096
|
this.emit('warn', `Set temperature error: ${error}`);
|
|
1053
1097
|
};
|
|
1054
1098
|
});
|
|
1099
|
+
if (modelSupportsAuto) {
|
|
1100
|
+
if (modelSupportsHeat) {
|
|
1101
|
+
this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
|
|
1102
|
+
.setProps({
|
|
1103
|
+
minValue: 10,
|
|
1104
|
+
maxValue: 31,
|
|
1105
|
+
minStep: this.accessory.temperatureIncrement
|
|
1106
|
+
})
|
|
1107
|
+
.onGet(async () => {
|
|
1108
|
+
const value = this.accessory.defaultHeatingSetTemperature;
|
|
1109
|
+
return value;
|
|
1110
|
+
})
|
|
1111
|
+
.onSet(async (value) => {
|
|
1112
|
+
try {
|
|
1113
|
+
deviceData.Device.DefaultHeatingSetTemperature = value;
|
|
1114
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
1115
|
+
await this.melCloudAta.send(deviceData);
|
|
1116
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
1117
|
+
} catch (error) {
|
|
1118
|
+
this.emit('warn', `Set heating threshold temperature error: ${error}`);
|
|
1119
|
+
};
|
|
1120
|
+
});
|
|
1121
|
+
};
|
|
1122
|
+
if (modelSupportsCool) {
|
|
1123
|
+
this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
|
|
1124
|
+
.setProps({
|
|
1125
|
+
minValue: 16,
|
|
1126
|
+
maxValue: 31,
|
|
1127
|
+
minStep: this.accessory.temperatureIncrement
|
|
1128
|
+
})
|
|
1129
|
+
.onGet(async () => {
|
|
1130
|
+
const value = this.accessory.defaultCoolingSetTemperature;
|
|
1131
|
+
return value;
|
|
1132
|
+
})
|
|
1133
|
+
.onSet(async (value) => {
|
|
1134
|
+
try {
|
|
1135
|
+
deviceData.Device.DefaultCoolingSetTemperature = value;
|
|
1136
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
1137
|
+
await this.melCloudAta.send(deviceData);
|
|
1138
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
1139
|
+
} catch (error) {
|
|
1140
|
+
this.emit('warn', `Set cooling threshold temperature error: ${error}`);
|
|
1141
|
+
};
|
|
1142
|
+
});
|
|
1143
|
+
};
|
|
1144
|
+
};
|
|
1055
1145
|
this.melCloudService.getCharacteristic(Characteristic.TemperatureDisplayUnits)
|
|
1056
1146
|
.onGet(async () => {
|
|
1057
1147
|
const value = this.accessory.useFahrenheit;
|
package/src/deviceatw.js
CHANGED
|
@@ -1428,6 +1428,118 @@ class DeviceAtw extends EventEmitter {
|
|
|
1428
1428
|
this.emit('warn', `${zoneName}, Set temperature error: ${error}`);
|
|
1429
1429
|
};
|
|
1430
1430
|
});
|
|
1431
|
+
//only for heat/cool, only cool and not for hot water tank
|
|
1432
|
+
if ((heatCoolModes === 0 || heatCoolModes === 2) && i !== caseHotWater) {
|
|
1433
|
+
melCloudServiceT.getCharacteristic(Characteristic.CoolingThresholdTemperature)
|
|
1434
|
+
.setProps({
|
|
1435
|
+
minValue: this.accessory.zones[i].temperaturesSetPropsMinValue,
|
|
1436
|
+
maxValue: this.accessory.zones[i].temperaturesSetPropsMaxValue,
|
|
1437
|
+
minStep: this.accessory.temperatureIncrement
|
|
1438
|
+
})
|
|
1439
|
+
.onGet(async () => {
|
|
1440
|
+
const value = this.accessory.zones[i].setTemperature;
|
|
1441
|
+
return value;
|
|
1442
|
+
})
|
|
1443
|
+
.onSet(async (value) => {
|
|
1444
|
+
try {
|
|
1445
|
+
switch (i) {
|
|
1446
|
+
case 0: //Heat Pump
|
|
1447
|
+
//deviceData.Device.SetTemperatureZone1 = value;
|
|
1448
|
+
//deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
|
|
1449
|
+
break;
|
|
1450
|
+
case 1: //Zone 1
|
|
1451
|
+
switch (this.accessory.operationModeZone1) {
|
|
1452
|
+
case 1: //HEAT FLOW
|
|
1453
|
+
deviceData.Device.SetHeatFlowTemperatureZone1 = value;
|
|
1454
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone1;
|
|
1455
|
+
break;
|
|
1456
|
+
case 4: //COOL FLOW
|
|
1457
|
+
deviceData.Device.SetCoolFlowTemperatureZone1 = value;
|
|
1458
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone1;
|
|
1459
|
+
break;
|
|
1460
|
+
};
|
|
1461
|
+
break;
|
|
1462
|
+
case caseHotWater: //Hot Water
|
|
1463
|
+
deviceData.Device.SetTankWaterTemperature = value;
|
|
1464
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTankWaterTemperature;
|
|
1465
|
+
break;
|
|
1466
|
+
case caseZone2: //Zone 2
|
|
1467
|
+
switch (this.accessory.operationModeZone2) {
|
|
1468
|
+
case 1: //HEAT FLOW
|
|
1469
|
+
deviceData.Device.SetHeatFlowTemperatureZone2 = value;
|
|
1470
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone2;
|
|
1471
|
+
break;
|
|
1472
|
+
case 4: //COOL FLOW
|
|
1473
|
+
deviceData.Device.SetCoolFlowTemperatureZone2 = value;
|
|
1474
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone2;
|
|
1475
|
+
break;
|
|
1476
|
+
};
|
|
1477
|
+
break;
|
|
1478
|
+
};
|
|
1479
|
+
|
|
1480
|
+
const set = i > 0 ? await this.melCloudAtw.send(deviceData) : false;
|
|
1481
|
+
const info = this.disableLogInfo || i === 0 ? false : this.emit('message', `${zoneName}, Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
1482
|
+
} catch (error) {
|
|
1483
|
+
this.emit('warn', `${zoneName}, Set cooling threshold temperature error: ${error}`);
|
|
1484
|
+
};
|
|
1485
|
+
});
|
|
1486
|
+
};
|
|
1487
|
+
//device can heat/cool or only heat
|
|
1488
|
+
if (heatCoolModes === 0 || heatCoolModes === 1) {
|
|
1489
|
+
melCloudServiceT.getCharacteristic(Characteristic.HeatingThresholdTemperature)
|
|
1490
|
+
.setProps({
|
|
1491
|
+
minValue: this.accessory.zones[i].temperaturesSetPropsMinValue,
|
|
1492
|
+
maxValue: this.accessory.zones[i].temperaturesSetPropsMaxValue,
|
|
1493
|
+
minStep: this.accessory.temperatureIncrement
|
|
1494
|
+
})
|
|
1495
|
+
.onGet(async () => {
|
|
1496
|
+
const value = this.accessory.zones[i].setTemperature;
|
|
1497
|
+
return value;
|
|
1498
|
+
})
|
|
1499
|
+
.onSet(async (value) => {
|
|
1500
|
+
try {
|
|
1501
|
+
switch (i) {
|
|
1502
|
+
case 0: //Heat Pump
|
|
1503
|
+
//deviceData.Device.SetTemperatureZone1 = value;
|
|
1504
|
+
//deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
|
|
1505
|
+
break;
|
|
1506
|
+
case 1: //Zone 1
|
|
1507
|
+
switch (this.accessory.operationModeZone1) {
|
|
1508
|
+
case 1: //HEAT FLOW
|
|
1509
|
+
deviceData.Device.SetHeatFlowTemperatureZone1 = value;
|
|
1510
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone1;
|
|
1511
|
+
break;
|
|
1512
|
+
case 4: //COOL FLOW
|
|
1513
|
+
deviceData.Device.SetCoolFlowTemperatureZone1 = value;
|
|
1514
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone1;
|
|
1515
|
+
break;
|
|
1516
|
+
};
|
|
1517
|
+
break;
|
|
1518
|
+
case caseHotWater: //Hot Water
|
|
1519
|
+
deviceData.Device.SetTankWaterTemperature = value;
|
|
1520
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTankWaterTemperature;
|
|
1521
|
+
break;
|
|
1522
|
+
case caseZone2: //Zone 2
|
|
1523
|
+
switch (this.accessory.operationModeZone2) {
|
|
1524
|
+
case 1: //HEAT FLOW
|
|
1525
|
+
deviceData.Device.SetHeatFlowTemperatureZone2 = value;
|
|
1526
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone2;
|
|
1527
|
+
break;
|
|
1528
|
+
case 4: //COOL FLOW
|
|
1529
|
+
deviceData.Device.SetCoolFlowTemperatureZone2 = value;
|
|
1530
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone2;
|
|
1531
|
+
break;
|
|
1532
|
+
};
|
|
1533
|
+
break;
|
|
1534
|
+
};
|
|
1535
|
+
|
|
1536
|
+
const set = i > 0 ? await this.melCloudAtw.send(deviceData) : false;
|
|
1537
|
+
const info = this.disableLogInfo || i === 0 ? false : this.emit('message', `${zoneName}, Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
1538
|
+
} catch (error) {
|
|
1539
|
+
this.emit('warn', `${zoneName}, Set heating threshold temperature error: ${error}`);
|
|
1540
|
+
};
|
|
1541
|
+
});
|
|
1542
|
+
};
|
|
1431
1543
|
melCloudServiceT.getCharacteristic(Characteristic.TemperatureDisplayUnits)
|
|
1432
1544
|
.onGet(async () => {
|
|
1433
1545
|
const value = this.accessory.useFahrenheit;
|
package/src/deviceerv.js
CHANGED
|
@@ -354,8 +354,8 @@ class DeviceErv extends EventEmitter {
|
|
|
354
354
|
.updateCharacteristic(Characteristic.RotationSpeed, this.accessory.fanSpeed)
|
|
355
355
|
.updateCharacteristic(Characteristic.LockPhysicalControls, this.accessory.lockPhysicalControl)
|
|
356
356
|
.updateCharacteristic(Characteristic.TemperatureDisplayUnits, this.accessory.useFahrenheit);
|
|
357
|
-
const
|
|
358
|
-
const
|
|
357
|
+
const updateDefHeat = hasHeatOperationMode ? this.melCloudService.updateCharacteristic(Characteristic.HeatingThresholdTemperature, ventilationMode === 2 ? defaultHeatingSetTemperature : setTemperature) : false;
|
|
358
|
+
const updateDefCool = hasCoolOperationMode ? this.melCloudService.updateCharacteristic(Characteristic.CoolingThresholdTemperature, ventilationMode === 2 ? defaultCoolingSetTemperature : setTemperature) : false;
|
|
359
359
|
};
|
|
360
360
|
break;
|
|
361
361
|
case 2: //Thermostat
|
|
@@ -407,6 +407,8 @@ class DeviceErv extends EventEmitter {
|
|
|
407
407
|
.updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
|
|
408
408
|
.updateCharacteristic(Characteristic.TargetTemperature, targetTemperature)
|
|
409
409
|
.updateCharacteristic(Characteristic.TemperatureDisplayUnits, this.accessory.useFahrenheit);
|
|
410
|
+
const updateDefHeat = hasAutoVentilationMode && hasHeatOperationMode ? this.melCloudService.updateCharacteristic(Characteristic.HeatingThresholdTemperature, defaultHeatingSetTemperature) : false;
|
|
411
|
+
const updateDefCool = hasAutoVentilationMode && hasCoolOperationMode ? this.melCloudService.updateCharacteristic(Characteristic.CoolingThresholdTemperature, defaultCoolingSetTemperature) : false;
|
|
410
412
|
};
|
|
411
413
|
break;
|
|
412
414
|
};
|
|
@@ -540,10 +542,12 @@ class DeviceErv extends EventEmitter {
|
|
|
540
542
|
this.emit('message', `Power: ${power ? 'ON' : 'OFF'}`);
|
|
541
543
|
this.emit('message', `Target ventilation mode: ${CONSTANTS.Ventilation.OperationMode[ventilationMode]}`);
|
|
542
544
|
this.emit('message', `Current entilation mode: ${CONSTANTS.Ventilation.OperationMode[actualVentilationMode]}`);
|
|
543
|
-
this.emit('message', `Target temperature: ${targetTemperature}${this.accessory.temperatureUnit}`);
|
|
544
545
|
this.emit('message', `Room temperature: ${roomTemperature}${this.accessory.temperatureUnit}`);
|
|
546
|
+
const info = hasCoolOperationMode || hasHeatOperationMode ? this.emit('message', `Target temperature: ${targetTemperature}${this.accessory.temperatureUnit}`) : false;
|
|
545
547
|
const info1 = hasSupplyTemperature && deviceData.Device.SupplyTemperature !== null ? this.emit('message', `Supply temperature: ${roomTemperature}${this.accessory.temperatureUnit}`) : false;
|
|
546
548
|
const info2 = hasOutdoorTemperature && deviceData.Device.OutdoorTemperature !== null ? this.emit('message', `Outdoor temperature: ${roomTemperature}${this.accessory.temperatureUnit}`) : false;
|
|
549
|
+
const info3 = ventilationMode === 2 && hasHeatOperationMode ? this.emit('message', `Heating threshold temperature: ${defaultHeatingSetTemperature}${this.accessory.temperatureUnit}`) : false;
|
|
550
|
+
const info4 = ventilationMode === 2 && hasCoolOperationMode ? this.emit('message', `Cooling threshold temperature: ${defaultCoolingSetTemperature}${this.accessory.temperatureUnit}`) : false;
|
|
547
551
|
this.emit('message', `Fan speed mode: ${CONSTANTS.Ventilation.FanSpeed[setFanSpeed]}`);
|
|
548
552
|
this.emit('message', `Temperature display unit: ${this.accessory.temperatureUnit}`);
|
|
549
553
|
this.emit('message', `Core maintenance: ${CONSTANTS.Ventilation.CoreMaintenance[coreMaintenanceRequired]}`);
|
|
@@ -798,15 +802,22 @@ class DeviceErv extends EventEmitter {
|
|
|
798
802
|
minStep: this.accessory.temperatureIncrement
|
|
799
803
|
})
|
|
800
804
|
.onGet(async () => {
|
|
801
|
-
const value = this.
|
|
805
|
+
const value = this.accessorydefaultCoolingSetTemperature;
|
|
802
806
|
return value;
|
|
803
807
|
})
|
|
804
808
|
.onSet(async (value) => {
|
|
805
809
|
try {
|
|
806
|
-
|
|
807
|
-
|
|
810
|
+
switch (this.accessory.ventilationMode) {
|
|
811
|
+
case 2: //AUTO - AUTO
|
|
812
|
+
deviceData.Device.DefaultCoolingSetTemperature = value;
|
|
813
|
+
break;
|
|
814
|
+
default:
|
|
815
|
+
deviceData.Device.SetTemperature = value;
|
|
816
|
+
break
|
|
817
|
+
};
|
|
818
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
|
|
808
819
|
await this.melCloudErv.send(deviceData);
|
|
809
|
-
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
820
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
810
821
|
} catch (error) {
|
|
811
822
|
this.emit('warn', `Set cooling threshold temperature error: ${error}`);
|
|
812
823
|
};
|
|
@@ -821,19 +832,22 @@ class DeviceErv extends EventEmitter {
|
|
|
821
832
|
minStep: this.accessory.temperatureIncrement
|
|
822
833
|
})
|
|
823
834
|
.onGet(async () => {
|
|
824
|
-
const value = this.accessory.
|
|
835
|
+
const value = this.accessory.defaultHeatingSetTemperature;
|
|
825
836
|
return value;
|
|
826
837
|
})
|
|
827
838
|
.onSet(async (value) => {
|
|
828
839
|
try {
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
840
|
+
switch (this.accessory.ventilationMode) {
|
|
841
|
+
case 2: //AUTO - AUTO
|
|
842
|
+
deviceData.Device.DefaultHeatingSetTemperature = value;
|
|
843
|
+
break;
|
|
844
|
+
default:
|
|
845
|
+
deviceData.Device.SetTemperature = value;
|
|
846
|
+
break
|
|
832
847
|
};
|
|
833
|
-
|
|
834
|
-
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
848
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
|
|
835
849
|
await this.melCloudErv.send(deviceData);
|
|
836
|
-
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
850
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
837
851
|
} catch (error) {
|
|
838
852
|
this.emit('warn', `Set heating threshold temperature error: ${error}`);
|
|
839
853
|
};
|
|
@@ -947,6 +961,52 @@ class DeviceErv extends EventEmitter {
|
|
|
947
961
|
this.emit('warn', `Set temperature error: ${error}`);
|
|
948
962
|
};
|
|
949
963
|
});
|
|
964
|
+
if (hasAutoVentilationMode) {
|
|
965
|
+
if (hasHeatOperationMode) {
|
|
966
|
+
this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
|
|
967
|
+
.setProps({
|
|
968
|
+
minValue: 10,
|
|
969
|
+
maxValue: 31,
|
|
970
|
+
minStep: this.accessory.temperatureIncrement
|
|
971
|
+
})
|
|
972
|
+
.onGet(async () => {
|
|
973
|
+
const value = this.accessory.defaultHeatingSetTemperature;
|
|
974
|
+
return value;
|
|
975
|
+
})
|
|
976
|
+
.onSet(async (value) => {
|
|
977
|
+
try {
|
|
978
|
+
deviceData.Device.DefaultHeatingSetTemperature = value;
|
|
979
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
|
|
980
|
+
await this.melCloudErv.send(deviceData);
|
|
981
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
982
|
+
} catch (error) {
|
|
983
|
+
this.emit('warn', `Set heating threshold temperature error: ${error}`);
|
|
984
|
+
};
|
|
985
|
+
});
|
|
986
|
+
};
|
|
987
|
+
if (hasCoolOperationMode) {
|
|
988
|
+
this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
|
|
989
|
+
.setProps({
|
|
990
|
+
minValue: 16,
|
|
991
|
+
maxValue: 31,
|
|
992
|
+
minStep: this.accessory.temperatureIncrement
|
|
993
|
+
})
|
|
994
|
+
.onGet(async () => {
|
|
995
|
+
const value = this.accessory.defaultCoolingSetTemperature;
|
|
996
|
+
return value;
|
|
997
|
+
})
|
|
998
|
+
.onSet(async (value) => {
|
|
999
|
+
try {
|
|
1000
|
+
deviceData.Device.DefaultCoolingSetTemperature = value;
|
|
1001
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
|
|
1002
|
+
await this.melCloudErv.send(deviceData);
|
|
1003
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
1004
|
+
} catch (error) {
|
|
1005
|
+
this.emit('warn', `Set cooling threshold temperature error: ${error}`);
|
|
1006
|
+
};
|
|
1007
|
+
});
|
|
1008
|
+
};
|
|
1009
|
+
};
|
|
950
1010
|
this.melCloudService.getCharacteristic(Characteristic.TemperatureDisplayUnits)
|
|
951
1011
|
.onGet(async () => {
|
|
952
1012
|
const value = this.accessory.useFahrenheit;
|
package/src/melcloudata.js
CHANGED
|
@@ -414,8 +414,8 @@ class MelCloudAta extends EventEmitter {
|
|
|
414
414
|
OperationMode: deviceData.Device.OperationMode,
|
|
415
415
|
VaneHorizontal: deviceData.Device.VaneHorizontalDirection,
|
|
416
416
|
VaneVertical: deviceData.Device.VaneVerticalDirection,
|
|
417
|
-
DefaultHeatingSetTemperature: deviceData.Device.DefaultHeatingSetTemperature
|
|
418
|
-
DefaultCoolingSetTemperature: deviceData.Device.DefaultCoolingSetTemperature
|
|
417
|
+
DefaultHeatingSetTemperature: deviceData.Device.DefaultHeatingSetTemperature,
|
|
418
|
+
DefaultCoolingSetTemperature: deviceData.Device.DefaultCoolingSetTemperature,
|
|
419
419
|
InStandbyMode: deviceData.Device.InStandbyMode,
|
|
420
420
|
ProhibitSetTemperature: deviceData.Device.ProhibitSetTemperature,
|
|
421
421
|
ProhibitOperationMode: deviceData.Device.ProhibitOperationMode,
|