homebridge-melcloud-control 4.4.1-beta.30 → 4.4.1-beta.31

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/README.md CHANGED
@@ -22,24 +22,25 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
22
22
  | Package | Installation | Role | Required |
23
23
  | --- | --- | --- | --- |
24
24
  | [Homebridge v2.0.0](https://github.com/homebridge/homebridge) | [Homebridge Wiki](https://github.com/homebridge/homebridge/wiki) | HomeKit Bridge | Required |
25
- | [Homebridge UI <= v5.5.0](https://github.com/homebridge/homebridge-config-ui-x) | [Homebridge UI Wiki](https://github.com/homebridge/homebridge-config-ui-x/wiki) | Homebridge Web User Interface | Required |
26
- | [MELCloud](https://github.com/grzegorz914/homebridge-melcloud-control) | [Plug-In Wiki](https://github.com/grzegorz914/homebridge-melcloud-control/wiki) | Homebridge Plug-In | Required |
25
+ | [Homebridge UI <= v5.5.0](https://github.com/homebridge/homebridge-config-ui-x) | [Homebridge UI Wiki](https://github.com/homebridge/homebridge-config-ui-x/wiki) | Homebridge User Interface | Required |
26
+ | [MELCloud](https://github.com/grzegorz914/homebridge-melcloud-control) | [Plug-In Wiki](https://github.com/grzegorz914/homebridge-melcloud-control/wiki) | Plug-In | Required |
27
27
 
28
28
  ### About The Plugin
29
29
 
30
- * Support devices connected to MELCloud or MELCloud Home.
31
- * Support multiple accounts, buildings, floors, areas.
32
- * Support temperature display units `Celsius/Fahrenheit`.
33
- * Support assing inividual operating mode for `Heat/Cool/Auto`.
34
- * Support direct `Presets`, only MELCloud.
35
- * Support direct `Schedules`, only MELCloud Home.
36
- * Support direct `Scenes`, only MELCloud Home.
37
- * Support direct `Frost protection`, only MELCloud Home.
38
- * Support direct `Overheat Protection`, only MELCloud Home.
39
- * Support direct `Holiday Mode`, only MELCloud Home.
40
- * Support direct `Functions`, using extra `Buttons`, switch it to `OFF` restore previous device state.
41
- * Support automations, shortcuts and Siri.
42
- * Support external integrations, [RESTFul](https://github.com/grzegorz914/homebridge-melcloud-control?tab=readme-ov-file#restful-integration), [MQTT](https://github.com/grzegorz914/homebridge-melcloud-control?tab=readme-ov-file#mqtt-integration).
30
+ * Support:
31
+ * Devices connected to MELCloud or MELCloud Home.
32
+ * Multiple accounts, buildings, floors, areas.
33
+ * Temperature display units `Celsius/Fahrenheit`.
34
+ * Assing individual operating mode for `Heat/Cool/Auto`.
35
+ * Presets, only MELCloud.
36
+ * Scenes, only MELCloud Home.
37
+ * Frost protection, only MELCloud Home.
38
+ * Overheat Protection, only MELCloud Home.
39
+ * Holiday Mode, only MELCloud Home.
40
+ * Physical lock controls `LOCK/UNLOCK`, only MELCloud.
41
+ * Functions, using extra `Buttons`, switch to `OFF` restore previous state.
42
+ * Automations, shortcuts and Siri.
43
+ * External integrations, [RESTFul](https://github.com/grzegorz914/homebridge-melcloud-control?tab=readme-ov-file#restful-integration), [MQTT](https://github.com/grzegorz914/homebridge-melcloud-control?tab=readme-ov-file#mqtt-integration).
43
44
  * Control devices over local network You need use ESP module and [Tasmota Control](https://github.com/grzegorz914/homebridge-tasmota-control) plugin.
44
45
 
45
46
  ### Control Mode
@@ -58,16 +59,15 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
58
59
  * Operating mode `POWER OFF/HEAT/COOL/AUTO`.
59
60
  * Temperature `HEATING/COOLING/AUTO`.
60
61
  * Temperature display unit `°F/°C`.
61
- * Assign operating mode for `HEAT/AUTO`
62
62
  * Buttons:
63
63
  * For direct device control.
64
64
  * Power `ON/OFF`.
65
65
  * Operating mode `HEAT/DRY/COOL/FAN/AUTO`.
66
- * Physical lock controls `LOCK/UNLOCK`.
66
+ * Physical lock controls `LOCK/UNLOCK`
67
67
  * Vane H mode `AUTO/1/2/3/4/5/SPLIT/SWING`.
68
68
  * Vane V mode `AUTO/1/2/3/4/5/SWING`.
69
69
  * Fan speed mode `AUTO/1/2/3/4/5`.
70
- * Presets `SET/UNSET`.
70
+ * Preset `SET/UNSET`
71
71
  * Frost protection `ON/OFF/MINTEMP/MAXTEMP`.
72
72
  * Overheat protection `ON/OFF/MINTEMP/MAXTEMP`.
73
73
  * Holiday mode `ON/OFF`.
@@ -81,7 +81,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
81
81
  * Vane H mode `AUTO/1/2/3/4/5/SPLIT/SWING`.
82
82
  * Vane V mode `AUTO/1/2/3/4/5/SWING`.
83
83
  * Fan speed mode `AUTO/1/2/3/4/5/`.
84
- * Presets `ACTIV/UNACTIV`.
84
+ * Preset `ACTIV/UNACTIV`.
85
85
  * Room temperature.
86
86
  * Outdoor temperature.
87
87
  * Frost protection.
@@ -128,7 +128,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
128
128
  * Power `ON/OFF`.
129
129
  * Operating mode `HEAT/COOL/CURVE/HOLIDAY/AUTO HOT WATER/ECO HOT WATER/FORCE HOT WATER`.
130
130
  * Physical lock controls `LOCK/UNLOCK`.
131
- * Presets `SET/UNSET`.
131
+ * Preset `SET/UNSET`.
132
132
  * Frost protection `ON/OFF/MINTEMP/MAXTEMP`.
133
133
  * Holiday mode `ON/OFF`.
134
134
  * Schedules `ON/OFF`.
@@ -138,7 +138,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
138
138
  * Power `ON/OFF`.
139
139
  * Operating mode `HEAT/COOL/CURVE/HOLIDAY/AUTO HOT WATER/ECO HOT WATER/FORCE HOT WATER`.
140
140
  * Physical lock controls `LOCK/UNLOCK`.
141
- * Presets `ACTIV/UNACTIV`.
141
+ * Preset `ACTIV/UNACTIV`.
142
142
  * Outdoor temperature.
143
143
  * Zone 1 temperature.
144
144
  * Zone 2 temperature.
@@ -168,7 +168,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
168
168
  * Power `ON/OFF`.
169
169
  * Operating mode `LOSSNAY/BYPASS/AUTO/NIGHT PURGE`.
170
170
  * Fan speed mode `AUTO/1/2/3/4`.
171
- * Presets `SET/UNSET`.
171
+ * Preset `SET/UNSET`.
172
172
  * Holiday mode `ON/OFF`.
173
173
  * Schedules `ON/OFF`.
174
174
  * Scene `ON/OFF`.
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.30",
4
+ "version": "4.4.1-beta.31",
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
@@ -693,7 +693,7 @@ class DeviceAta extends EventEmitter {
693
693
  }
694
694
 
695
695
  //frost protection
696
- if (this.frostProtectionSupport && this.accessory.frostProtection.Enabled !== null) {
696
+ if (supportsHeat && this.frostProtectionSupport && this.accessory.frostProtection.Enabled !== null) {
697
697
  //control
698
698
  if (this.logDebug) this.emit('debug', `Prepare frost protection control service`);
699
699
  const frostProtectionControlService = new Service.HeaterCooler(`${serviceName} Frost Protection`, `frostProtectionControlService${deviceId}`);
@@ -1610,6 +1610,7 @@ class DeviceAta extends EventEmitter {
1610
1610
 
1611
1611
  //characteristics array
1612
1612
  const characteristics = [];
1613
+ const operationModevalidValues = [];
1613
1614
 
1614
1615
  //operating mode 0, HEAT, DRY, COOL, 4, 5, 6, FAN, AUTO, ISEE HEAT, ISEE DRY, ISEE COOL
1615
1616
  switch (this.displayType) {
@@ -1655,11 +1656,15 @@ class DeviceAta extends EventEmitter {
1655
1656
  default:
1656
1657
  if (this.logWarn) this.emit('warn', `Unknown operating mode: ${operationMode}`);
1657
1658
  }
1658
-
1659
1659
  obj.currentOperationMode = !power ? 0 : (inStandbyMode ? 1 : obj.currentOperationMode);
1660
- obj.operationModeSetPropsMinValue = supportsAuto && supportsHeat ? 0 : !supportsAuto && supportsHeat ? 1 : supportsAuto && !supportsHeat ? 0 : 2;
1661
- obj.operationModeSetPropsMaxValue = 2
1662
- obj.operationModeSetPropsValidValues = supportsAuto && supportsHeat ? [0, 1, 2] : !supportsAuto && supportsHeat ? [1, 2] : supportsAuto && !supportsHeat ? [0, 2] : [2];
1660
+
1661
+ if (supportsAuto) operationModevalidValues.push(0);
1662
+ if (supportsHeat) operationModevalidValues.push(1);
1663
+ if (supportsCool) operationModevalidValues.push(2);
1664
+
1665
+ obj.operationModeSetPropsMinValue = operationModevalidValues[0];
1666
+ obj.operationModeSetPropsMaxValue = operationModevalidValues.at(-1);
1667
+ obj.operationModeSetPropsValidValues = operationModevalidValues;
1663
1668
 
1664
1669
  //fan speed mode
1665
1670
  if (supportsFanSpeed) {
@@ -1736,9 +1741,15 @@ class DeviceAta extends EventEmitter {
1736
1741
 
1737
1742
  obj.currentOperationMode = !power ? 0 : obj.currentOperationMode;
1738
1743
  obj.targetOperationMode = !power ? 0 : obj.targetOperationMode;
1739
- obj.operationModeSetPropsMinValue = 0
1740
- obj.operationModeSetPropsMaxValue = supportsAuto && supportsHeat ? 3 : !supportsAuto && supportsHeat ? 2 : supportsAuto && !supportsHeat ? 3 : 2;
1741
- obj.operationModeSetPropsValidValues = supportsAuto && supportsHeat ? [0, 1, 2, 3] : !supportsAuto && supportsHeat ? [0, 1, 2] : supportsAuto && !supportsHeat ? [0, 2, 3] : [0, 2];
1744
+
1745
+ operationModevalidValues.push(0);
1746
+ if (supportsHeat) operationModevalidValues.push(1);
1747
+ if (supportsCool) operationModevalidValues.push(2);
1748
+ if (supportsAuto) operationModevalidValues.push(3);
1749
+
1750
+ obj.operationModeSetPropsMinValue = operationModevalidValues[0];
1751
+ obj.operationModeSetPropsMaxValue = operationModevalidValues.at(-1);
1752
+ obj.operationModeSetPropsValidValues = operationModevalidValues;
1742
1753
 
1743
1754
  //create characteristics
1744
1755
  characteristics.push(
package/src/deviceerv.js CHANGED
@@ -1257,43 +1257,44 @@ class DeviceErv extends EventEmitter {
1257
1257
 
1258
1258
  //characteristics array
1259
1259
  const characteristics = [];
1260
+ const operationModevalidValues = [];
1260
1261
 
1261
1262
  //ventilation mode - 0, HEAT, 2, COOL, 4, 5, 6, FAN, AUTO
1262
1263
  switch (this.displayType) {
1263
1264
  case 1: //Heater Cooler
1264
1265
  switch (ventilationMode) {
1265
- case 0: //LOSSNAY
1266
- obj.currentOperationMode = 2; //INACTIVE, IDLE, HEATING, COOLIN
1267
- obj.targetOperationMode = 1; //AUTO, HEAT, COOL
1266
+ case 0: // LOSSNAY
1267
+ obj.currentOperationMode = 2; // heating
1268
+ obj.targetOperationMode = 1; // heat
1268
1269
  break;
1269
- case 1: //BYPASS
1270
- obj.currentOperationMode = 3;
1271
- obj.targetOperationMode = 2;
1270
+ case 1: // BYPASS
1271
+ obj.currentOperationMode = 3; // cooling
1272
+ obj.targetOperationMode = 2; // cool
1272
1273
  break;
1273
- case 2: //AUTO
1274
- switch (actualVentilationMode) {
1275
- case 0: //LOSSNAY
1276
- obj.currentOperationMode = 2;
1277
- break;
1278
- case 1: //BYPASS
1279
- obj.currentOperationMode = 3;
1280
- break;
1281
- default:
1282
- if (this.logWarn) this.emit('warn', `Unknown actual ventilation mode: ${actualVentilationMode}`);
1283
- break;
1284
- };
1285
- obj.targetOperationMode = 0;
1274
+ case 2: // AUTO
1275
+ if (actualVentilationMode === 0) {
1276
+ obj.currentOperationMode = 2; // heating
1277
+ } else if (actualVentilationMode === 1) {
1278
+ obj.currentOperationMode = 3; // cooling
1279
+ } else if (this.logWarn) this.emit('warn', `Unknown actual ventilation mode: ${actualVentilationMode}`);
1280
+
1281
+ obj.targetOperationMode = 0; // auto
1286
1282
  break;
1287
1283
  default:
1288
1284
  if (this.logWarn) this.emit('warn', `Unknown ventilation mode: ${ventilationMode}`);
1289
1285
  break;
1290
- };
1286
+ }
1287
+
1288
+ // power override
1289
+ if (!power) obj.currentOperationMode = 0; // inactive
1291
1290
 
1292
- obj.currentOperationMode = !power ? 0 : obj.currentOperationMode;
1293
- obj.targetOperationMode = obj.targetOperationMode;
1294
- obj.operationModeSetPropsMinValue = supportsAutoVentilationMode ? 0 : 1;
1295
- obj.operationModeSetPropsMaxValue = supportsAutoVentilationMode ? 2 : 2;
1296
- obj.operationModeSetPropsValidValues = supportsAutoVentilationMode ? (supportsBypassVentilationMode ? [0, 1, 2] : [0, 2]) : (supportsBypassVentilationMode ? [1, 2] : [2]);
1291
+ if (supportsAutoVentilationMode) operationModevalidValues.push(0);
1292
+ if (supportsBypassVentilationMode) operationModevalidValues.push(1);
1293
+ operationModevalidValues.push(2); // manual zawsze dostępny
1294
+
1295
+ obj.operationModeSetPropsMinValue = operationModevalidValues[0];
1296
+ obj.operationModeSetPropsMaxValue = operationModevalidValues.at(-1);
1297
+ obj.operationModeSetPropsValidValues = operationModevalidValues;
1297
1298
 
1298
1299
  //fan speed mode
1299
1300
  obj.fanSpeedSetPropsMaxValue = 2;
@@ -1330,38 +1331,42 @@ class DeviceErv extends EventEmitter {
1330
1331
  case 2: //Thermostat
1331
1332
  //operation mode - 0, HEAT, 2, COOL, 4, 5, 6, FAN, AUTO
1332
1333
  switch (ventilationMode) {
1333
- case 0: //LOSSNAY
1334
- obj.currentOperationMode = 1; //OFF, HEAT, COOL
1335
- obj.targetOperationMode = 1; //OFF, HEAT, COOL, AUTO
1334
+ case 0: // LOSSNAY
1335
+ obj.currentOperationMode = 1; // HEAT
1336
+ obj.targetOperationMode = 1; // HEAT
1336
1337
  break;
1337
- case 1: //BYPASS
1338
- obj.currentOperationMode = 2;
1339
- obj.targetOperationMode = 2;
1338
+ case 1: // BYPASS
1339
+ obj.currentOperationMode = 2; // COOL
1340
+ obj.targetOperationMode = 2; // COOL
1340
1341
  break;
1341
- case 2: //AUTO
1342
- switch (actualVentilationMode) {
1343
- case 0: //LOSSNAY
1344
- obj.currentOperationMode = 1;
1345
- break;
1346
- case 1: //BYPASS
1347
- obj.currentOperationMode = 2;
1348
- break;
1349
- default:
1350
- if (this.logWarn) this.emit('warn', `Unknown actual ventilation mode: ${actualVentilationMode}`);
1351
- break;
1352
- };
1353
- obj.targetOperationMode = 3;
1342
+ case 2: // AUTO
1343
+ if (actualVentilationMode === 0) {
1344
+ obj.currentOperationMode = 1; // HEAT
1345
+ } else if (actualVentilationMode === 1) {
1346
+ obj.currentOperationMode = 2; // COOL
1347
+ } else if (this.logWarn) this.emit('warn', `Unknown actual ventilation mode: ${actualVentilationMode}`);
1348
+
1349
+ obj.targetOperationMode = 3; // AUTO
1354
1350
  break;
1355
1351
  default:
1356
1352
  if (this.logWarn) this.emit('warn', `Unknown ventilation mode: ${ventilationMode}`);
1357
1353
  break;
1358
- };
1354
+ }
1355
+
1356
+ // power override (single source of truth)
1357
+ if (!power) {
1358
+ obj.currentOperationMode = 0;
1359
+ obj.targetOperationMode = 0;
1360
+ }
1361
+
1362
+ operationModevalidValues.push(0); // manual zawsze dostępny
1363
+ if (supportsBypassVentilationMode) operationModevalidValues.push(1);
1364
+ operationModevalidValues.push(2); // manual / normal
1365
+ if (supportsAutoVentilationMode) operationModevalidValues.push(3);
1359
1366
 
1360
- obj.currentOperationMode = !power ? 0 : obj.currentOperationMode;
1361
- obj.targetOperationMode = !power ? 0 : obj.targetOperationMode;
1362
- obj.operationModeSetPropsMinValue = supportsAutoVentilationMode ? 0 : 0;
1363
- obj.operationModeSetPropsMaxValue = supportsAutoVentilationMode ? 3 : 2;
1364
- obj.operationModeSetPropsValidValues = supportsAutoVentilationMode ? (supportsBypassVentilationMode ? [0, 1, 2, 3] : [0, 2, 3]) : (supportsBypassVentilationMode ? [0, 1, 2] : [0, 2]);
1367
+ obj.operationModeSetPropsMinValue = operationModevalidValues[0];
1368
+ obj.operationModeSetPropsMaxValue = operationModevalidValues.at(-1);
1369
+ obj.operationModeSetPropsValidValues = operationModevalidValues;
1365
1370
 
1366
1371
  //create characteristics
1367
1372
  characteristics.push(