homebridge-melcloud-control 4.2.2-beta.4 → 4.2.2-beta.6
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 +21 -0
- package/package.json +1 -1
- package/src/deviceata.js +20 -1
- package/src/deviceatw.js +21 -1
- package/src/deviceerv.js +20 -1
- package/src/melcloud.js +2 -1
- package/src/melcloudata.js +1 -1
- package/src/melcloudatw.js +1 -1
- package/src/melclouderv.js +1 -1
package/config.schema.json
CHANGED
|
@@ -395,6 +395,12 @@
|
|
|
395
395
|
"default": false,
|
|
396
396
|
"description": "This enable extra outdoor temperature sensor to use with automations in HomeKit app."
|
|
397
397
|
},
|
|
398
|
+
"connectSensor": {
|
|
399
|
+
"title": "Connect",
|
|
400
|
+
"type": "boolean",
|
|
401
|
+
"default": false,
|
|
402
|
+
"description": "This enable connect sensor to use with automations in HomeKit app."
|
|
403
|
+
},
|
|
398
404
|
"errorSensor": {
|
|
399
405
|
"title": "Error",
|
|
400
406
|
"type": "boolean",
|
|
@@ -1107,6 +1113,12 @@
|
|
|
1107
1113
|
"default": false,
|
|
1108
1114
|
"description": "This enable extra Return Zone 2 temperature sensor to use with automations in HomeKit app."
|
|
1109
1115
|
},
|
|
1116
|
+
"connectSensor": {
|
|
1117
|
+
"title": "Connect",
|
|
1118
|
+
"type": "boolean",
|
|
1119
|
+
"default": false,
|
|
1120
|
+
"description": "This enable connect sensor to use with automations in HomeKit app."
|
|
1121
|
+
},
|
|
1110
1122
|
"errorSensor": {
|
|
1111
1123
|
"title": "Error",
|
|
1112
1124
|
"type": "boolean",
|
|
@@ -1579,6 +1591,12 @@
|
|
|
1579
1591
|
"default": false,
|
|
1580
1592
|
"description": "This enable extra supply temperature sensor to use with automations in HomeKit app."
|
|
1581
1593
|
},
|
|
1594
|
+
"connectSensor": {
|
|
1595
|
+
"title": "Connect",
|
|
1596
|
+
"type": "boolean",
|
|
1597
|
+
"default": false,
|
|
1598
|
+
"description": "This enable connect sensor to use with automations in HomeKit app."
|
|
1599
|
+
},
|
|
1582
1600
|
"errorSensor": {
|
|
1583
1601
|
"title": "Error",
|
|
1584
1602
|
"type": "boolean",
|
|
@@ -2221,6 +2239,7 @@
|
|
|
2221
2239
|
{
|
|
2222
2240
|
"title": "System",
|
|
2223
2241
|
"items": [
|
|
2242
|
+
"accounts[].ataDevices[].connectSensor",
|
|
2224
2243
|
"accounts[].ataDevices[].errorSensor"
|
|
2225
2244
|
]
|
|
2226
2245
|
},
|
|
@@ -2372,6 +2391,7 @@
|
|
|
2372
2391
|
{
|
|
2373
2392
|
"title": "System",
|
|
2374
2393
|
"items": [
|
|
2394
|
+
"accounts[].atwDevices[].connectSensor",
|
|
2375
2395
|
"accounts[].atwDevices[].errorSensor"
|
|
2376
2396
|
]
|
|
2377
2397
|
},
|
|
@@ -2516,6 +2536,7 @@
|
|
|
2516
2536
|
{
|
|
2517
2537
|
"title": "System",
|
|
2518
2538
|
"items": [
|
|
2539
|
+
"accounts[].ervDevices[].connectSensor",
|
|
2519
2540
|
"accounts[].ervDevices[].errorSensor"
|
|
2520
2541
|
]
|
|
2521
2542
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.2.2-beta.
|
|
4
|
+
"version": "4.2.2-beta.6",
|
|
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/deviceata.js
CHANGED
|
@@ -35,6 +35,7 @@ class DeviceAta extends EventEmitter {
|
|
|
35
35
|
this.autoDryFanMode = device.autoDryFanMode || 1; //NONE, AUTO, DRY, FAN
|
|
36
36
|
this.temperatureSensor = device.temperatureSensor || false;
|
|
37
37
|
this.temperatureOutdoorSensor = device.temperatureOutdoorSensor || false;
|
|
38
|
+
this.connectSensor = device.connectSensor || false;
|
|
38
39
|
this.errorSensor = device.errorSensor || false;
|
|
39
40
|
this.frostProtectionSupport = device.frostProtectionSupport || false;
|
|
40
41
|
this.overheatProtectionSupport = device.overheatProtectionSupport || false;
|
|
@@ -655,10 +656,24 @@ class DeviceAta extends EventEmitter {
|
|
|
655
656
|
accessory.addService(this.outdoorTemperatureSensorService);
|
|
656
657
|
};
|
|
657
658
|
|
|
659
|
+
//connect sensor
|
|
660
|
+
if (this.connectSensor && this.accessory.isConnected !== null) {
|
|
661
|
+
if (this.logDebug) this.emit('debug', `Prepare error service`);
|
|
662
|
+
this.connectService = new Service.ContactSensor(`${serviceName} Connect`, `connectService${deviceId}`);
|
|
663
|
+
this.connectService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
664
|
+
this.connectService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Connect`);
|
|
665
|
+
this.connectService.getCharacteristic(Characteristic.ContactSensorState)
|
|
666
|
+
.onGet(async () => {
|
|
667
|
+
const state = this.accessory.isConnected;
|
|
668
|
+
return state;
|
|
669
|
+
})
|
|
670
|
+
accessory.addService(this.connectService);
|
|
671
|
+
}
|
|
672
|
+
|
|
658
673
|
//error sensor
|
|
659
674
|
if (this.errorSensor && this.accessory.isInError !== null) {
|
|
660
675
|
if (this.logDebug) this.emit('debug', `Prepare error service`);
|
|
661
|
-
this.errorService = new Service.ContactSensor(`${serviceName} Error`, `
|
|
676
|
+
this.errorService = new Service.ContactSensor(`${serviceName} Error`, `errorService${deviceId}`);
|
|
662
677
|
this.errorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
663
678
|
this.errorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Error`);
|
|
664
679
|
this.errorService.getCharacteristic(Characteristic.ContactSensorState)
|
|
@@ -1208,6 +1223,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1208
1223
|
//keys
|
|
1209
1224
|
const fanKey = this.accountType === 'melcloud' ? 'FanSpeed' : 'SetFanSpeed';
|
|
1210
1225
|
const tempStepKey = this.accountType === 'melcloud' ? 'TemperatureIncrement' : 'HasHalfDegreeIncrements';
|
|
1226
|
+
const connectKey = this.accountType === 'melcloud' ? 'Offline' : 'IsConnected';
|
|
1211
1227
|
const errorKey = this.accountType === 'melcloud' ? 'HasError' : 'IsInError';
|
|
1212
1228
|
const supportAirDirectionKey = this.accountType === 'melcloud' ? 'AirDirectionFunction' : 'HasAirDirectionFunction';
|
|
1213
1229
|
const supportSwingKey = this.accountType === 'melcloud' ? 'SwingFunction' : 'HasSwing';
|
|
@@ -1275,6 +1291,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1275
1291
|
const prohibitPower = deviceData.Device.ProhibitPower ?? false;
|
|
1276
1292
|
const temperatureStep = deviceData.Device[tempStepKey] ? 0.5 : 1;
|
|
1277
1293
|
const outdoorTemperature = deviceData.Device.OutdoorTemperature;
|
|
1294
|
+
const isConnected = deviceData.Device[connectKey];
|
|
1278
1295
|
const isInError = deviceData.Device[errorKey];
|
|
1279
1296
|
|
|
1280
1297
|
//accessory
|
|
@@ -1315,6 +1332,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1315
1332
|
temperatureStep: temperatureStep,
|
|
1316
1333
|
useFahrenheit: this.useFahrenheit,
|
|
1317
1334
|
temperatureUnit: TemperatureDisplayUnits[this.useFahrenheit],
|
|
1335
|
+
isConnected: isConnected,
|
|
1318
1336
|
isInError: isInError,
|
|
1319
1337
|
frostProtectionEnabled: frostProtectionEnabled,
|
|
1320
1338
|
frostProtectionActive: frostProtectionActive,
|
|
@@ -1465,6 +1483,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1465
1483
|
//senors
|
|
1466
1484
|
this.roomTemperatureSensorService?.updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature);
|
|
1467
1485
|
this.outdoorTemperatureSensorService?.updateCharacteristic(Characteristic.CurrentTemperature, outdoorTemperature);
|
|
1486
|
+
this.connectService?.updateCharacteristic(Characteristic.ContactSensorState, isConnected);
|
|
1468
1487
|
this.errorService?.updateCharacteristic(Characteristic.ContactSensorState, isInError);
|
|
1469
1488
|
|
|
1470
1489
|
//frost protection
|
package/src/deviceatw.js
CHANGED
|
@@ -37,6 +37,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
37
37
|
this.temperatureReturnWaterTankSensor = device.temperatureReturnWaterTankSensor || false;
|
|
38
38
|
this.temperatureFlowZone2Sensor = device.temperatureFlowZone2Sensor || false;
|
|
39
39
|
this.temperatureReturnZone2Sensor = device.temperatureReturnZone2Sensor || false;
|
|
40
|
+
this.connectSensor = device.connectSensor || false;
|
|
40
41
|
this.errorSensor = device.errorSensor || false;
|
|
41
42
|
this.holidayModeSupport = device.holidayModeSupport || false;
|
|
42
43
|
this.presets = this.accountType === 'melcloud' ? (device.presets || []).filter(preset => (preset.displayType ?? 0) > 0 && preset.id !== '0') : [];
|
|
@@ -1068,10 +1069,24 @@ class DeviceAtw extends EventEmitter {
|
|
|
1068
1069
|
});
|
|
1069
1070
|
};
|
|
1070
1071
|
|
|
1072
|
+
//connect sensor
|
|
1073
|
+
if (this.connectSensor && this.accessory.isConnected !== null) {
|
|
1074
|
+
if (this.logDebug) this.emit('debug', `Prepare error service`);
|
|
1075
|
+
this.connectService = new Service.ContactSensor(`${serviceName} Connect`, `connectService${deviceId}`);
|
|
1076
|
+
this.connectService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1077
|
+
this.connectService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Connect`);
|
|
1078
|
+
this.connectService.getCharacteristic(Characteristic.ContactSensorState)
|
|
1079
|
+
.onGet(async () => {
|
|
1080
|
+
const state = this.accessory.isConnected;
|
|
1081
|
+
return state;
|
|
1082
|
+
})
|
|
1083
|
+
accessory.addService(this.connectService);
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1071
1086
|
//error sensor
|
|
1072
1087
|
if (this.errorSensor && this.accessory.isInError !== null) {
|
|
1073
1088
|
if (this.logDebug) this.emit('debug', `Prepare error service`);
|
|
1074
|
-
this.errorService = new Service.ContactSensor(`${serviceName} Error`, `
|
|
1089
|
+
this.errorService = new Service.ContactSensor(`${serviceName} Error`, `errorService${deviceId}`);
|
|
1075
1090
|
this.errorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1076
1091
|
this.errorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Error`);
|
|
1077
1092
|
this.errorService.getCharacteristic(Characteristic.ContactSensorState)
|
|
@@ -1082,6 +1097,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1082
1097
|
accessory.addService(this.errorService);
|
|
1083
1098
|
}
|
|
1084
1099
|
|
|
1100
|
+
|
|
1085
1101
|
//holiday mode
|
|
1086
1102
|
if (this.holidayModeSupport && this.accessory.holidayModeEnabled !== null) {
|
|
1087
1103
|
//control
|
|
@@ -1471,6 +1487,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1471
1487
|
|
|
1472
1488
|
//keys
|
|
1473
1489
|
const tempStepKey = this.accountType === 'melcloud' ? 'TemperatureIncrement' : 'HasHalfDegreeIncrements';
|
|
1490
|
+
const connectKey = this.accountType === 'melcloud' ? 'Offline' : 'IsConnected';
|
|
1474
1491
|
const errorKey = this.accountType === 'melcloud' ? 'HasError' : 'IsInError';
|
|
1475
1492
|
|
|
1476
1493
|
//presets schedule
|
|
@@ -1518,6 +1535,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1518
1535
|
const holidayMode = deviceData.Device.HolidayMode ?? false;
|
|
1519
1536
|
const flowTemperatureHeatPump = deviceData.Device.FlowTemperature;
|
|
1520
1537
|
const returnTemperatureHeatPump = deviceData.Device.ReturnTemperature;
|
|
1538
|
+
const isConnected = deviceData.Device[connectKey];
|
|
1521
1539
|
const isInError = deviceData.Device[errorKey];
|
|
1522
1540
|
|
|
1523
1541
|
//zone 1
|
|
@@ -1580,6 +1598,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1580
1598
|
sensorsCount: zonesSensorsCount,
|
|
1581
1599
|
useFahrenheit: this.useFahrenheit,
|
|
1582
1600
|
temperatureUnit: TemperatureDisplayUnits[this.useFahrenheit],
|
|
1601
|
+
isConnected: isConnected,
|
|
1583
1602
|
isInError: isInError,
|
|
1584
1603
|
scheduleEnabled: scheduleEnabled,
|
|
1585
1604
|
holidayModeEnabled: holidayModeEnabled,
|
|
@@ -1962,6 +1981,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1962
1981
|
this.accessory = obj;
|
|
1963
1982
|
|
|
1964
1983
|
//error sensor
|
|
1984
|
+
this.connectService?.updateCharacteristic(Characteristic.ContactSensorState, isConnected);
|
|
1965
1985
|
this.errorService?.updateCharacteristic(Characteristic.ContactSensorState, isInError);
|
|
1966
1986
|
|
|
1967
1987
|
//holiday mode
|
package/src/deviceerv.js
CHANGED
|
@@ -30,6 +30,7 @@ class DeviceErv extends EventEmitter {
|
|
|
30
30
|
this.temperatureSensor = device.temperatureSensor || false;
|
|
31
31
|
this.temperatureOutdoorSensor = device.temperatureOutdoorSensor || false;
|
|
32
32
|
this.temperatureSupplySensor = device.temperatureSupplySensor || false;
|
|
33
|
+
this.connectSensor = device.connectSensor || false;
|
|
33
34
|
this.errorSensor = device.errorSensor || false;
|
|
34
35
|
this.holidayModeSupport = device.holidayModeSupport || false;
|
|
35
36
|
this.presets = this.accountType === 'melcloud' ? (device.presets || []).filter(preset => (preset.displayType ?? 0) > 0 && preset.id !== '0') : [];
|
|
@@ -687,10 +688,24 @@ class DeviceErv extends EventEmitter {
|
|
|
687
688
|
accessory.addService(this.airQualitySensorService);
|
|
688
689
|
}
|
|
689
690
|
|
|
691
|
+
//connect sensor
|
|
692
|
+
if (this.connectSensor && this.accessory.isConnected !== null) {
|
|
693
|
+
if (this.logDebug) this.emit('debug', `Prepare error service`);
|
|
694
|
+
this.connectService = new Service.ContactSensor(`${serviceName} Connect`, `connectService${deviceId}`);
|
|
695
|
+
this.connectService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
696
|
+
this.connectService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Connect`);
|
|
697
|
+
this.connectService.getCharacteristic(Characteristic.ContactSensorState)
|
|
698
|
+
.onGet(async () => {
|
|
699
|
+
const state = this.accessory.isConnected;
|
|
700
|
+
return state;
|
|
701
|
+
})
|
|
702
|
+
accessory.addService(this.connectService);
|
|
703
|
+
}
|
|
704
|
+
|
|
690
705
|
//error sensor
|
|
691
706
|
if (this.errorSensor && this.accessory.isInError !== null) {
|
|
692
707
|
if (this.logDebug) this.emit('debug', `Prepare error service`);
|
|
693
|
-
this.errorService = new Service.ContactSensor(`${serviceName} Error`, `
|
|
708
|
+
this.errorService = new Service.ContactSensor(`${serviceName} Error`, `errorService${deviceId}`);
|
|
694
709
|
this.errorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
695
710
|
this.errorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Error`);
|
|
696
711
|
this.errorService.getCharacteristic(Characteristic.ContactSensorState)
|
|
@@ -1017,6 +1032,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1017
1032
|
|
|
1018
1033
|
//keys
|
|
1019
1034
|
const tempStepKey = this.accountType === 'melcloud' ? 'TemperatureIncrement' : 'HasHalfDegreeIncrements';
|
|
1035
|
+
const connectKey = this.accountType === 'melcloud' ? 'Offline' : 'IsConnected';
|
|
1020
1036
|
const errorKey = this.accountType === 'melcloud' ? 'HasError' : 'IsInError';
|
|
1021
1037
|
|
|
1022
1038
|
//presets schedule
|
|
@@ -1070,6 +1086,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1070
1086
|
const setFanSpeed = deviceData.Device.SetFanSpeed;
|
|
1071
1087
|
const operationMode = deviceData.Device.OperationMode;
|
|
1072
1088
|
const ventilationMode = deviceData.Device.VentilationMode;
|
|
1089
|
+
const isConnected = deviceData.Device[connectKey];
|
|
1073
1090
|
const isInError = deviceData.Device[errorKey];
|
|
1074
1091
|
|
|
1075
1092
|
//accessory
|
|
@@ -1114,6 +1131,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1114
1131
|
maxTempCoolDry: maxTempCoolDry,
|
|
1115
1132
|
useFahrenheit: this.useFahrenheit,
|
|
1116
1133
|
temperatureUnit: TemperatureDisplayUnits[this.useFahrenheit],
|
|
1134
|
+
isConnected: isConnected,
|
|
1117
1135
|
isInError: isInError,
|
|
1118
1136
|
scheduleEnabled: scheduleEnabled,
|
|
1119
1137
|
holidayModeEnabled: holidayModeEnabled,
|
|
@@ -1256,6 +1274,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1256
1274
|
.updateCharacteristic(Characteristic.PM2_5Density, pM25Level);
|
|
1257
1275
|
|
|
1258
1276
|
//error sensor
|
|
1277
|
+
this.connectService?.updateCharacteristic(Characteristic.ContactSensorState, isConnected);
|
|
1259
1278
|
this.errorService?.updateCharacteristic(Characteristic.ContactSensorState, isInError);
|
|
1260
1279
|
|
|
1261
1280
|
//holiday mode
|
package/src/melcloud.js
CHANGED
|
@@ -275,7 +275,8 @@ class MelCloud extends EventEmitter {
|
|
|
275
275
|
const deviceObject = {
|
|
276
276
|
...capitalizeKeys(device.Capabilities || {}),
|
|
277
277
|
...settingsObject,
|
|
278
|
-
DeviceType: type
|
|
278
|
+
DeviceType: type,
|
|
279
|
+
IsConnected: device.IsConnected
|
|
279
280
|
};
|
|
280
281
|
|
|
281
282
|
// Kapitalizacja brakujących obiektów/tablic
|
package/src/melcloudata.js
CHANGED
package/src/melcloudatw.js
CHANGED