homebridge-melcloud-control 4.2.2-beta.8 → 4.2.2-beta.9
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 +1 -0
- package/README.md +3 -0
- package/config.schema.json +21 -0
- package/package.json +1 -1
- package/src/deviceata.js +23 -4
- package/src/deviceatw.js +36 -18
- package/src/deviceerv.js +90 -72
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -245,6 +245,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
245
245
|
| `ataDevices[].autoDryFanMode` | Here select the operatiing mode for `Auto`, if this mode is not supported, it will be disabled.. |
|
|
246
246
|
| `ataDevices[].temperatureSensor` | This enable extra `Room` temperature sensor to use with automations in HomeKit app. |
|
|
247
247
|
| `ataDevices[].temperatureOutdoorSensor` | This enable extra `Outdoor` temperature sensor to use with automations in HomeKit app. |
|
|
248
|
+
| `ataDevices[].inStandbySensor` | This enable `In Standby` sensor to use with automations in HomeKit app. |
|
|
248
249
|
| `ataDevices[].connectSensor` | This enable `Connect` sensor to use with automations in HomeKit app. |
|
|
249
250
|
| `ataDevices[].errorSensor` | This enable `Error` sensor to use with automations in HomeKit app. |
|
|
250
251
|
| `ataDevices[].frostProtectionSupport` | This enable extra `Frost Protectio` control and sensors to use with automations in HomeKit app. |
|
|
@@ -280,6 +281,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
280
281
|
| `atwDevices[].temperatureReturnWaterTankSensor` | This enable extra `Return Water Tank` temperature sensor to use with automations in HomeKit app. |
|
|
281
282
|
| `atwDevices[].temperatureFlowZone2Sensor` | This enable extra `Flow Zone 2` temperature sensor to use with automations in HomeKit app. |
|
|
282
283
|
| `atwDevices[].temperatureReturnZone2Sensor` | This enable extra `Return Zone 2` temperature sensor to use with automations in HomeKit app. |
|
|
284
|
+
| `atwDevices[].inStandbySensor` | This enable `In Standby` sensor to use with automations in HomeKit app. |
|
|
283
285
|
| `atwDevices[].connectSensor` | This enable `Connect` sensor to use with automations in HomeKit app. |
|
|
284
286
|
| `atwDevices[].errorSensor` | This enable `Error` sensors to use with automations in HomeKit app. |
|
|
285
287
|
| `atwDevices[].holidayModeSupport` | This enable extra `Holiday Mode` control and sensors to use with automations in HomeKit app. |
|
|
@@ -306,6 +308,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
306
308
|
| `ervDevices[].temperatureSensor` | This enable extra `Room` temperature sensor to use with automations in HomeKit app. |
|
|
307
309
|
| `ervDevices[].temperatureOutdoorSensor` | This enable extra `Outdoor` temperature sensor to use with automations in HomeKit app. |
|
|
308
310
|
| `ervDevices[].temperatureSupplySensor` | This enable extra `Supply` temperature sensor to use with automations in HomeKit app. |
|
|
311
|
+
| `atwDevices[].inStandbySensor` | This enable `In Standby` sensor to use with automations in HomeKit app. |
|
|
309
312
|
| `ervDevices[].connectSensor` | This enable `Connect` sensor to use with automations in HomeKit app. |
|
|
310
313
|
| `ervDevices[].errorSensor` | This enable `Error` sensors to use with automations in HomeKit app. |
|
|
311
314
|
| `ervDevices[].holidayModeSupport` | This enable extra `Holiday Mode` control and sensors to use with automations in HomeKit app. |
|
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
|
+
"inStandbySensor": {
|
|
399
|
+
"title": "In Standby",
|
|
400
|
+
"type": "boolean",
|
|
401
|
+
"default": false,
|
|
402
|
+
"description": "This enable in standby mode sensor to use with automations in HomeKit app."
|
|
403
|
+
},
|
|
398
404
|
"connectSensor": {
|
|
399
405
|
"title": "Connect",
|
|
400
406
|
"type": "boolean",
|
|
@@ -1113,6 +1119,12 @@
|
|
|
1113
1119
|
"default": false,
|
|
1114
1120
|
"description": "This enable extra Return Zone 2 temperature sensor to use with automations in HomeKit app."
|
|
1115
1121
|
},
|
|
1122
|
+
"inStandbySensor": {
|
|
1123
|
+
"title": "In Standby",
|
|
1124
|
+
"type": "boolean",
|
|
1125
|
+
"default": false,
|
|
1126
|
+
"description": "This enable in standby mode sensor to use with automations in HomeKit app."
|
|
1127
|
+
},
|
|
1116
1128
|
"connectSensor": {
|
|
1117
1129
|
"title": "Connect",
|
|
1118
1130
|
"type": "boolean",
|
|
@@ -1591,6 +1603,12 @@
|
|
|
1591
1603
|
"default": false,
|
|
1592
1604
|
"description": "This enable extra supply temperature sensor to use with automations in HomeKit app."
|
|
1593
1605
|
},
|
|
1606
|
+
"inStandbySensor": {
|
|
1607
|
+
"title": "In Standby",
|
|
1608
|
+
"type": "boolean",
|
|
1609
|
+
"default": false,
|
|
1610
|
+
"description": "This enable in standby mode sensor to use with automations in HomeKit app."
|
|
1611
|
+
},
|
|
1594
1612
|
"connectSensor": {
|
|
1595
1613
|
"title": "Connect",
|
|
1596
1614
|
"type": "boolean",
|
|
@@ -2239,6 +2257,7 @@
|
|
|
2239
2257
|
{
|
|
2240
2258
|
"title": "System",
|
|
2241
2259
|
"items": [
|
|
2260
|
+
"accounts[].ataDevices[].inStandbySensor",
|
|
2242
2261
|
"accounts[].ataDevices[].connectSensor",
|
|
2243
2262
|
"accounts[].ataDevices[].errorSensor"
|
|
2244
2263
|
]
|
|
@@ -2391,6 +2410,7 @@
|
|
|
2391
2410
|
{
|
|
2392
2411
|
"title": "System",
|
|
2393
2412
|
"items": [
|
|
2413
|
+
"accounts[].atwDevices[].inStandbySensor",
|
|
2394
2414
|
"accounts[].atwDevices[].connectSensor",
|
|
2395
2415
|
"accounts[].atwDevices[].errorSensor"
|
|
2396
2416
|
]
|
|
@@ -2536,6 +2556,7 @@
|
|
|
2536
2556
|
{
|
|
2537
2557
|
"title": "System",
|
|
2538
2558
|
"items": [
|
|
2559
|
+
"accounts[].ervDevices[].inStandbySensor",
|
|
2539
2560
|
"accounts[].ervDevices[].connectSensor",
|
|
2540
2561
|
"accounts[].ervDevices[].errorSensor"
|
|
2541
2562
|
]
|
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.9",
|
|
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.inStandbySensor = device.inStandbySensor || false;
|
|
38
39
|
this.connectSensor = device.connectSensor || false;
|
|
39
40
|
this.errorSensor = device.errorSensor || false;
|
|
40
41
|
this.frostProtectionSupport = device.frostProtectionSupport || false;
|
|
@@ -656,9 +657,23 @@ class DeviceAta extends EventEmitter {
|
|
|
656
657
|
accessory.addService(this.outdoorTemperatureSensorService);
|
|
657
658
|
};
|
|
658
659
|
|
|
660
|
+
//connect sensor
|
|
661
|
+
if (this.inStandbySensor && this.accessory.inStandbyMode !== null) {
|
|
662
|
+
if (this.logDebug) this.emit('debug', `Prepare in standby mode service`);
|
|
663
|
+
this.inStandbyService = new Service.ContactSensor(`${serviceName} In Standby`, `inStandbyService${deviceId}`);
|
|
664
|
+
this.inStandbyService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
665
|
+
this.inStandbyService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} In Standby`);
|
|
666
|
+
this.inStandbyService.getCharacteristic(Characteristic.ContactSensorState)
|
|
667
|
+
.onGet(async () => {
|
|
668
|
+
const state = this.accessory.isConnected;
|
|
669
|
+
return state;
|
|
670
|
+
})
|
|
671
|
+
accessory.addService(this.inStandbyService);
|
|
672
|
+
}
|
|
673
|
+
|
|
659
674
|
//connect sensor
|
|
660
675
|
if (this.connectSensor && this.accessory.isConnected !== null) {
|
|
661
|
-
if (this.logDebug) this.emit('debug', `Prepare
|
|
676
|
+
if (this.logDebug) this.emit('debug', `Prepare connect service`);
|
|
662
677
|
this.connectService = new Service.ContactSensor(`${serviceName} Connected`, `connectService${deviceId}`);
|
|
663
678
|
this.connectService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
664
679
|
this.connectService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Connected`);
|
|
@@ -1233,6 +1248,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1233
1248
|
const supportHeatKey = accountTypeMelcloud ? 'ModelSupportsHeat' : 'HasHeatOperationMode';
|
|
1234
1249
|
const supportDryKey = accountTypeMelcloud ? 'ModelSupportsDry' : 'HasDryOperationMode';
|
|
1235
1250
|
const supportCoolKey = accountTypeMelcloud ? 'ModelSupportsCool' : 'HasCoolOperationMode';
|
|
1251
|
+
const supportStandbyKey = accountTypeMelcloud ? 'ModelSupportsStandbyMode' : 'HasStandby';
|
|
1236
1252
|
|
|
1237
1253
|
//presets schedules
|
|
1238
1254
|
const scheduleEnabled = deviceData.ScheduleEnabled;
|
|
@@ -1256,7 +1272,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1256
1272
|
const supportsAirDirectionFunction = deviceData.Device[supportAirDirectionKey];
|
|
1257
1273
|
const supportsSwingFunction = deviceData.Device[supportSwingKey];
|
|
1258
1274
|
const supportsWideVane = deviceData.Device[supportVideWaneKey];
|
|
1259
|
-
const supportsOutdoorTemperature = deviceData.Device.HasOutdoorTemperature
|
|
1275
|
+
const supportsOutdoorTemperature = deviceData.Device.HasOutdoorTemperature;
|
|
1260
1276
|
const supportsFanSpeed = accountTypeMelcloud ? deviceData.Device.ModelSupportsFanSpeed : deviceData.Device.NumberOfFanSpeeds > 0;
|
|
1261
1277
|
const supportsAuto1 = deviceData.Device[supportAutoKey];
|
|
1262
1278
|
const supportsAuto = this.autoDryFanMode >= 1 && supportsAuto1
|
|
@@ -1266,6 +1282,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1266
1282
|
const supportsCool1 = deviceData.Device[supportCoolKey];
|
|
1267
1283
|
const supportsCool = this.coolDryFanMode >= 1 && supportsCool1;
|
|
1268
1284
|
const numberOfFanSpeeds = supportsFanSpeed ? deviceData.Device.NumberOfFanSpeeds : 0;
|
|
1285
|
+
const supportsStanbyMode = deviceData.Device[supportStandbyKey];
|
|
1269
1286
|
const minTempHeat = 10;
|
|
1270
1287
|
const maxTempHeat = 31;
|
|
1271
1288
|
const minTempCoolDryAuto = 16;
|
|
@@ -1273,7 +1290,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1273
1290
|
|
|
1274
1291
|
//device state
|
|
1275
1292
|
const power = deviceData.Device.Power ?? false;
|
|
1276
|
-
const inStandbyMode = deviceData.Device.InStandbyMode
|
|
1293
|
+
const inStandbyMode = deviceData.Device.InStandbyMode;
|
|
1277
1294
|
const roomTemperature = deviceData.Device.RoomTemperature;
|
|
1278
1295
|
const setTemperature = deviceData.Device.SetTemperature;
|
|
1279
1296
|
const defaultHeatingSetTemperature = deviceData.Device.DefaultHeatingSetTemperature;
|
|
@@ -1309,6 +1326,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1309
1326
|
supportsHeat: supportsHeat,
|
|
1310
1327
|
supportsDry: supportsDry,
|
|
1311
1328
|
supportsCool: supportsCool,
|
|
1329
|
+
supportsStanbyMode: supportsStanbyMode,
|
|
1312
1330
|
minTempHeat: minTempHeat,
|
|
1313
1331
|
maxTempHeat: maxTempHeat,
|
|
1314
1332
|
minTempCoolDryAuto: minTempCoolDryAuto,
|
|
@@ -1480,9 +1498,10 @@ class DeviceAta extends EventEmitter {
|
|
|
1480
1498
|
};
|
|
1481
1499
|
this.accessory = obj;
|
|
1482
1500
|
|
|
1483
|
-
//
|
|
1501
|
+
//other sensors
|
|
1484
1502
|
this.roomTemperatureSensorService?.updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature);
|
|
1485
1503
|
this.outdoorTemperatureSensorService?.updateCharacteristic(Characteristic.CurrentTemperature, outdoorTemperature);
|
|
1504
|
+
this.inStandbyService?.updateCharacteristic(Characteristic.ContactSensorState, inStandbyMode);
|
|
1486
1505
|
this.connectService?.updateCharacteristic(Characteristic.ContactSensorState, isConnected);
|
|
1487
1506
|
this.errorService?.updateCharacteristic(Characteristic.ContactSensorState, isInError);
|
|
1488
1507
|
|
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.inStandbySensor = device.inStandbySensor || false;
|
|
40
41
|
this.connectSensor = device.connectSensor || false;
|
|
41
42
|
this.errorSensor = device.errorSensor || false;
|
|
42
43
|
this.holidayModeSupport = device.holidayModeSupport || false;
|
|
@@ -1069,9 +1070,22 @@ class DeviceAtw extends EventEmitter {
|
|
|
1069
1070
|
});
|
|
1070
1071
|
};
|
|
1071
1072
|
|
|
1073
|
+
if (this.inStandbySensor && this.accessory.inStandbyMode !== null) {
|
|
1074
|
+
if (this.logDebug) this.emit('debug', `Prepare in standby mode service`);
|
|
1075
|
+
this.inStandbyService = new Service.ContactSensor(`${serviceName} In Standby`, `inStandbyService${deviceId}`);
|
|
1076
|
+
this.inStandbyService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1077
|
+
this.inStandbyService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} In Standby`);
|
|
1078
|
+
this.inStandbyService.getCharacteristic(Characteristic.ContactSensorState)
|
|
1079
|
+
.onGet(async () => {
|
|
1080
|
+
const state = this.accessory.isConnected;
|
|
1081
|
+
return state;
|
|
1082
|
+
})
|
|
1083
|
+
accessory.addService(this.inStandbyService);
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1072
1086
|
//connect sensor
|
|
1073
1087
|
if (this.connectSensor && this.accessory.isConnected !== null) {
|
|
1074
|
-
if (this.logDebug) this.emit('debug', `Prepare
|
|
1088
|
+
if (this.logDebug) this.emit('debug', `Prepare connect service`);
|
|
1075
1089
|
this.connectService = new Service.ContactSensor(`${serviceName} Connected`, `connectService${deviceId}`);
|
|
1076
1090
|
this.connectService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1077
1091
|
this.connectService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Connected`);
|
|
@@ -1457,7 +1471,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1457
1471
|
try {
|
|
1458
1472
|
//melcloud device
|
|
1459
1473
|
this.melCloudAtw = new MelCloudAtw(this.account, this.device, this.devicesFile, this.defaultTempsFile)
|
|
1460
|
-
.on('deviceInfo', (manufacturer, modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion,
|
|
1474
|
+
.on('deviceInfo', (manufacturer, modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion, supportsHotWaterTank, supportsZone2) => {
|
|
1461
1475
|
if (this.logDeviceInfo && this.displayDeviceInfo) {
|
|
1462
1476
|
this.emit('devInfo', `---- ${this.deviceTypeText}: ${this.deviceName} ----`);
|
|
1463
1477
|
this.emit('devInfo', `Account: ${this.accountName}`);
|
|
@@ -1468,8 +1482,8 @@ class DeviceAtw extends EventEmitter {
|
|
|
1468
1482
|
this.emit('devInfo', `Manufacturer: ${manufacturer}`);
|
|
1469
1483
|
this.emit('devInfo', '----------------------------------');
|
|
1470
1484
|
this.emit('devInfo', `Zone 1: Yes`);
|
|
1471
|
-
this.emit('devInfo', `Hot Water Tank: ${
|
|
1472
|
-
this.emit('devInfo', `Zone 2: ${
|
|
1485
|
+
this.emit('devInfo', `Hot Water Tank: ${supportsHotWaterTank ? 'Yes' : 'No'}`);
|
|
1486
|
+
this.emit('devInfo', `Zone 2: ${supportsZone2 ? 'Yes' : 'No'}`);
|
|
1473
1487
|
this.emit('devInfo', '----------------------------------');
|
|
1474
1488
|
this.displayDeviceInfo = false;
|
|
1475
1489
|
}
|
|
@@ -1490,6 +1504,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1490
1504
|
const tempStepKey = this.accountType === 'melcloud' ? 'TemperatureIncrement' : 'HasHalfDegreeIncrements';
|
|
1491
1505
|
const connectKey = this.accountType === 'melcloud' ? 'Offline' : 'IsConnected';
|
|
1492
1506
|
const errorKey = this.accountType === 'melcloud' ? 'HasError' : 'IsInError';
|
|
1507
|
+
const supportStandbyKey = accountTypeMelcloud ? 'ModelSupportsStandbyMode' : 'HasStandby';
|
|
1493
1508
|
|
|
1494
1509
|
//presets schedule
|
|
1495
1510
|
const scheduleEnabled = deviceData.ScheduleEnabled;
|
|
@@ -1499,10 +1514,10 @@ class DeviceAtw extends EventEmitter {
|
|
|
1499
1514
|
const holidayModeActive = deviceData.HolidayMode?.Active ?? false;
|
|
1500
1515
|
|
|
1501
1516
|
//device info
|
|
1502
|
-
const
|
|
1503
|
-
const
|
|
1504
|
-
const
|
|
1505
|
-
const
|
|
1517
|
+
const supportsHeatPump = ![1, 2, 3, 4, 5, 6, 7, 15].includes(this.hideZone);
|
|
1518
|
+
const supportsZone1 = ![2, 3, 4, 8, 9, 10, 11, 15].includes(this.hideZone);
|
|
1519
|
+
const supportsHotWaterTank = ![3, 5, 6, 9, 10, 12, 13, 15].includes(this.hideZone) && deviceData.Device.HasHotWaterTank;
|
|
1520
|
+
const supportsZone2 = ![4, 6, 7, 10, 11, 13, 14, 15].includes(this.hideZone) && deviceData.Device.HasZone2;
|
|
1506
1521
|
const canHeat = deviceData.Device.CanHeat ?? false;
|
|
1507
1522
|
const canCool = deviceData.Device.CanCool ?? false;
|
|
1508
1523
|
const heatCoolModes = canHeat && canCool ? 0 : canHeat ? 1 : canCool ? 2 : 3;
|
|
@@ -1510,13 +1525,14 @@ class DeviceAtw extends EventEmitter {
|
|
|
1510
1525
|
const minSetTemperature = deviceData.Device.MinSetTemperature ?? 10;
|
|
1511
1526
|
const maxSetTemperature = deviceData.Device.MaxSetTemperature ?? 30;
|
|
1512
1527
|
const maxTankTemperature = deviceData.Device.MaxTankTemperature ?? 70;
|
|
1528
|
+
const supportsStanbyMode = deviceData.Device[supportStandbyKey];
|
|
1513
1529
|
|
|
1514
1530
|
//zones
|
|
1515
1531
|
let currentZoneCase = 0;
|
|
1516
|
-
const caseHeatPump =
|
|
1517
|
-
const caseZone1 =
|
|
1518
|
-
const caseHotWater =
|
|
1519
|
-
const caseZone2 =
|
|
1532
|
+
const caseHeatPump = supportsHeatPump ? currentZoneCase++ : -1;
|
|
1533
|
+
const caseZone1 = supportsZone1 ? currentZoneCase++ : -1;
|
|
1534
|
+
const caseHotWater = supportsHotWaterTank ? currentZoneCase++ : -1;
|
|
1535
|
+
const caseZone2 = supportsZone2 ? currentZoneCase++ : -1;
|
|
1520
1536
|
const zonesCount = currentZoneCase;
|
|
1521
1537
|
|
|
1522
1538
|
//zones sensors
|
|
@@ -1582,11 +1598,12 @@ class DeviceAtw extends EventEmitter {
|
|
|
1582
1598
|
idleZone1: idleZone1,
|
|
1583
1599
|
idleZone2: idleZone2,
|
|
1584
1600
|
temperatureIncrement: temperatureIncrement,
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1601
|
+
supportsHeatPump: supportsHeatPump,
|
|
1602
|
+
supportsZone1: supportsZone1,
|
|
1603
|
+
supportsHotWaterTank: supportsHotWaterTank,
|
|
1604
|
+
supportsZone2: supportsZone2,
|
|
1589
1605
|
heatCoolModes: heatCoolModes,
|
|
1606
|
+
supportsStanbyMode: supportsStanbyMode,
|
|
1590
1607
|
caseHeatPump: caseHeatPump,
|
|
1591
1608
|
caseZone1: caseZone1,
|
|
1592
1609
|
caseHotWater: caseHotWater,
|
|
@@ -1637,7 +1654,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1637
1654
|
roomTemperature = outdoorTemperature;
|
|
1638
1655
|
setTemperature = outdoorTemperature;
|
|
1639
1656
|
|
|
1640
|
-
lockPhysicalControl =
|
|
1657
|
+
lockPhysicalControl = supportsHotWaterTank && supportsZone2 ? (prohibitZone1 && prohibitHotWater && prohibitZone2 ? 1 : 0) : supportsHotWaterTank ? (prohibitZone1 && prohibitHotWater ? 1 : 0) : supportsZone2 ? (prohibitZone1 && prohibitZone2 ? 1 : 0) : 0;
|
|
1641
1658
|
operationModeSetPropsMinValue = [1, 1, 2, 0][heatCoolModes];
|
|
1642
1659
|
operationModeSetPropsMaxValue = [2, 1, 2, 0][heatCoolModes];
|
|
1643
1660
|
operationModeSetPropsValidValues = [[1, 2], [1], [2], [0]][heatCoolModes];
|
|
@@ -1981,7 +1998,8 @@ class DeviceAtw extends EventEmitter {
|
|
|
1981
1998
|
};
|
|
1982
1999
|
this.accessory = obj;
|
|
1983
2000
|
|
|
1984
|
-
//
|
|
2001
|
+
//other sensors
|
|
2002
|
+
this.inStandbyService?.updateCharacteristic(Characteristic.ContactSensorState, inStandbyMode);
|
|
1985
2003
|
this.connectService?.updateCharacteristic(Characteristic.ContactSensorState, isConnected);
|
|
1986
2004
|
this.errorService?.updateCharacteristic(Characteristic.ContactSensorState, isInError);
|
|
1987
2005
|
|
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.inStandbySensor = device.inStandbySensor || false;
|
|
33
34
|
this.connectSensor = device.connectSensor || false;
|
|
34
35
|
this.errorSensor = device.errorSensor || false;
|
|
35
36
|
this.holidayModeSupport = device.holidayModeSupport || false;
|
|
@@ -262,16 +263,16 @@ class DeviceErv extends EventEmitter {
|
|
|
262
263
|
const accountName = this.accountName;
|
|
263
264
|
const presetsOnServer = this.accessory.presets;
|
|
264
265
|
const schedulesOnServer = this.accessory.schedules;
|
|
265
|
-
const
|
|
266
|
-
const
|
|
267
|
-
const
|
|
268
|
-
const
|
|
269
|
-
const
|
|
270
|
-
const
|
|
271
|
-
const
|
|
272
|
-
const
|
|
273
|
-
const
|
|
274
|
-
const
|
|
266
|
+
const supportsRoomTemperature = this.accessory.supportsRoomTemperature;
|
|
267
|
+
const supportsSupplyTemperature = this.accessory.supportsSupplyTemperature;
|
|
268
|
+
const supportsOutdoorTemperature = this.accessory.supportsOutdoorTemperature;
|
|
269
|
+
const supportsCoolOperationMode = this.accessory.supportsCoolOperationMode;
|
|
270
|
+
const supportsHeatOperationMode = this.accessory.supportsHeatOperationMode;
|
|
271
|
+
const supportsAutoVentilationMode = this.accessory.supportsAutoVentilationMode;
|
|
272
|
+
const supportsBypassVentilationMode = this.accessory.supportsBypassVentilationMode;
|
|
273
|
+
const supportsAutomaticFanSpeed = this.accessory.supportsAutomaticFanSpeed;
|
|
274
|
+
const supportsCO2Sensor = this.accessory.supportsCO2Sensor;
|
|
275
|
+
const supportsPM25Sensor = this.accessory.supportsPM25Sensor;
|
|
275
276
|
const numberOfFanSpeeds = this.accessory.numberOfFanSpeeds;
|
|
276
277
|
|
|
277
278
|
//accessory
|
|
@@ -332,13 +333,13 @@ class DeviceErv extends EventEmitter {
|
|
|
332
333
|
try {
|
|
333
334
|
switch (value) {
|
|
334
335
|
case 0: //AUTO - AUTO
|
|
335
|
-
deviceData.Device.VentilationMode =
|
|
336
|
+
deviceData.Device.VentilationMode = supportsAutoVentilationMode ? 2 : 0;
|
|
336
337
|
break;
|
|
337
338
|
case 1: //HEAT - LOSSNAY
|
|
338
339
|
deviceData.Device.VentilationMode = 0;
|
|
339
340
|
break;
|
|
340
341
|
case 2: //COOL - BYPASS
|
|
341
|
-
deviceData.Device.VentilationMode =
|
|
342
|
+
deviceData.Device.VentilationMode = supportsBypassVentilationMode ? 1 : 0;
|
|
342
343
|
break;
|
|
343
344
|
};
|
|
344
345
|
|
|
@@ -368,16 +369,16 @@ class DeviceErv extends EventEmitter {
|
|
|
368
369
|
try {
|
|
369
370
|
switch (numberOfFanSpeeds) {
|
|
370
371
|
case 2: //Fan speed mode 2
|
|
371
|
-
value =
|
|
372
|
+
value = supportsAutomaticFanSpeed ? [0, 1, 2, 0][value] : [1, 1, 2][value];
|
|
372
373
|
break;
|
|
373
374
|
case 3: //Fan speed mode 3
|
|
374
|
-
value =
|
|
375
|
+
value = supportsAutomaticFanSpeed ? [0, 1, 2, 3, 0][value] : [1, 1, 2, 3][value];
|
|
375
376
|
break;
|
|
376
377
|
case 4: //Fan speed mode 4
|
|
377
|
-
value =
|
|
378
|
+
value = supportsAutomaticFanSpeed ? [0, 1, 2, 3, 4, 0][value] : [1, 1, 2, 3, 4][value];
|
|
378
379
|
break;
|
|
379
380
|
case 5: //Fan speed mode 5
|
|
380
|
-
value =
|
|
381
|
+
value = supportsAutomaticFanSpeed ? [0, 1, 2, 3, 4, 5, 0][value] : [1, 1, 2, 3, 4, 5][value];
|
|
381
382
|
break;;
|
|
382
383
|
};
|
|
383
384
|
|
|
@@ -389,7 +390,7 @@ class DeviceErv extends EventEmitter {
|
|
|
389
390
|
};
|
|
390
391
|
});
|
|
391
392
|
//device can cool
|
|
392
|
-
if (
|
|
393
|
+
if (supportsAutoVentilationMode && supportsCoolOperationMode) {
|
|
393
394
|
this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
|
|
394
395
|
.setProps({
|
|
395
396
|
minValue: this.accessory.minTempCoolDry,
|
|
@@ -411,7 +412,7 @@ class DeviceErv extends EventEmitter {
|
|
|
411
412
|
});
|
|
412
413
|
};
|
|
413
414
|
//device can heat
|
|
414
|
-
if (
|
|
415
|
+
if (supportsAutoVentilationMode && supportsHeatOperationMode) {
|
|
415
416
|
this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
|
|
416
417
|
.setProps({
|
|
417
418
|
minValue: this.accessory.minTempHeat,
|
|
@@ -501,12 +502,12 @@ class DeviceErv extends EventEmitter {
|
|
|
501
502
|
break;
|
|
502
503
|
case 2: //COOL - BYPASS
|
|
503
504
|
deviceData.Device.Power = true;
|
|
504
|
-
deviceData.Device.VentilationMode =
|
|
505
|
+
deviceData.Device.VentilationMode = supportsBypassVentilationMode ? 1 : 0;
|
|
505
506
|
effectiveFlags = Ventilation.EffectiveFlags.Power + Ventilation.EffectiveFlags.VentilationMode;
|
|
506
507
|
break;
|
|
507
508
|
case 3: //AUTO - AUTO
|
|
508
509
|
deviceData.Device.Power = true;
|
|
509
|
-
deviceData.Device.VentilationMode =
|
|
510
|
+
deviceData.Device.VentilationMode = supportsAutoVentilationMode ? 2 : 0;
|
|
510
511
|
effectiveFlags = Ventilation.EffectiveFlags.Power + Ventilation.EffectiveFlags.VentilationMode;
|
|
511
512
|
break;
|
|
512
513
|
};
|
|
@@ -564,7 +565,7 @@ class DeviceErv extends EventEmitter {
|
|
|
564
565
|
};
|
|
565
566
|
|
|
566
567
|
//temperature sensor service room
|
|
567
|
-
if (this.temperatureSensor &&
|
|
568
|
+
if (this.temperatureSensor && supportsRoomTemperature && this.accessory.roomTemperature !== null) {
|
|
568
569
|
if (this.logDebug) this.emit('debug', `Prepare room temperature sensor service`);
|
|
569
570
|
this.roomTemperatureSensorService = new Service.TemperatureSensor(`${serviceName} Room`, `Room Temperature Sensor ${deviceId}`);
|
|
570
571
|
this.roomTemperatureSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
@@ -583,7 +584,7 @@ class DeviceErv extends EventEmitter {
|
|
|
583
584
|
};
|
|
584
585
|
|
|
585
586
|
//temperature sensor service supply
|
|
586
|
-
if (this.temperatureSupplySensor &&
|
|
587
|
+
if (this.temperatureSupplySensor && supportsSupplyTemperature && this.accessory.supplyTemperature !== null) {
|
|
587
588
|
if (this.logDebug) this.emit('debug', `Prepare supply temperature sensor service`);
|
|
588
589
|
this.supplyTemperatureSensorService = new Service.TemperatureSensor(`${serviceName} Supply`, `Supply Temperature Sensor ${deviceId}`);
|
|
589
590
|
this.supplyTemperatureSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
@@ -602,7 +603,7 @@ class DeviceErv extends EventEmitter {
|
|
|
602
603
|
};
|
|
603
604
|
|
|
604
605
|
//temperature sensor service outdoor
|
|
605
|
-
if (this.temperatureOutdoorSensor &&
|
|
606
|
+
if (this.temperatureOutdoorSensor && supportsOutdoorTemperature && this.accessory.outdoorTemperature !== null) {
|
|
606
607
|
if (this.logDebug) this.emit('debug', `Prepare outdoor temperature sensor service`);
|
|
607
608
|
this.outdoorTemperatureSensorService = new Service.TemperatureSensor(`${serviceName} Outdoor`, `Outdoor Temperature Sensor ${deviceId}`);
|
|
608
609
|
this.outdoorTemperatureSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
@@ -653,7 +654,7 @@ class DeviceErv extends EventEmitter {
|
|
|
653
654
|
}
|
|
654
655
|
|
|
655
656
|
//room CO2 sensor
|
|
656
|
-
if (
|
|
657
|
+
if (supportsCO2Sensor) {
|
|
657
658
|
this.carbonDioxideSensorService = new Service.CarbonDioxideSensor(`${serviceName} CO2 Sensor`, `CO2Sensor ${deviceId}`);
|
|
658
659
|
this.carbonDioxideSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
659
660
|
this.carbonDioxideSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} CO2 Sensor`);
|
|
@@ -671,7 +672,7 @@ class DeviceErv extends EventEmitter {
|
|
|
671
672
|
}
|
|
672
673
|
|
|
673
674
|
//room PM2.5 sensor
|
|
674
|
-
if (
|
|
675
|
+
if (supportsPM25Sensor) {
|
|
675
676
|
this.airQualitySensorService = new Service.AirQualitySensor(`${serviceName} PM2.5 Sensor`, `PM25Sensor ${deviceId}`);
|
|
676
677
|
this.airQualitySensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
677
678
|
this.airQualitySensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} PM2.5 Sensor`);
|
|
@@ -688,9 +689,22 @@ class DeviceErv extends EventEmitter {
|
|
|
688
689
|
accessory.addService(this.airQualitySensorService);
|
|
689
690
|
}
|
|
690
691
|
|
|
692
|
+
if (this.inStandbySensor && this.accessory.inStandbyMode !== null) {
|
|
693
|
+
if (this.logDebug) this.emit('debug', `Prepare in standby mode service`);
|
|
694
|
+
this.inStandbyService = new Service.ContactSensor(`${serviceName} In Standby`, `inStandbyService${deviceId}`);
|
|
695
|
+
this.inStandbyService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
696
|
+
this.inStandbyService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} In Standby`);
|
|
697
|
+
this.inStandbyService.getCharacteristic(Characteristic.ContactSensorState)
|
|
698
|
+
.onGet(async () => {
|
|
699
|
+
const state = this.accessory.isConnected;
|
|
700
|
+
return state;
|
|
701
|
+
})
|
|
702
|
+
accessory.addService(this.inStandbyService);
|
|
703
|
+
}
|
|
704
|
+
|
|
691
705
|
//connect sensor
|
|
692
706
|
if (this.connectSensor && this.accessory.isConnected !== null) {
|
|
693
|
-
if (this.logDebug) this.emit('debug', `Prepare
|
|
707
|
+
if (this.logDebug) this.emit('debug', `Prepare connect service`);
|
|
694
708
|
this.connectService = new Service.ContactSensor(`${serviceName} Connected`, `connectService${deviceId}`);
|
|
695
709
|
this.connectService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
696
710
|
this.connectService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Connected`);
|
|
@@ -1035,6 +1049,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1035
1049
|
const tempStepKey = this.accountType === 'melcloud' ? 'TemperatureIncrement' : 'HasHalfDegreeIncrements';
|
|
1036
1050
|
const connectKey = this.accountType === 'melcloud' ? 'Offline' : 'IsConnected';
|
|
1037
1051
|
const errorKey = this.accountType === 'melcloud' ? 'HasError' : 'IsInError';
|
|
1052
|
+
const supportStandbyKey = accountTypeMelcloud ? 'ModelSupportsStandbyMode' : 'HasStandby';
|
|
1038
1053
|
|
|
1039
1054
|
//presets schedule
|
|
1040
1055
|
const scheduleEnabled = deviceData.ScheduleEnabled;
|
|
@@ -1049,22 +1064,23 @@ class DeviceErv extends EventEmitter {
|
|
|
1049
1064
|
const hideOutdoorTemperature = deviceData.HideOutdoorTemperature;
|
|
1050
1065
|
|
|
1051
1066
|
//device info
|
|
1052
|
-
const
|
|
1053
|
-
const
|
|
1054
|
-
const
|
|
1055
|
-
const
|
|
1056
|
-
const
|
|
1057
|
-
const
|
|
1058
|
-
const
|
|
1067
|
+
const supportsCoolOperationMode = deviceData.Device.HasCoolOperationMode ?? false;
|
|
1068
|
+
const supportsHeatOperationMode = deviceData.Device.HasHeatOperationMode ?? false;
|
|
1069
|
+
const supportsAutoOperationMode = deviceData.Device.HasAutoOperationMode ?? false;
|
|
1070
|
+
const supportsRoomTemperature = deviceData.Device.HasRoomTemperature ?? false;
|
|
1071
|
+
const supportsSupplyTemperature = deviceData.Device.HasSupplyTemperature ?? false;
|
|
1072
|
+
const supportsOutdoorTemperature = deviceData.Device.HasOutdoorTemperature ?? false;
|
|
1073
|
+
const supportsCO2Sensor = deviceData.Device.HasCO2Sensor ?? false;
|
|
1074
|
+
const supportsStanbyMode = deviceData.Device[supportStandbyKey];
|
|
1059
1075
|
const roomCO2Level = deviceData.Device.RoomCO2Level ?? false;
|
|
1060
|
-
const roomCO2Detected =
|
|
1061
|
-
const
|
|
1062
|
-
const pM25SensorStatus =
|
|
1063
|
-
const pM25Level =
|
|
1064
|
-
const pM25AirQuality =
|
|
1065
|
-
const
|
|
1066
|
-
const
|
|
1067
|
-
const
|
|
1076
|
+
const roomCO2Detected = supportsCO2Sensor && roomCO2Level > 1000 ? true : false;
|
|
1077
|
+
const supportsPM25Sensor = deviceData.Device.HasPM25Sensor ?? false;
|
|
1078
|
+
const pM25SensorStatus = supportsPM25Sensor ? deviceData.Device.PM25SensorStatus : 0;
|
|
1079
|
+
const pM25Level = supportsPM25Sensor ? deviceData.Device.PM25Level : 0;
|
|
1080
|
+
const pM25AirQuality = supportsPM25Sensor ? pM25Level <= 13 ? 1 : pM25Level <= 35 ? 2 : pM25Level <= 55 ? 3 : pM25Level <= 75 ? 4 : pM25Level <= 110 ? 5 : 0 : 0;
|
|
1081
|
+
const supportsAutoVentilationMode = deviceData.Device.HasAutoVentilationMode ?? false;
|
|
1082
|
+
const supportsBypassVentilationMode = deviceData.Device.HasBypassVentilationMode ?? false;
|
|
1083
|
+
const supportsAutomaticFanSpeed = deviceData.Device.HasAutomaticFanSpeed ?? false;
|
|
1068
1084
|
const coreMaintenanceRequired = deviceData.Device.CoreMaintenanceRequired;
|
|
1069
1085
|
const filterMaintenanceRequired = deviceData.Device.FilterMaintenanceRequired;
|
|
1070
1086
|
const actualVentilationMode = deviceData.Device.ActualVentilationMode;
|
|
@@ -1094,21 +1110,22 @@ class DeviceErv extends EventEmitter {
|
|
|
1094
1110
|
const obj = {
|
|
1095
1111
|
presets: presetsOnServer,
|
|
1096
1112
|
schedules: schedulesOnServer,
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1113
|
+
supportsRoomTemperature: supportsRoomTemperature,
|
|
1114
|
+
supportsSupplyTemperature: supportsSupplyTemperature,
|
|
1115
|
+
supportsOutdoorTemperature: supportsOutdoorTemperature,
|
|
1116
|
+
supportsCoolOperationMode: supportsCoolOperationMode,
|
|
1117
|
+
supportsHeatOperationMode: supportsHeatOperationMode,
|
|
1118
|
+
supportsCO2Sensor: supportsCO2Sensor,
|
|
1103
1119
|
roomCO2Level: roomCO2Level,
|
|
1104
1120
|
roomCO2Detected: roomCO2Detected,
|
|
1105
|
-
|
|
1121
|
+
supportsPM25Sensor: supportsPM25Sensor,
|
|
1106
1122
|
pM25SensorStatus: pM25SensorStatus,
|
|
1107
1123
|
pM25Level: pM25Level,
|
|
1108
1124
|
pM25AirQuality: pM25AirQuality,
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1125
|
+
supportsAutoVentilationMode: supportsAutoVentilationMode,
|
|
1126
|
+
supportsBypassVentilationMode: supportsBypassVentilationMode,
|
|
1127
|
+
supportsAutomaticFanSpeed: supportsAutomaticFanSpeed,
|
|
1128
|
+
supportsStanbyMode: supportsStanbyMode,
|
|
1112
1129
|
coreMaintenanceRequired: coreMaintenanceRequired,
|
|
1113
1130
|
filterMaintenanceRequired: filterMaintenanceRequired,
|
|
1114
1131
|
actualVentilationMode: actualVentilationMode,
|
|
@@ -1173,24 +1190,24 @@ class DeviceErv extends EventEmitter {
|
|
|
1173
1190
|
|
|
1174
1191
|
obj.currentOperationMode = !power ? 0 : obj.currentOperationMode;
|
|
1175
1192
|
obj.targetOperationMode = obj.targetOperationMode;
|
|
1176
|
-
obj.operationModeSetPropsMinValue =
|
|
1177
|
-
obj.operationModeSetPropsMaxValue =
|
|
1178
|
-
obj.operationModeSetPropsValidValues =
|
|
1193
|
+
obj.operationModeSetPropsMinValue = supportsAutoVentilationMode ? 0 : 1;
|
|
1194
|
+
obj.operationModeSetPropsMaxValue = supportsAutoVentilationMode ? 2 : 2;
|
|
1195
|
+
obj.operationModeSetPropsValidValues = supportsAutoVentilationMode ? (supportsBypassVentilationMode ? [0, 1, 2] : [0, 2]) : (supportsBypassVentilationMode ? [1, 2] : [2]);
|
|
1179
1196
|
|
|
1180
1197
|
//fan speed mode
|
|
1181
1198
|
obj.fanSpeedSetPropsMaxValue = 2;
|
|
1182
1199
|
switch (numberOfFanSpeeds) {
|
|
1183
1200
|
case 2: //Fan speed mode 2
|
|
1184
|
-
obj.fanSpeed =
|
|
1185
|
-
obj.fanSpeedSetPropsMaxValue =
|
|
1201
|
+
obj.fanSpeed = supportsAutomaticFanSpeed ? [3, 1, 2][setFanSpeed] : [0, 1, 2][setFanSpeed];
|
|
1202
|
+
obj.fanSpeedSetPropsMaxValue = supportsAutomaticFanSpeed ? 3 : 2;
|
|
1186
1203
|
break;
|
|
1187
1204
|
case 3: //Fan speed mode 3
|
|
1188
|
-
this.obj.fanSpeed =
|
|
1189
|
-
obj.fanSpeedSetPropsMaxValue =
|
|
1205
|
+
this.obj.fanSpeed = supportsAutomaticFanSpeed ? [4, 1, 2, 3][setFanSpeed] : [0, 1, 2, 3][setFanSpeed];
|
|
1206
|
+
obj.fanSpeedSetPropsMaxValue = supportsAutomaticFanSpeed ? 4 : 3;
|
|
1190
1207
|
break;
|
|
1191
1208
|
case 4: //Fan speed mode 4
|
|
1192
|
-
obj.fanSpeed =
|
|
1193
|
-
obj.fanSpeedSetPropsMaxValue =
|
|
1209
|
+
obj.fanSpeed = supportsAutomaticFanSpeed ? [5, 1, 2, 3, 4][setFanSpeed] : [0, 1, 2, 3, 4][setFanSpeed];
|
|
1210
|
+
obj.fanSpeedSetPropsMaxValue = supportsAutomaticFanSpeed ? 5 : 4;
|
|
1194
1211
|
break;
|
|
1195
1212
|
};
|
|
1196
1213
|
|
|
@@ -1203,8 +1220,8 @@ class DeviceErv extends EventEmitter {
|
|
|
1203
1220
|
.updateCharacteristic(Characteristic.RotationSpeed, obj.fanSpeed)
|
|
1204
1221
|
.updateCharacteristic(Characteristic.LockPhysicalControls, obj.lockPhysicalControl)
|
|
1205
1222
|
.updateCharacteristic(Characteristic.TemperatureDisplayUnits, obj.useFahrenheit);
|
|
1206
|
-
const updateDefCool =
|
|
1207
|
-
const updateDefHeat =
|
|
1223
|
+
const updateDefCool = supportsCoolOperationMode ? this.melCloudService?.updateCharacteristic(Characteristic.CoolingThresholdTemperature, defaultCoolingSetTemperature) : false;
|
|
1224
|
+
const updateDefHeat = supportsHeatOperationMode ? this.melCloudService?.updateCharacteristic(Characteristic.HeatingThresholdTemperature, defaultHeatingSetTemperature) : false;
|
|
1208
1225
|
break;
|
|
1209
1226
|
case 2: //Thermostat
|
|
1210
1227
|
//operation mode - 0, HEAT, 2, COOL, 4, 5, 6, FAN, AUTO
|
|
@@ -1238,9 +1255,9 @@ class DeviceErv extends EventEmitter {
|
|
|
1238
1255
|
|
|
1239
1256
|
obj.currentOperationMode = !power ? 0 : obj.currentOperationMode;
|
|
1240
1257
|
obj.targetOperationMode = !power ? 0 : obj.targetOperationMode;
|
|
1241
|
-
obj.operationModeSetPropsMinValue =
|
|
1242
|
-
obj.operationModeSetPropsMaxValue =
|
|
1243
|
-
obj.operationModeSetPropsValidValues =
|
|
1258
|
+
obj.operationModeSetPropsMinValue = supportsAutoVentilationMode ? 0 : 0;
|
|
1259
|
+
obj.operationModeSetPropsMaxValue = supportsAutoVentilationMode ? 3 : 2;
|
|
1260
|
+
obj.operationModeSetPropsValidValues = supportsAutoVentilationMode ? (supportsBypassVentilationMode ? [0, 1, 2, 3] : [0, 2, 3]) : (supportsBypassVentilationMode ? [0, 1, 2] : [0, 2]);
|
|
1244
1261
|
|
|
1245
1262
|
//update characteristics
|
|
1246
1263
|
this.melCloudService
|
|
@@ -1274,7 +1291,8 @@ class DeviceErv extends EventEmitter {
|
|
|
1274
1291
|
?.updateCharacteristic(Characteristic.AirQuality, pM25AirQuality)
|
|
1275
1292
|
.updateCharacteristic(Characteristic.PM2_5Density, pM25Level);
|
|
1276
1293
|
|
|
1277
|
-
//
|
|
1294
|
+
//other sensors
|
|
1295
|
+
this.inStandbyService?.updateCharacteristic(Characteristic.ContactSensorState, inStandbyMode);
|
|
1278
1296
|
this.connectService?.updateCharacteristic(Characteristic.ContactSensorState, isConnected);
|
|
1279
1297
|
this.errorService?.updateCharacteristic(Characteristic.ContactSensorState, isInError);
|
|
1280
1298
|
|
|
@@ -1381,16 +1399,16 @@ class DeviceErv extends EventEmitter {
|
|
|
1381
1399
|
this.emit('info', `Current ventilation mode: ${Ventilation.OperationModeMapEnumToString[actualVentilationMode]}`);
|
|
1382
1400
|
this.emit('info', `Target temperature: ${setTemperature}${obj.temperatureUnit}`);
|
|
1383
1401
|
this.emit('info', `Room temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1384
|
-
if (
|
|
1385
|
-
if (
|
|
1402
|
+
if (supportsSupplyTemperature && deviceData.Device.SupplyTemperature !== null) this.emit('info', `Supply temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1403
|
+
if (supportsOutdoorTemperature && deviceData.Device.OutdoorTemperature !== null) this.emit('info', `Outdoor temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1386
1404
|
this.emit('info', `Fan speed mode: ${Ventilation.FanSpeedMapEnumToString[setFanSpeed]}`);
|
|
1387
1405
|
this.emit('info', `Temperature display unit: ${obj.temperatureUnit}`);
|
|
1388
1406
|
this.emit('info', `Core maintenance: ${Ventilation.CoreMaintenanceMapEnumToString[coreMaintenanceRequired]}`);
|
|
1389
1407
|
this.emit('info', `Filter maintenance: ${Ventilation.FilterMaintenanceMapEnumToString[filterMaintenanceRequired]}`);
|
|
1390
|
-
if (
|
|
1391
|
-
if (
|
|
1392
|
-
if (
|
|
1393
|
-
if (
|
|
1408
|
+
if (supportsCO2Sensor) this.emit('info', `CO2 detected: ${Ventilation.Co2DetectedMapEnumToString[roomCO2Detected]}`);
|
|
1409
|
+
if (supportsCO2Sensor) this.emit('info', `CO2 level: ${roomCO2Level} ppm`);
|
|
1410
|
+
if (supportsPM25Sensor) this.emit('info', `PM2.5 air quality: ${Ventilation.PM25AirQualityMapEnumToString[pM25AirQuality]}`);
|
|
1411
|
+
if (supportsPM25Sensor) this.emit('info', `PM2.5 level: ${pM25Level} µg/m`);
|
|
1394
1412
|
};
|
|
1395
1413
|
})
|
|
1396
1414
|
.on('success', (success) => this.emit('success', success))
|