homebridge-melcloud-control 3.3.9 → 3.3.10
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 +10 -10
- package/src/deviceatw.js +205 -115
- package/src/melcloudata.js +1 -1
- package/src/melcloudatw.js +1 -1
- package/src/melclouderv.js +1 -1
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.
|
|
4
|
+
"version": "3.3.10",
|
|
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
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
],
|
|
35
35
|
"DriveMode": [
|
|
36
36
|
"0",
|
|
37
|
-
"
|
|
37
|
+
"HEAT",
|
|
38
38
|
"DRY",
|
|
39
|
-
"
|
|
39
|
+
"COOL",
|
|
40
40
|
"4",
|
|
41
41
|
"5",
|
|
42
42
|
"6",
|
|
43
43
|
"FAN",
|
|
44
44
|
"AUTO",
|
|
45
|
-
"ISEE
|
|
45
|
+
"ISEE HEAT",
|
|
46
46
|
"ISEE DRY",
|
|
47
|
-
"ISEE
|
|
47
|
+
"ISEE COOL"
|
|
48
48
|
],
|
|
49
49
|
"VerticalVane": [
|
|
50
50
|
"AUTO",
|
|
@@ -128,8 +128,8 @@
|
|
|
128
128
|
"Zone 2"
|
|
129
129
|
],
|
|
130
130
|
"ControlType": [
|
|
131
|
-
"
|
|
132
|
-
"
|
|
131
|
+
"HEAT",
|
|
132
|
+
"COOL"
|
|
133
133
|
],
|
|
134
134
|
"Defrost": [
|
|
135
135
|
"NORMAL",
|
|
@@ -140,16 +140,16 @@
|
|
|
140
140
|
"OperationMode": [
|
|
141
141
|
"IDLE",
|
|
142
142
|
"HOT WATER",
|
|
143
|
-
"
|
|
144
|
-
"
|
|
143
|
+
"HEAT ZONES",
|
|
144
|
+
"COOL",
|
|
145
145
|
"HOT WATER STORAGE",
|
|
146
146
|
"FREEZE STAT",
|
|
147
147
|
"LEGIONELLA",
|
|
148
|
-
"
|
|
148
|
+
"HEAT ECO",
|
|
149
149
|
"MODE 1",
|
|
150
150
|
"MODE 2",
|
|
151
151
|
"MODE 3",
|
|
152
|
-
"
|
|
152
|
+
"HEAT UP"
|
|
153
153
|
],
|
|
154
154
|
"OperationModeDhw": [
|
|
155
155
|
"NORMAL",
|
package/src/deviceatw.js
CHANGED
|
@@ -246,14 +246,8 @@ class DeviceAtw extends EventEmitter {
|
|
|
246
246
|
const caseHotWater = hasHotWaterTank ? 2 : -1;
|
|
247
247
|
const caseZone2 = hasZone2 ? hasHotWaterTank ? 3 : 2 : -1;
|
|
248
248
|
|
|
249
|
-
this.zonesCount = zonesCount;
|
|
250
|
-
this.heatCoolModes = heatCoolModes;
|
|
251
|
-
this.caseHotWater = caseHotWater;
|
|
252
|
-
this.caseZone2 = caseZone2;
|
|
253
|
-
|
|
254
249
|
//device state
|
|
255
250
|
const power = deviceData.Device.Power ?? false;
|
|
256
|
-
const offline = deviceData.Device.Offline ?? false;
|
|
257
251
|
const setTemperatureZone1 = deviceData.Device.SetTemperatureZone1;
|
|
258
252
|
const setTemperatureZone2 = deviceData.Device.SetTemperatureZone2;
|
|
259
253
|
const roomTemperatureZone1 = deviceData.Device.RoomTemperatureZone1;
|
|
@@ -279,15 +273,21 @@ class DeviceAtw extends EventEmitter {
|
|
|
279
273
|
const idleZone2 = deviceData.Device.IdleZone2 ?? false;
|
|
280
274
|
|
|
281
275
|
//accessory
|
|
282
|
-
this.accessory.presetsOnServer = presetsOnServer;
|
|
283
276
|
this.accessory.power = power ? 1 : 0;
|
|
284
|
-
this.accessory.
|
|
277
|
+
this.accessory.operationMode = operationMode;
|
|
278
|
+
this.accessory.operationModeZone1 = operationModeZone1;
|
|
279
|
+
this.accessory.roomTemperatureZone2 = roomTemperatureZone2;
|
|
285
280
|
this.accessory.unitStatus = unitStatus;
|
|
286
281
|
this.accessory.idleZone1 = idleZone1;
|
|
287
282
|
this.accessory.idleZone2 = idleZone2;
|
|
288
283
|
this.accessory.temperatureIncrement = temperatureIncrement;
|
|
289
284
|
this.accessory.hasHotWaterTank = hasHotWaterTank;
|
|
290
285
|
this.accessory.hasZone2 = hasZone2;
|
|
286
|
+
this.accessory.zonesCount = zonesCount;
|
|
287
|
+
this.accessory.heatCoolModes = heatCoolModes;
|
|
288
|
+
this.accessory.caseHotWater = caseHotWater;
|
|
289
|
+
this.accessory.caseZone2 = caseZone2;
|
|
290
|
+
this.accessory.presetsOnServer = presetsOnServer;
|
|
291
291
|
|
|
292
292
|
//default values
|
|
293
293
|
let name = 'Heat Pump'
|
|
@@ -920,6 +920,21 @@ class DeviceAtw extends EventEmitter {
|
|
|
920
920
|
//prepare accessory
|
|
921
921
|
async prepareAccessory(accountInfo, deviceData, deviceId, deviceTypeText, deviceName, accountName) {
|
|
922
922
|
try {
|
|
923
|
+
const zonesCount = this.accessory.zonesCount;
|
|
924
|
+
const caseHotWater = this.accessory.caseHotWater;
|
|
925
|
+
const caseZone2 = this.accessory.caseZone2;
|
|
926
|
+
const heatCoolModes = this.accessory.heatCoolModes;
|
|
927
|
+
const presetsOnServer = this.accessory.presetsOnServer;
|
|
928
|
+
const temperatureSensor = this.temperatureSensor;
|
|
929
|
+
const temperatureSensorFlow = this.temperatureSensorFlow;
|
|
930
|
+
const temperatureSensorReturn = this.temperatureSensorReturn;
|
|
931
|
+
const temperatureSensorFlowZone1 = this.temperatureSensorFlowZone1;
|
|
932
|
+
const temperatureSensorReturnZone1 = this.temperatureSensorReturnZone1;
|
|
933
|
+
const temperatureSensorFlowWaterTank = this.temperatureSensorFlowWaterTank;
|
|
934
|
+
const temperatureSensorReturnWaterTank = this.temperatureSensorReturnWaterTank;
|
|
935
|
+
const temperatureSensorFlowZone2 = this.temperatureSensorFlowZone2;
|
|
936
|
+
const temperatureSensorReturnZone2 = this.temperatureSensorReturnZone2;
|
|
937
|
+
|
|
923
938
|
//accessory
|
|
924
939
|
const debug = this.enableDebugMode ? this.emit('debug', `Prepare accessory`) : false;
|
|
925
940
|
const accessoryName = deviceName;
|
|
@@ -935,22 +950,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
935
950
|
.setCharacteristic(Characteristic.SerialNumber, this.serialNumber)
|
|
936
951
|
.setCharacteristic(Characteristic.FirmwareRevision, this.firmwareRevision);
|
|
937
952
|
|
|
938
|
-
//
|
|
939
|
-
const zonesCount = this.zonesCount;
|
|
940
|
-
const caseHotWater = this.caseHotWater;
|
|
941
|
-
const caseZone2 = this.caseZone2;
|
|
942
|
-
const heatCoolModes = this.heatCoolModes;
|
|
943
|
-
const presetsOnServer = this.accessory.presetsOnServer;
|
|
944
|
-
const temperatureSensor = this.temperatureSensor;
|
|
945
|
-
const temperatureSensorFlow = this.temperatureSensorFlow;
|
|
946
|
-
const temperatureSensorReturn = this.temperatureSensorReturn;
|
|
947
|
-
const temperatureSensorFlowZone1 = this.temperatureSensorFlowZone1;
|
|
948
|
-
const temperatureSensorReturnZone1 = this.temperatureSensorReturnZone1;
|
|
949
|
-
const temperatureSensorFlowWaterTank = this.temperatureSensorFlowWaterTank;
|
|
950
|
-
const temperatureSensorReturnWaterTank = this.temperatureSensorReturnWaterTank;
|
|
951
|
-
const temperatureSensorFlowZone2 = this.temperatureSensorFlowZone2;
|
|
952
|
-
const temperatureSensorReturnZone2 = this.temperatureSensorReturnZone2;
|
|
953
|
-
|
|
953
|
+
//services
|
|
954
954
|
this.melCloudServices = [];
|
|
955
955
|
for (let i = 0; i < zonesCount; i++) {
|
|
956
956
|
const zoneName = this.accessory.zones[i].name
|
|
@@ -961,7 +961,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
961
961
|
const melCloudService = new Service.HeaterCooler(serviceName, `HeaterCooler ${deviceId} ${i}`);
|
|
962
962
|
melCloudService.getCharacteristic(Characteristic.Active)
|
|
963
963
|
.onGet(async () => {
|
|
964
|
-
const state =
|
|
964
|
+
const state = this.accessory.power;
|
|
965
965
|
return state;
|
|
966
966
|
})
|
|
967
967
|
.onSet(async (state) => {
|
|
@@ -1105,7 +1105,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1105
1105
|
//deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
|
|
1106
1106
|
break;
|
|
1107
1107
|
case 1: //Zone 1
|
|
1108
|
-
switch (
|
|
1108
|
+
switch (this.accessory.operationModeZone1) {
|
|
1109
1109
|
case 1: //HEAT FLOW
|
|
1110
1110
|
deviceData.Device.SetHeatFlowTemperatureZone1 = value;
|
|
1111
1111
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone1;
|
|
@@ -1125,7 +1125,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1125
1125
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTankWaterTemperature;
|
|
1126
1126
|
break;
|
|
1127
1127
|
case caseZone2: //Zone 2
|
|
1128
|
-
switch (
|
|
1128
|
+
switch (this.accessory.operationModeZone2) {
|
|
1129
1129
|
case 1: //HEAT FLOW
|
|
1130
1130
|
deviceData.Device.SetHeatFlowTemperatureZone2 = value;
|
|
1131
1131
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone2;
|
|
@@ -1150,67 +1150,69 @@ class DeviceAtw extends EventEmitter {
|
|
|
1150
1150
|
});
|
|
1151
1151
|
};
|
|
1152
1152
|
//device can heat/cool or only heat
|
|
1153
|
-
|
|
1154
|
-
.
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
//
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1153
|
+
if (heatCoolModes === 0 || heatCoolModes === 1) {
|
|
1154
|
+
melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
|
|
1155
|
+
.setProps({
|
|
1156
|
+
minValue: this.accessory.zones[i].temperaturesSetPropsMinValue,
|
|
1157
|
+
maxValue: this.accessory.zones[i].temperaturesSetPropsMaxValue,
|
|
1158
|
+
minStep: this.accessory.temperatureIncrement
|
|
1159
|
+
})
|
|
1160
|
+
.onGet(async () => {
|
|
1161
|
+
const value = this.accessory.zones[i].setTemperature;
|
|
1162
|
+
return value;
|
|
1163
|
+
})
|
|
1164
|
+
.onSet(async (value) => {
|
|
1165
|
+
try {
|
|
1166
|
+
switch (i) {
|
|
1167
|
+
case 0: //Heat Pump
|
|
1168
|
+
//deviceData.Device.SetTemperatureZone1 = value;
|
|
1169
|
+
//deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
|
|
1170
|
+
break;
|
|
1171
|
+
case 1: //Zone 1
|
|
1172
|
+
switch (this.accessory.operationModeZone1) {
|
|
1173
|
+
case 1: //HEAT FLOW
|
|
1174
|
+
deviceData.Device.SetHeatFlowTemperatureZone1 = value;
|
|
1175
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone1;
|
|
1176
|
+
break;
|
|
1177
|
+
case 4: //COOL FLOW
|
|
1178
|
+
deviceData.Device.SetCoolFlowTemperatureZone1 = value;
|
|
1179
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone1;
|
|
1180
|
+
break;
|
|
1181
|
+
default:
|
|
1182
|
+
deviceData.Device.SetTemperatureZone1 = value;
|
|
1183
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
|
|
1184
|
+
break
|
|
1185
|
+
};
|
|
1186
|
+
break;
|
|
1187
|
+
case caseHotWater: //Hot Water
|
|
1188
|
+
deviceData.Device.SetTankWaterTemperature = value;
|
|
1189
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTankWaterTemperature;
|
|
1190
|
+
break;
|
|
1191
|
+
case caseZone2: //Zone 2
|
|
1192
|
+
switch (this.accessory.operationModeZone2) {
|
|
1193
|
+
case 1: //HEAT FLOW
|
|
1194
|
+
deviceData.Device.SetHeatFlowTemperatureZone2 = value;
|
|
1195
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone2;
|
|
1196
|
+
break;
|
|
1197
|
+
case 4: //COOL FLOW
|
|
1198
|
+
deviceData.Device.SetCoolFlowTemperatureZone2 = value;
|
|
1199
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone2;
|
|
1200
|
+
break;
|
|
1201
|
+
default:
|
|
1202
|
+
deviceData.Device.SetTemperatureZone2 = value;
|
|
1203
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone2;
|
|
1204
|
+
break
|
|
1205
|
+
};
|
|
1206
|
+
break;
|
|
1207
|
+
};
|
|
1207
1208
|
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1209
|
+
const set = i > 0 ? await this.melCloudAtw.send(deviceData) : false;
|
|
1210
|
+
const info = this.disableLogInfo || i === 0 ? false : this.emit('message', `${zoneName}, Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
1211
|
+
} catch (error) {
|
|
1212
|
+
this.emit('warn', `${zoneName}, Set heating threshold temperature error: ${error}`);
|
|
1213
|
+
};
|
|
1214
|
+
});
|
|
1215
|
+
};
|
|
1214
1216
|
melCloudService.getCharacteristic(Characteristic.LockPhysicalControls)
|
|
1215
1217
|
.onGet(async () => {
|
|
1216
1218
|
const value = this.accessory.zones[i].lockPhysicalControl;
|
|
@@ -1407,40 +1409,16 @@ class DeviceAtw extends EventEmitter {
|
|
|
1407
1409
|
//deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
|
|
1408
1410
|
break;
|
|
1409
1411
|
case 1: //Zone 1
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
deviceData.Device.SetHeatFlowTemperatureZone1 = value;
|
|
1413
|
-
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone1;
|
|
1414
|
-
break;
|
|
1415
|
-
case 4: //COOL FLOW
|
|
1416
|
-
deviceData.Device.SetCoolFlowTemperatureZone1 = value;
|
|
1417
|
-
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone1;
|
|
1418
|
-
break;
|
|
1419
|
-
default:
|
|
1420
|
-
deviceData.Device.SetTemperatureZone1 = value;
|
|
1421
|
-
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
|
|
1422
|
-
break
|
|
1423
|
-
};
|
|
1412
|
+
deviceData.Device.SetTemperatureZone1 = value;
|
|
1413
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
|
|
1424
1414
|
break;
|
|
1425
1415
|
case caseHotWater: //Hot Water
|
|
1426
1416
|
deviceData.Device.SetTankWaterTemperature = value;
|
|
1427
1417
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTankWaterTemperature;
|
|
1428
1418
|
break;
|
|
1429
1419
|
case caseZone2: //Zone 2
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
deviceData.Device.SetHeatFlowTemperatureZone2 = value;
|
|
1433
|
-
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone2;
|
|
1434
|
-
break;
|
|
1435
|
-
case 4: //COOL FLOW
|
|
1436
|
-
deviceData.Device.SetCoolFlowTemperatureZone2 = value;
|
|
1437
|
-
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone2;
|
|
1438
|
-
break;
|
|
1439
|
-
default:
|
|
1440
|
-
deviceData.Device.SetTemperatureZone2 = value;
|
|
1441
|
-
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone2;
|
|
1442
|
-
break
|
|
1443
|
-
};
|
|
1420
|
+
deviceData.Device.SetTemperatureZone2 = value;
|
|
1421
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone2;
|
|
1444
1422
|
break;
|
|
1445
1423
|
};
|
|
1446
1424
|
|
|
@@ -1450,6 +1428,118 @@ class DeviceAtw extends EventEmitter {
|
|
|
1450
1428
|
this.emit('warn', `${zoneName}, Set temperature error: ${error}`);
|
|
1451
1429
|
};
|
|
1452
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
|
+
};
|
|
1453
1543
|
melCloudServiceT.getCharacteristic(Characteristic.TemperatureDisplayUnits)
|
|
1454
1544
|
.onGet(async () => {
|
|
1455
1545
|
const value = this.accessory.useFahrenheit;
|
package/src/melcloudata.js
CHANGED
package/src/melcloudatw.js
CHANGED
package/src/melclouderv.js
CHANGED