homebridge-melcloud-control 4.4.1-beta.1 → 4.4.1-beta.2
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/config.schema.json +10 -10
- package/package.json +1 -1
- package/src/deviceerv.js +23 -24
- package/src/melcloudata.js +6 -2
- package/src/melcloudatw.js +6 -2
- package/src/melclouderv.js +13 -1
package/config.schema.json
CHANGED
|
@@ -419,7 +419,7 @@
|
|
|
419
419
|
"title": "Frost Protection Support",
|
|
420
420
|
"type": "boolean",
|
|
421
421
|
"default": false,
|
|
422
|
-
"description": "This enable
|
|
422
|
+
"description": "This enable frost protection control and sensors to use with automations in HomeKit app.",
|
|
423
423
|
"condition": {
|
|
424
424
|
"functionBody": "return model.accounts[arrayIndices[0]].type === 'melcloudhome';"
|
|
425
425
|
}
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
"title": "Overheat Protection Support",
|
|
429
429
|
"type": "boolean",
|
|
430
430
|
"default": false,
|
|
431
|
-
"description": "This enable
|
|
431
|
+
"description": "This enable overheat protection control and sensors to use with automations in HomeKit app.",
|
|
432
432
|
"condition": {
|
|
433
433
|
"functionBody": "return model.accounts[arrayIndices[0]].type === 'melcloudhome';"
|
|
434
434
|
}
|
|
@@ -437,7 +437,7 @@
|
|
|
437
437
|
"title": "Holiday Mode Support",
|
|
438
438
|
"type": "boolean",
|
|
439
439
|
"default": false,
|
|
440
|
-
"description": "This enable
|
|
440
|
+
"description": "This enable holiday mode control and sensors to use with automations in HomeKit app.",
|
|
441
441
|
"condition": {
|
|
442
442
|
"functionBody": "return model.accounts[arrayIndices[0]].type === 'melcloudhome';"
|
|
443
443
|
}
|
|
@@ -1272,20 +1272,20 @@
|
|
|
1272
1272
|
"default": false,
|
|
1273
1273
|
"description": "This enable error sensor to use with automations in HomeKit app."
|
|
1274
1274
|
},
|
|
1275
|
-
"
|
|
1276
|
-
"title": "
|
|
1275
|
+
"frostProtectionSupport": {
|
|
1276
|
+
"title": "Frost Protection Support",
|
|
1277
1277
|
"type": "boolean",
|
|
1278
1278
|
"default": false,
|
|
1279
|
-
"description": "This enable
|
|
1279
|
+
"description": "This enable frost protection control and sensors to use with automations in HomeKit app.",
|
|
1280
1280
|
"condition": {
|
|
1281
1281
|
"functionBody": "return model.accounts[arrayIndices[0]].type === 'melcloudhome';"
|
|
1282
1282
|
}
|
|
1283
1283
|
},
|
|
1284
|
-
"
|
|
1285
|
-
"title": "
|
|
1284
|
+
"holidayModeSupport": {
|
|
1285
|
+
"title": "Holiday Mode Support",
|
|
1286
1286
|
"type": "boolean",
|
|
1287
1287
|
"default": false,
|
|
1288
|
-
"description": "This enable
|
|
1288
|
+
"description": "This enable holiday mode control and sensors to use with automations in HomeKit app.",
|
|
1289
1289
|
"condition": {
|
|
1290
1290
|
"functionBody": "return model.accounts[arrayIndices[0]].type === 'melcloudhome';"
|
|
1291
1291
|
}
|
|
@@ -1902,7 +1902,7 @@
|
|
|
1902
1902
|
"title": "Holiday Mode Support",
|
|
1903
1903
|
"type": "boolean",
|
|
1904
1904
|
"default": false,
|
|
1905
|
-
"description": "This enable
|
|
1905
|
+
"description": "This enable holiday mode control and sensors to use with automations in HomeKit app.",
|
|
1906
1906
|
"condition": {
|
|
1907
1907
|
"functionBody": "return model.accounts[arrayIndices[0]].type === 'melcloudhome';"
|
|
1908
1908
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.4.1-beta.
|
|
4
|
+
"version": "4.4.1-beta.2",
|
|
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/deviceerv.js
CHANGED
|
@@ -404,8 +404,8 @@ class DeviceErv extends EventEmitter {
|
|
|
404
404
|
if (supportsAutoVentilationMode && supportsCoolOperationMode) {
|
|
405
405
|
melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
|
|
406
406
|
.setProps({
|
|
407
|
-
minValue: this.accessory.
|
|
408
|
-
maxValue: this.accessory.
|
|
407
|
+
minValue: this.accessory.minTempCoolDryAuto,
|
|
408
|
+
maxValue: this.accessory.maxTempCoolDryAuto,
|
|
409
409
|
minStep: this.accessory.temperatureIncrement
|
|
410
410
|
})
|
|
411
411
|
.onGet(async () => {
|
|
@@ -713,7 +713,7 @@ class DeviceErv extends EventEmitter {
|
|
|
713
713
|
}
|
|
714
714
|
|
|
715
715
|
//holiday mode
|
|
716
|
-
if (this.holidayModeSupport && this.accessory.
|
|
716
|
+
if (this.holidayModeSupport && this.accessory.holidayMode.Enabled !== null) {
|
|
717
717
|
//control
|
|
718
718
|
if (this.logDebug) this.emit('debug', `Prepare holiday mode control service`);
|
|
719
719
|
this.holidayModeControlService = new Service.Switch(`${serviceName} Holiday Mode`, `holidayModeControlService${deviceId}`);
|
|
@@ -721,7 +721,7 @@ class DeviceErv extends EventEmitter {
|
|
|
721
721
|
this.holidayModeControlService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Holiday Mode`);
|
|
722
722
|
this.holidayModeControlService.getCharacteristic(Characteristic.On)
|
|
723
723
|
.onGet(async () => {
|
|
724
|
-
const state = this.accessory.
|
|
724
|
+
const state = this.accessory.holidayMode.Enabled;
|
|
725
725
|
return state;
|
|
726
726
|
})
|
|
727
727
|
.onSet(async (state) => {
|
|
@@ -741,7 +741,7 @@ class DeviceErv extends EventEmitter {
|
|
|
741
741
|
this.holidayModeControlSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Holiday Mode Control`);
|
|
742
742
|
this.holidayModeControlSensorService.getCharacteristic(Characteristic.ContactSensorState)
|
|
743
743
|
.onGet(async () => {
|
|
744
|
-
const state = this.accessory.
|
|
744
|
+
const state = this.accessory.holidayMode.Enabled;
|
|
745
745
|
return state;
|
|
746
746
|
})
|
|
747
747
|
accessory.addService(this.holidayModeControlSensorService);
|
|
@@ -753,7 +753,7 @@ class DeviceErv extends EventEmitter {
|
|
|
753
753
|
this.holidayModeSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Holiday Mode State`);
|
|
754
754
|
this.holidayModeSensorService.getCharacteristic(Characteristic.ContactSensorState)
|
|
755
755
|
.onGet(async () => {
|
|
756
|
-
const state = this.accessory.
|
|
756
|
+
const state = this.accessory.holidayMode.Active;
|
|
757
757
|
return state;
|
|
758
758
|
})
|
|
759
759
|
accessory.addService(this.holidayModeSensorService);
|
|
@@ -1150,11 +1150,12 @@ class DeviceErv extends EventEmitter {
|
|
|
1150
1150
|
|
|
1151
1151
|
//presets schedule
|
|
1152
1152
|
const presetsOnServer = deviceData.Presets ?? [];
|
|
1153
|
-
const scheduleEnabled = deviceData.ScheduleEnabled;
|
|
1154
1153
|
const schedulesOnServer = deviceData.Schedule ?? [];
|
|
1154
|
+
const scheduleEnabled = deviceData.ScheduleEnabled;
|
|
1155
1155
|
const scenesOnServer = deviceData.Scenes ?? [];
|
|
1156
|
-
|
|
1157
|
-
|
|
1156
|
+
|
|
1157
|
+
//protection
|
|
1158
|
+
const holidayMode = deviceData.HolidayMode ?? {};
|
|
1158
1159
|
|
|
1159
1160
|
//device control
|
|
1160
1161
|
const hideRoomTemperature = deviceData.HideRoomTemperature;
|
|
@@ -1187,8 +1188,8 @@ class DeviceErv extends EventEmitter {
|
|
|
1187
1188
|
const temperatureIncrement = deviceData.Device[tempStepKey] ?? 1;
|
|
1188
1189
|
const minTempHeat = 10;
|
|
1189
1190
|
const maxTempHeat = 31;
|
|
1190
|
-
const
|
|
1191
|
-
const
|
|
1191
|
+
const minTempCoolDryAuto = 16;
|
|
1192
|
+
const maxTempCoolDryAuto = 31;
|
|
1192
1193
|
|
|
1193
1194
|
//device state
|
|
1194
1195
|
const power = deviceData.Device.Power;
|
|
@@ -1210,7 +1211,9 @@ class DeviceErv extends EventEmitter {
|
|
|
1210
1211
|
const obj = {
|
|
1211
1212
|
presets: presetsOnServer,
|
|
1212
1213
|
schedules: schedulesOnServer,
|
|
1214
|
+
scheduleEnabled: scheduleEnabled,
|
|
1213
1215
|
scenes: scenesOnServer,
|
|
1216
|
+
holidayMode: holidayMode,
|
|
1214
1217
|
supportsRoomTemperature: supportsRoomTemperature,
|
|
1215
1218
|
supportsSupplyTemperature: supportsSupplyTemperature,
|
|
1216
1219
|
supportsOutdoorTemperature: supportsOutdoorTemperature,
|
|
@@ -1227,6 +1230,10 @@ class DeviceErv extends EventEmitter {
|
|
|
1227
1230
|
supportsBypassVentilationMode: supportsBypassVentilationMode,
|
|
1228
1231
|
supportsAutomaticFanSpeed: supportsAutomaticFanSpeed,
|
|
1229
1232
|
supportsStanbyMode: supportsStanbyMode,
|
|
1233
|
+
minTempHeat: minTempHeat,
|
|
1234
|
+
maxTempHeat: maxTempHeat,
|
|
1235
|
+
minTempCoolDryAuto: minTempCoolDryAuto,
|
|
1236
|
+
maxTempCoolDryAuto: maxTempCoolDryAuto,
|
|
1230
1237
|
coreMaintenanceRequired: coreMaintenanceRequired,
|
|
1231
1238
|
filterMaintenanceRequired: filterMaintenanceRequired,
|
|
1232
1239
|
actualVentilationMode: actualVentilationMode,
|
|
@@ -1246,18 +1253,10 @@ class DeviceErv extends EventEmitter {
|
|
|
1246
1253
|
defaultCoolingSetTemperature: defaultCoolingSetTemperature,
|
|
1247
1254
|
lockPhysicalControl: 0,
|
|
1248
1255
|
temperatureIncrement: temperatureIncrement,
|
|
1249
|
-
minTempHeat: minTempHeat,
|
|
1250
|
-
temperatureIncrement: maxTempHeat,
|
|
1251
|
-
minTempCoolDry: minTempCoolDry,
|
|
1252
|
-
maxTempCoolDry: maxTempCoolDry,
|
|
1253
1256
|
useFahrenheit: this.accountInfo.useFahrenheit ? 1 : 0,
|
|
1254
1257
|
temperatureUnit: TemperatureDisplayUnits[this.accountInfo.useFahrenheit ? 1 : 0],
|
|
1255
1258
|
isConnected: isConnected,
|
|
1256
|
-
isInError: isInError
|
|
1257
|
-
scheduleEnabled: scheduleEnabled,
|
|
1258
|
-
holidayModeEnabled: holidayModeEnabled,
|
|
1259
|
-
holidayModeActive: holidayModeActive,
|
|
1260
|
-
scheduleEnabled: scheduleEnabled
|
|
1259
|
+
isInError: isInError
|
|
1261
1260
|
};
|
|
1262
1261
|
|
|
1263
1262
|
//characteristics array
|
|
@@ -1414,10 +1413,10 @@ class DeviceErv extends EventEmitter {
|
|
|
1414
1413
|
this.errorService?.updateCharacteristic(Characteristic.ContactSensorState, isInError);
|
|
1415
1414
|
|
|
1416
1415
|
//holiday mode
|
|
1417
|
-
if (this.holidayModeSupport &&
|
|
1418
|
-
this.holidayModeControlService?.updateCharacteristic(Characteristic.On,
|
|
1419
|
-
this.holidayModeControlSensorService?.updateCharacteristic(Characteristic.ContactSensorState,
|
|
1420
|
-
this.holidayModeSensorService?.updateCharacteristic(Characteristic.ContactSensorState,
|
|
1416
|
+
if (this.holidayModeSupport && holidayMode.Enabled !== null) {
|
|
1417
|
+
this.holidayModeControlService?.updateCharacteristic(Characteristic.On, holidayMode.Enabled);
|
|
1418
|
+
this.holidayModeControlSensorService?.updateCharacteristic(Characteristic.ContactSensorState, holidayMode.Enabled);
|
|
1419
|
+
this.holidayModeSensorService?.updateCharacteristic(Characteristic.ContactSensorState, holidayMode.Active);
|
|
1421
1420
|
}
|
|
1422
1421
|
|
|
1423
1422
|
//presets
|
package/src/melcloudata.js
CHANGED
|
@@ -231,13 +231,18 @@ class MelCloudAta extends EventEmitter {
|
|
|
231
231
|
HasPendingCommand: true
|
|
232
232
|
};
|
|
233
233
|
path = ApiUrls.SetAta;
|
|
234
|
+
update = true;
|
|
234
235
|
break;
|
|
235
236
|
}
|
|
236
237
|
|
|
237
238
|
if (this.logDebug) this.emit('debug', `Send data: ${JSON.stringify(payload, null, 2)}`);
|
|
238
239
|
await this.client(path, { method: 'POST', data: payload });
|
|
239
240
|
|
|
240
|
-
|
|
241
|
+
if (update) {
|
|
242
|
+
setTimeout(() => {
|
|
243
|
+
this.emit('deviceState', deviceData);
|
|
244
|
+
}, 500);
|
|
245
|
+
}
|
|
241
246
|
return true;
|
|
242
247
|
case "melcloudhome":
|
|
243
248
|
switch (flag) {
|
|
@@ -320,7 +325,6 @@ class MelCloudAta extends EventEmitter {
|
|
|
320
325
|
this.emit('deviceState', deviceData);
|
|
321
326
|
}, 500);
|
|
322
327
|
}
|
|
323
|
-
|
|
324
328
|
return true;
|
|
325
329
|
default:
|
|
326
330
|
return;
|
package/src/melcloudatw.js
CHANGED
|
@@ -232,13 +232,18 @@ class MelCloudAtw extends EventEmitter {
|
|
|
232
232
|
HasPendingCommand: true
|
|
233
233
|
}
|
|
234
234
|
path = ApiUrls.SetAtw;
|
|
235
|
+
update = true;
|
|
235
236
|
break;
|
|
236
237
|
}
|
|
237
238
|
|
|
238
239
|
if (this.logDebug) this.emit('debug', `Send data: ${JSON.stringify(payload, null, 2)}`);
|
|
239
240
|
await this.client(path, { method: 'POST', data: payload });
|
|
240
241
|
|
|
241
|
-
|
|
242
|
+
if (update) {
|
|
243
|
+
setTimeout(() => {
|
|
244
|
+
this.emit('deviceState', deviceData);
|
|
245
|
+
}, 500);
|
|
246
|
+
}
|
|
242
247
|
return true;
|
|
243
248
|
case "melcloudhome":
|
|
244
249
|
switch (flag) {
|
|
@@ -302,7 +307,6 @@ class MelCloudAtw extends EventEmitter {
|
|
|
302
307
|
this.emit('deviceState', deviceData);
|
|
303
308
|
}, 500);
|
|
304
309
|
}
|
|
305
|
-
|
|
306
310
|
return true;
|
|
307
311
|
default:
|
|
308
312
|
return;
|
package/src/melclouderv.js
CHANGED
|
@@ -182,6 +182,7 @@ class MelCloudErv extends EventEmitter {
|
|
|
182
182
|
let method = null
|
|
183
183
|
let payload = {};
|
|
184
184
|
let path = '';
|
|
185
|
+
let update = false;
|
|
185
186
|
switch (accountType) {
|
|
186
187
|
case "melcloud":
|
|
187
188
|
switch (flag) {
|
|
@@ -231,13 +232,18 @@ class MelCloudErv extends EventEmitter {
|
|
|
231
232
|
HasPendingCommand: true
|
|
232
233
|
}
|
|
233
234
|
path = ApiUrls.SetErv;
|
|
235
|
+
update = true;
|
|
234
236
|
break;
|
|
235
237
|
}
|
|
236
238
|
|
|
237
239
|
if (this.logDebug) this.emit('debug', `Send data: ${JSON.stringify(payload, null, 2)}`);
|
|
238
240
|
await this.client(path, { method: 'POST', data: payload });
|
|
239
241
|
|
|
240
|
-
|
|
242
|
+
if (update) {
|
|
243
|
+
setTimeout(() => {
|
|
244
|
+
this.emit('deviceState', deviceData);
|
|
245
|
+
}, 500);
|
|
246
|
+
} this.emit('deviceState', deviceData);
|
|
241
247
|
return true;
|
|
242
248
|
case "melcloudhome":
|
|
243
249
|
switch (flag) {
|
|
@@ -255,6 +261,7 @@ class MelCloudErv extends EventEmitter {
|
|
|
255
261
|
payload = { enabled: deviceData.ScheduleEnabled };
|
|
256
262
|
method = 'PUT';
|
|
257
263
|
path = ApiUrlsHome.PutScheduleEnabled.replace('deviceid', deviceData.DeviceID);
|
|
264
|
+
update = true;
|
|
258
265
|
break;
|
|
259
266
|
case 'scene':
|
|
260
267
|
method = 'PUT';
|
|
@@ -288,6 +295,11 @@ class MelCloudErv extends EventEmitter {
|
|
|
288
295
|
if (this.logDebug) this.emit('debug', `Send data: ${JSON.stringify(payload, null, 2)}`);
|
|
289
296
|
await this.client(path, { method: method, data: payload });
|
|
290
297
|
|
|
298
|
+
if (update) {
|
|
299
|
+
setTimeout(() => {
|
|
300
|
+
this.emit('deviceState', deviceData);
|
|
301
|
+
}, 500);
|
|
302
|
+
}
|
|
291
303
|
return true;
|
|
292
304
|
default:
|
|
293
305
|
return;
|