homebridge-melcloud-control 3.2.4 → 3.3.0
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 +9 -0
- package/README.md +19 -5
- package/package.json +2 -2
- package/src/constants.json +6 -0
- package/src/deviceata.js +158 -98
- package/src/deviceatw.js +21 -21
- package/src/deviceerv.js +14 -15
- package/src/melcloudata.js +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -16,6 +16,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
16
16
|
- do not configure it manually, always using Config UI X
|
|
17
17
|
- required Homebridge v2.0.0 and above
|
|
18
18
|
|
|
19
|
+
## [3.3.0] - (12.09.2024)
|
|
20
|
+
|
|
21
|
+
## Changes
|
|
22
|
+
|
|
23
|
+
- added full support for AUTO mode with dead band, low and high temperature
|
|
24
|
+
- fix some log info message
|
|
25
|
+
- bump dependencies
|
|
26
|
+
- cleanup
|
|
27
|
+
|
|
19
28
|
## [3.2.0] - (11.09.2024)
|
|
20
29
|
|
|
21
30
|
## Changes
|
package/README.md
CHANGED
|
@@ -25,6 +25,13 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
25
25
|
| [Config UI X](https://github.com/homebridge/homebridge-config-ui-x) | [Config UI X Wiki](https://github.com/homebridge/homebridge-config-ui-x/wiki) | Homebridge Web User Interface | Required ab v3.0.0|
|
|
26
26
|
| [MELCloud](https://github.com/grzegorz914/homebridge-melcloud-control) | [Plug-In Wiki](https://github.com/grzegorz914/homebridge-melcloud-control/wiki) | Homebridge Plug-In | Required |
|
|
27
27
|
|
|
28
|
+
<p align="left">
|
|
29
|
+
<a href="https://github.com/grzegorz914/homebridge-melcloud-control"><img src="https://raw.githubusercontent.com/grzegorz914/homebridge-melcloud-control/main/graphics/homekit.png" width="375"></a>
|
|
30
|
+
<a href="https://github.com/grzegorz914/homebridge-melcloud-control"><img src="https://raw.githubusercontent.com/grzegorz914/homebridge-melcloud-control/main/graphics/settings.png" width="132"></a>
|
|
31
|
+
<a href="https://github.com/grzegorz914/homebridge-melcloud-control"><img src="https://raw.githubusercontent.com/grzegorz914/homebridge-melcloud-control/main/graphics/settings1.png" width="132"></a>
|
|
32
|
+
<a href="https://github.com/grzegorz914/homebridge-melcloud-control"><img src="https://raw.githubusercontent.com/grzegorz914/homebridge-melcloud-control/main/graphics/settings2.png" width="132"></a>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
28
35
|
### About The Plugin
|
|
29
36
|
|
|
30
37
|
* All devices are detected automatically.
|
|
@@ -43,7 +50,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
43
50
|
* Heater Cooler:
|
|
44
51
|
* Power `ON/OFF`.
|
|
45
52
|
* Operating mode `AUTO/HEAT/COOL/POWER OFF`.
|
|
46
|
-
* Temperature `HEATING/COOLING`.
|
|
53
|
+
* Temperature `HEATING/COOLING/AUTO`.
|
|
47
54
|
* Fan speed `OFF/1/2/3/4/5/AUTO`.
|
|
48
55
|
* Swing mode `AUTO/SWING`.
|
|
49
56
|
* Physical lock controls `LOCK/UNLOCK`.
|
|
@@ -51,7 +58,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
51
58
|
* Thermostat:
|
|
52
59
|
* Power `ON/OFF`.
|
|
53
60
|
* Operating mode `POWER OFF/HEAT/COOL/AUTO`.
|
|
54
|
-
* Temperature `HEATING/COOLING`.
|
|
61
|
+
* Temperature `HEATING/COOLING/AUTO`.
|
|
55
62
|
* Temperature display unit `°F/°C`.
|
|
56
63
|
* Assign operating mode for `HEAT/AUTO`
|
|
57
64
|
* Buttons:
|
|
@@ -152,10 +159,17 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
152
159
|
* CO2 detected and level.
|
|
153
160
|
* PM2.5 air quality and level.
|
|
154
161
|
|
|
162
|
+
### AUTO Mode
|
|
163
|
+
|
|
164
|
+
* If the room temperature `<` Heating Setpoint, the unit will be set to HEAT with a setpoint of 28°C.
|
|
165
|
+
* In HEAT, if the room temperature `>` Heating Setpoint `+` 1°C, the unit will be set to FAN.
|
|
166
|
+
* In FAN, if the room temperature `>` Cooling Setpoint, the unit will be set to COOL with a setpoint of 19°C.
|
|
167
|
+
* In COOL, if the room temperature `<` Cooling Setpoint `-` 1°C, the unit will be set to FAN.
|
|
168
|
+
* In FAN, if the room temperature `<` Heating Setpoint, the unit will be set to HEAT with a setpoint of 28°C.
|
|
169
|
+
* The image shows Heating Setpoint of 19°C and a Cooling Setpoint of 23°C.
|
|
170
|
+
|
|
155
171
|
<p align="center">
|
|
156
|
-
<a href="https://github.com/grzegorz914/homebridge-melcloud-control"><img src="https://raw.githubusercontent.com/grzegorz914/homebridge-melcloud-control/main/graphics/
|
|
157
|
-
<a href="https://github.com/grzegorz914/homebridge-melcloud-control"><img src="https://raw.githubusercontent.com/grzegorz914/homebridge-melcloud-control/main/graphics/settings.png" width="135"></a> <a href="https://github.com/grzegorz914/homebridge-melcloud-control"><img src="https://raw.githubusercontent.com/grzegorz914/homebridge-melcloud-control/main/graphics/settings1.png" width="135"></a>
|
|
158
|
-
<a href="https://github.com/grzegorz914/homebridge-melcloud-control"><img src="https://raw.githubusercontent.com/grzegorz914/homebridge-melcloud-control/main/graphics/settings2.png" width="135"></a>
|
|
172
|
+
<a href="https://github.com/grzegorz914/homebridge-melcloud-control"><img src="https://raw.githubusercontent.com/grzegorz914/homebridge-melcloud-control/main/graphics/auto.png" width="840"></a>
|
|
159
173
|
</p>
|
|
160
174
|
|
|
161
175
|
### Configuration
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.3.0",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@homebridge/plugin-ui-utils": "^1.0.3",
|
|
36
36
|
"async-mqtt": "^2.6.3",
|
|
37
37
|
"axios": "^1.7.7",
|
|
38
|
-
"express": "^4.
|
|
38
|
+
"express": "^4.21.0"
|
|
39
39
|
},
|
|
40
40
|
"keywords": [
|
|
41
41
|
"homebridge",
|
package/src/constants.json
CHANGED
package/src/deviceata.js
CHANGED
|
@@ -84,7 +84,7 @@ class DeviceAta extends EventEmitter {
|
|
|
84
84
|
button.serviceType = buttonServiceType;
|
|
85
85
|
button.characteristicType = buttonCharacteristicType;
|
|
86
86
|
button.state = false;
|
|
87
|
-
button.previousValue =
|
|
87
|
+
button.previousValue = null;
|
|
88
88
|
this.buttonsConfigured.push(button);
|
|
89
89
|
} else {
|
|
90
90
|
const log = buttonDisplayType === 0 ? false : this.emit('warn', `Button Name: ${buttonName ? buttonName : 'Missing'}, Mode: ${buttonMode ? buttonMode : 'Missing'}.`);
|
|
@@ -236,6 +236,8 @@ class DeviceAta extends EventEmitter {
|
|
|
236
236
|
const inStandbyMode = deviceData.Device.InStandbyMode ?? false;
|
|
237
237
|
const roomTemperature = deviceData.Device.RoomTemperature;
|
|
238
238
|
const setTemperature = deviceData.Device.SetTemperature;
|
|
239
|
+
const defaultHeatingSetTemperature = deviceData.Device.DefaultHeatingSetTemperature;
|
|
240
|
+
const defaultCoolingSetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
239
241
|
const fanSpeed = deviceData.Device.FanSpeed;
|
|
240
242
|
const operationMode = deviceData.Device.OperationMode;
|
|
241
243
|
const vaneHorizontalDirection = deviceData.Device.VaneHorizontalDirection;
|
|
@@ -253,6 +255,8 @@ class DeviceAta extends EventEmitter {
|
|
|
253
255
|
this.accessory.roomTemperature = roomTemperature;
|
|
254
256
|
this.accessory.outdoorTemperature = outdoorTemperature;
|
|
255
257
|
this.accessory.setTemperature = setTemperature;
|
|
258
|
+
this.accessory.defaultHeatingSetTemperature = defaultHeatingSetTemperature;
|
|
259
|
+
this.accessory.defaultCoolingSetTemperature = defaultCoolingSetTemperature;
|
|
256
260
|
this.accessory.fanSpeed = fanSpeed;
|
|
257
261
|
this.accessory.vaneHorizontal = vaneHorizontalDirection;
|
|
258
262
|
this.accessory.vaneVertical = vaneVerticalDirection;
|
|
@@ -266,6 +270,9 @@ class DeviceAta extends EventEmitter {
|
|
|
266
270
|
this.accessory.hasOutdoorTemperature = hasOutdoorTemperature;
|
|
267
271
|
this.accessory.swingFunction = swingFunction;
|
|
268
272
|
this.accessory.numberOfFanSpeeds = numberOfFanSpeeds;
|
|
273
|
+
this.accessory.modelSupportsHeat = modelSupportsHeat;
|
|
274
|
+
this.accessory.modelSupportsCool = modelSupportsCool;
|
|
275
|
+
this.accessory.modelSupportsAuto = modelSupportsAuto;
|
|
269
276
|
this.accessory.modelSupportsFanSpeed = modelSupportsFanSpeed;
|
|
270
277
|
this.accessory.modelSupportsDry = modelSupportsDry;
|
|
271
278
|
|
|
@@ -295,7 +302,7 @@ class DeviceAta extends EventEmitter {
|
|
|
295
302
|
this.accessory.targetOperationMode = 2;
|
|
296
303
|
break;
|
|
297
304
|
case 8: //AUTO
|
|
298
|
-
this.accessory.currentOperationMode =
|
|
305
|
+
this.accessory.currentOperationMode = roomTemperature >= defaultHeatingSetTemperature && roomTemperature <= defaultCoolingSetTemperature ? 1 : roomTemperature < defaultHeatingSetTemperature ? 2 : roomTemperature > defaultCoolingSetTemperature ? 3 : 0;
|
|
299
306
|
this.accessory.targetOperationMode = 0;
|
|
300
307
|
break;
|
|
301
308
|
case 9: //ISEE HEAT
|
|
@@ -311,8 +318,8 @@ class DeviceAta extends EventEmitter {
|
|
|
311
318
|
this.accessory.targetOperationMode = 2;
|
|
312
319
|
break;
|
|
313
320
|
default:
|
|
314
|
-
this.emit('warn', `
|
|
315
|
-
|
|
321
|
+
this.emit('warn', `Received unknown operating mode: ${operationMode}`);
|
|
322
|
+
return
|
|
316
323
|
};
|
|
317
324
|
break;
|
|
318
325
|
case false:
|
|
@@ -393,7 +400,7 @@ class DeviceAta extends EventEmitter {
|
|
|
393
400
|
this.accessory.targetOperationMode = 2;
|
|
394
401
|
break;
|
|
395
402
|
case 8: //AUTO
|
|
396
|
-
this.accessory.currentOperationMode =
|
|
403
|
+
this.accessory.currentOperationMode = roomTemperature >= defaultHeatingSetTemperature && roomTemperature <= defaultCoolingSetTemperature ? this.accessory.currentOperationMode : roomTemperature < defaultHeatingSetTemperature ? 1 : roomTemperature > defaultCoolingSetTemperature ? 2 : 0;
|
|
397
404
|
this.accessory.targetOperationMode = 3;
|
|
398
405
|
break;
|
|
399
406
|
case 9: //ISEE HEAT
|
|
@@ -462,7 +469,7 @@ class DeviceAta extends EventEmitter {
|
|
|
462
469
|
&& presetData.SetTemperature === setTemperature
|
|
463
470
|
&& presetData.OperationMode === operationMode
|
|
464
471
|
&& presetData.VaneHorizontal === vaneHorizontalDirection
|
|
465
|
-
&& presetData.VaneVertical ===
|
|
472
|
+
&& presetData.VaneVertical === vaneVerticalDirection
|
|
466
473
|
&& presetData.FanSpeed === fanSpeed) : false;
|
|
467
474
|
|
|
468
475
|
if (this.presetsServices) {
|
|
@@ -477,19 +484,20 @@ class DeviceAta extends EventEmitter {
|
|
|
477
484
|
if (this.buttonsConfiguredCount > 0) {
|
|
478
485
|
for (let i = 0; i < this.buttonsConfiguredCount; i++) {
|
|
479
486
|
const button = this.buttonsConfigured[i];
|
|
480
|
-
const mode =
|
|
487
|
+
const mode = button.mode;
|
|
488
|
+
let setPreviousValue = false;
|
|
481
489
|
switch (mode) {
|
|
482
490
|
case 0: //POWER ON,OFF
|
|
483
491
|
button.state = (power === true);
|
|
484
492
|
break;
|
|
485
493
|
case 1: //OPERATING MODE HEAT
|
|
486
|
-
button.state = power ? (operationMode === 1) : false;
|
|
494
|
+
button.state = power ? (operationMode === 1 || operationMode === 9) : false;
|
|
487
495
|
break;
|
|
488
496
|
case 2: //OPERATING MODE DRY
|
|
489
|
-
button.state = power ? (operationMode === 2) : false;
|
|
497
|
+
button.state = power ? (operationMode === 2 || operationMode === 10) : false;
|
|
490
498
|
break
|
|
491
499
|
case 3: //OPERATING MODE COOL
|
|
492
|
-
button.state = power ? (operationMode === 3) : false;
|
|
500
|
+
button.state = power ? (operationMode === 3 || operationMode === 11) : false;
|
|
493
501
|
break;
|
|
494
502
|
case 4: //OPERATING MODE FAN
|
|
495
503
|
button.state = power ? (operationMode === 7) : false;
|
|
@@ -498,7 +506,7 @@ class DeviceAta extends EventEmitter {
|
|
|
498
506
|
button.state = power ? (operationMode === 8) : false;
|
|
499
507
|
break;
|
|
500
508
|
case 6: //OPERATING MODE PURIFY
|
|
501
|
-
button.state = power ? (operationMode ===
|
|
509
|
+
button.state = power ? (operationMode === 12) : false;
|
|
502
510
|
break;
|
|
503
511
|
case 7: //OPERATING MODE DRY CONTROL HIDE
|
|
504
512
|
button.state = power ? (hideDryModeControl === true) : false;
|
|
@@ -528,25 +536,25 @@ class DeviceAta extends EventEmitter {
|
|
|
528
536
|
button.state = power ? (vaneHorizontalDirection === 12) : false;
|
|
529
537
|
break;
|
|
530
538
|
case 20: //VANE V SWING MODE AUTO
|
|
531
|
-
button.state = power ? (
|
|
539
|
+
button.state = power ? (vaneVerticalDirection === 0) : false;
|
|
532
540
|
break;
|
|
533
541
|
case 21: //VANE V SWING MODE 1
|
|
534
|
-
button.state = power ? (
|
|
542
|
+
button.state = power ? (vaneVerticalDirection === 1) : false;
|
|
535
543
|
break;
|
|
536
544
|
case 22: //VANE V SWING MODE 2
|
|
537
|
-
button.state = power ? (
|
|
545
|
+
button.state = power ? (vaneVerticalDirection === 2) : false;
|
|
538
546
|
break;
|
|
539
547
|
case 23: //VANE V SWING MODE 3
|
|
540
|
-
button.state = power ? (
|
|
548
|
+
button.state = power ? (vaneVerticalDirection === 3) : false;
|
|
541
549
|
break;
|
|
542
550
|
case 24: //VANE V SWING MODE 4
|
|
543
|
-
button.state = power ? (
|
|
551
|
+
button.state = power ? (vaneVerticalDirection === 4) : false;
|
|
544
552
|
break;
|
|
545
553
|
case 25: //VANE V SWING MODE 5
|
|
546
|
-
button.state = power ? (
|
|
554
|
+
button.state = power ? (vaneVerticalDirection === 5) : false;
|
|
547
555
|
break;
|
|
548
556
|
case 26: //VANE V SWING MODE SWING
|
|
549
|
-
button.state = power ? (
|
|
557
|
+
button.state = power ? (vaneVerticalDirection === 7) : false;
|
|
550
558
|
break;
|
|
551
559
|
case 27: //VANE H/V CONTROLS HIDE
|
|
552
560
|
button.state = power ? (hideVaneControls === true) : false;
|
|
@@ -600,16 +608,17 @@ class DeviceAta extends EventEmitter {
|
|
|
600
608
|
|
|
601
609
|
//log current state
|
|
602
610
|
if (!this.disableLogInfo) {
|
|
603
|
-
const operationModeText = !power ? CONSTANTS.AirConditioner.System[0] : CONSTANTS.AirConditioner.DriveMode[operationMode];
|
|
604
611
|
this.emit('message', `Power: ${power ? 'ON' : 'OFF'}`);
|
|
605
|
-
this.emit('message', `Operation mode: ${
|
|
612
|
+
this.emit('message', `Operation mode: ${CONSTANTS.AirConditioner.DriveMode[operationMode]}`);
|
|
606
613
|
this.emit('message', `Room temperature: ${roomTemperature}${temperatureUnit}`);
|
|
607
|
-
this.emit('message', `
|
|
608
|
-
const info0 =
|
|
609
|
-
const info1 =
|
|
610
|
-
const info2 =
|
|
614
|
+
const info = hasOutdoorTemperature && this.accessory.outdoorTemperature !== null ? this.emit('message', `Outdoor temperature: ${outdoorTemperature}${temperatureUnit}`) : false;
|
|
615
|
+
const info0 = operationMode !== 8 ? this.emit('message', `Target temperature: ${setTemperature}${temperatureUnit}`) : false;
|
|
616
|
+
const info1 = operationMode === 8 && modelSupportsAuto && modelSupportsHeat ? this.emit('message', `Heating threshold temperature: ${defaultHeatingSetTemperature}${temperatureUnit}`) : false;
|
|
617
|
+
const info2 = operationMode === 8 && modelSupportsAuto && modelSupportsCool ? this.emit('message', `Cooling threshold temperature: ${defaultCoolingSetTemperature}${temperatureUnit}`) : false;
|
|
611
618
|
const info3 = modelSupportsFanSpeed ? this.emit('message', `Fan speed mode: ${CONSTANTS.AirConditioner.FanSpeed[fanSpeed]}`) : false;
|
|
612
|
-
const info4 =
|
|
619
|
+
const info4 = vaneHorizontalDirection !== null ? this.emit('message', `Vane horizontal: ${CONSTANTS.AirConditioner.HorizontalVane[vaneHorizontalDirection]}`) : false;
|
|
620
|
+
const info5 = vaneVerticalDirection !== null ? this.emit('message', `Vane vertical: ${CONSTANTS.AirConditioner.VerticalVane[vaneVerticalDirection]}`) : false;
|
|
621
|
+
const info6 = swingFunction ? this.emit('message', `Vane swing mode: ${CONSTANTS.AirConditioner.AirDirection[this.accessory.swingMode ? 6 : 0]}`) : false;
|
|
613
622
|
this.emit('message', `Temperature display unit: ${temperatureUnit}`);
|
|
614
623
|
this.emit('message', `Lock physical controls: ${this.accessory.lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
|
|
615
624
|
};
|
|
@@ -754,6 +763,9 @@ class DeviceAta extends EventEmitter {
|
|
|
754
763
|
const temperatureSensor = this.temperatureSensor;
|
|
755
764
|
const temperatureSensorOutdoor = this.temperatureSensorOutdoor;
|
|
756
765
|
const hasAutomaticFanSpeed = this.accessory.hasAutomaticFanSpeed;
|
|
766
|
+
const modelSupportsHeat = this.accessory.modelSupportsHeat;
|
|
767
|
+
const modelSupportsCool = this.accessory.modelSupportsCool;
|
|
768
|
+
const modelSupportsAuto = this.accessory.modelSupportsAuto;
|
|
757
769
|
const modelSupportsFanSpeed = this.accessory.modelSupportsFanSpeed;
|
|
758
770
|
const modelSupportsDry = this.accessory.modelSupportsDry;
|
|
759
771
|
const numberOfFanSpeeds = this.accessory.numberOfFanSpeeds;
|
|
@@ -892,46 +904,50 @@ class DeviceAta extends EventEmitter {
|
|
|
892
904
|
};
|
|
893
905
|
});
|
|
894
906
|
};
|
|
895
|
-
|
|
896
|
-
.
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
907
|
+
if (modelSupportsAuto && modelSupportsHeat) {
|
|
908
|
+
this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
|
|
909
|
+
.setProps({
|
|
910
|
+
minValue: 0,
|
|
911
|
+
maxValue: 31,
|
|
912
|
+
minStep: this.accessory.temperatureIncrement
|
|
913
|
+
})
|
|
914
|
+
.onGet(async () => {
|
|
915
|
+
const value = this.accessory.defaultHeatingSetTemperature;
|
|
916
|
+
return value;
|
|
917
|
+
})
|
|
918
|
+
.onSet(async (value) => {
|
|
919
|
+
try {
|
|
920
|
+
deviceData.Device.DefaultHeatingSetTemperature = value;
|
|
921
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
922
|
+
await this.melCloudAta.send(deviceData);
|
|
923
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
924
|
+
} catch (error) {
|
|
925
|
+
this.emit('warn', `Set heating threshold temperature error: ${error}`);
|
|
926
|
+
};
|
|
927
|
+
});
|
|
928
|
+
};
|
|
929
|
+
if (modelSupportsAuto && modelSupportsCool) {
|
|
930
|
+
this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
|
|
931
|
+
.setProps({
|
|
932
|
+
minValue: 10,
|
|
933
|
+
maxValue: 31,
|
|
934
|
+
minStep: this.accessory.temperatureIncrement
|
|
935
|
+
})
|
|
936
|
+
.onGet(async () => {
|
|
937
|
+
const value = this.accessory.defaultCoolingSetTemperature;
|
|
938
|
+
return value;
|
|
939
|
+
})
|
|
940
|
+
.onSet(async (value) => {
|
|
941
|
+
try {
|
|
942
|
+
deviceData.Device.DefaultCoolingSetTemperature = value;
|
|
943
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
944
|
+
await this.melCloudAta.send(deviceData);
|
|
945
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
946
|
+
} catch (error) {
|
|
947
|
+
this.emit('warn', `Set cooling threshold temperature error: ${error}`);
|
|
948
|
+
};
|
|
949
|
+
});
|
|
950
|
+
};
|
|
935
951
|
this.melCloudService.getCharacteristic(Characteristic.LockPhysicalControls)
|
|
936
952
|
.onGet(async () => {
|
|
937
953
|
const value = this.accessory.lockPhysicalControl;
|
|
@@ -1040,6 +1056,50 @@ class DeviceAta extends EventEmitter {
|
|
|
1040
1056
|
this.emit('warn', `Set temperature error: ${error}`);
|
|
1041
1057
|
};
|
|
1042
1058
|
});
|
|
1059
|
+
if (modelSupportsAuto && modelSupportsHeat) {
|
|
1060
|
+
this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
|
|
1061
|
+
.setProps({
|
|
1062
|
+
minValue: 0,
|
|
1063
|
+
maxValue: 31,
|
|
1064
|
+
minStep: this.accessory.temperatureIncrement
|
|
1065
|
+
})
|
|
1066
|
+
.onGet(async () => {
|
|
1067
|
+
const value = this.accessory.defaultHeatingSetTemperature;
|
|
1068
|
+
return value;
|
|
1069
|
+
})
|
|
1070
|
+
.onSet(async (value) => {
|
|
1071
|
+
try {
|
|
1072
|
+
deviceData.Device.DefaultHeatingSetTemperature = value;
|
|
1073
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
1074
|
+
await this.melCloudAta.send(deviceData);
|
|
1075
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
1076
|
+
} catch (error) {
|
|
1077
|
+
this.emit('warn', `Set heating threshold temperature error: ${error}`);
|
|
1078
|
+
};
|
|
1079
|
+
});
|
|
1080
|
+
};
|
|
1081
|
+
if (modelSupportsAuto && modelSupportsCool) {
|
|
1082
|
+
this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
|
|
1083
|
+
.setProps({
|
|
1084
|
+
minValue: 10,
|
|
1085
|
+
maxValue: 31,
|
|
1086
|
+
minStep: this.accessory.temperatureIncrement
|
|
1087
|
+
})
|
|
1088
|
+
.onGet(async () => {
|
|
1089
|
+
const value = this.accessory.defaultCoolingSetTemperature;
|
|
1090
|
+
return value;
|
|
1091
|
+
})
|
|
1092
|
+
.onSet(async (value) => {
|
|
1093
|
+
try {
|
|
1094
|
+
deviceData.Device.DefaultCoolingSetTemperature = value;
|
|
1095
|
+
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
1096
|
+
await this.melCloudAta.send(deviceData);
|
|
1097
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
1098
|
+
} catch (error) {
|
|
1099
|
+
this.emit('warn', `Set cooling threshold temperature error: ${error}`);
|
|
1100
|
+
};
|
|
1101
|
+
});
|
|
1102
|
+
};
|
|
1043
1103
|
this.melCloudService.getCharacteristic(Characteristic.TemperatureDisplayUnits)
|
|
1044
1104
|
.onGet(async () => {
|
|
1045
1105
|
const value = this.accessory.useFahrenheit;
|
|
@@ -1192,130 +1252,130 @@ class DeviceAta extends EventEmitter {
|
|
|
1192
1252
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power;
|
|
1193
1253
|
break;
|
|
1194
1254
|
case 1: //OPERATING MODE HEAT
|
|
1195
|
-
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue;
|
|
1255
|
+
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
|
|
1196
1256
|
deviceData.Device.Power = true;
|
|
1197
|
-
deviceData.Device.OperationMode = state ? 1 : button.previousValue;
|
|
1257
|
+
deviceData.Device.OperationMode = state ? 1 : button.previousValue === 9 ? 1 : button.previousValue;
|
|
1198
1258
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.OperationMode;
|
|
1199
1259
|
break;
|
|
1200
1260
|
case 2: //OPERATING MODE DRY
|
|
1201
|
-
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue;
|
|
1261
|
+
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
|
|
1202
1262
|
deviceData.Device.Power = true;
|
|
1203
|
-
deviceData.Device.OperationMode = state ? 2 : button.previousValue;
|
|
1263
|
+
deviceData.Device.OperationMode = state ? 2 : button.previousValue === 10 ? 2 : button.previousValue;
|
|
1204
1264
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.OperationMode;
|
|
1205
1265
|
break
|
|
1206
1266
|
case 3: //OPERATING MODE COOL
|
|
1207
|
-
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue;
|
|
1267
|
+
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
|
|
1208
1268
|
deviceData.Device.Power = true;
|
|
1209
|
-
deviceData.Device.OperationMode = state ? 3 : button.previousValue;
|
|
1269
|
+
deviceData.Device.OperationMode = state ? 3 : button.previousValue === 11 ? 3 : button.previousValue;
|
|
1210
1270
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.OperationMode;
|
|
1211
1271
|
break;
|
|
1212
1272
|
case 4: //OPERATING MODE FAN
|
|
1213
|
-
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue;
|
|
1273
|
+
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
|
|
1214
1274
|
deviceData.Device.Power = true;
|
|
1215
1275
|
deviceData.Device.OperationMode = state ? 7 : button.previousValue;
|
|
1216
1276
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.OperationMode;
|
|
1217
1277
|
break;
|
|
1218
1278
|
case 5: //OPERATING MODE AUTO
|
|
1219
|
-
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue;
|
|
1279
|
+
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
|
|
1220
1280
|
deviceData.Device.Power = true;
|
|
1221
1281
|
deviceData.Device.OperationMode = state ? 8 : button.previousValue;
|
|
1222
1282
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.OperationMode;
|
|
1223
1283
|
break;
|
|
1224
1284
|
case 6: //OPERATING MODE PURIFY
|
|
1225
|
-
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue;
|
|
1285
|
+
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
|
|
1226
1286
|
deviceData.Device.Power = true;
|
|
1227
|
-
deviceData.Device.OperationMode = state ?
|
|
1287
|
+
deviceData.Device.OperationMode = state ? 12 : button.previousValue;
|
|
1228
1288
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.OperationMode;
|
|
1229
1289
|
break;
|
|
1230
1290
|
case 7: //OPERATING MODE DRY CONTROL HIDE
|
|
1231
1291
|
deviceData.Device.HideDryModeControl = state;
|
|
1232
1292
|
break;
|
|
1233
1293
|
case 10: //VANE H SWING MODE AUTO
|
|
1234
|
-
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue;
|
|
1294
|
+
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1235
1295
|
deviceData.Device.Power = true;
|
|
1236
1296
|
deviceData.Device.VaneHorizontalDirection = state ? 0 : button.previousValue;
|
|
1237
1297
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneHorizontal;
|
|
1238
1298
|
break;
|
|
1239
1299
|
case 11: //VANE H SWING MODE 1
|
|
1240
|
-
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue;
|
|
1300
|
+
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1241
1301
|
deviceData.Device.Power = true;
|
|
1242
1302
|
deviceData.Device.VaneHorizontalDirection = state ? 1 : button.previousValue;
|
|
1243
1303
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneHorizontal;
|
|
1244
1304
|
break;
|
|
1245
1305
|
case 12: //VANE H SWING MODE 2
|
|
1246
|
-
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue;
|
|
1306
|
+
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1247
1307
|
deviceData.Device.Power = true;
|
|
1248
1308
|
deviceData.Device.VaneHorizontalDirection = state ? 2 : button.previousValue;
|
|
1249
1309
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneHorizontal;
|
|
1250
1310
|
break;
|
|
1251
1311
|
case 13: //VANE H SWING MODE 3
|
|
1252
|
-
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue;
|
|
1312
|
+
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1253
1313
|
deviceData.Device.Power = true;
|
|
1254
1314
|
deviceData.Device.VaneHorizontalDirection = state ? 3 : button.previousValue;
|
|
1255
1315
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneHorizontal;
|
|
1256
1316
|
break;
|
|
1257
1317
|
case 14: //VANE H SWING MODE 4
|
|
1258
|
-
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue;
|
|
1318
|
+
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1259
1319
|
deviceData.Device.Power = true;
|
|
1260
1320
|
deviceData.Device.VaneHorizontalDirection = state ? 4 : button.previousValue;
|
|
1261
1321
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneHorizontal;
|
|
1262
1322
|
break;
|
|
1263
1323
|
case 15: //VANE H SWING MODE 5
|
|
1264
|
-
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue;
|
|
1324
|
+
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1265
1325
|
deviceData.Device.Power = true;
|
|
1266
1326
|
deviceData.Device.VaneHorizontalDirection = state ? 5 : button.previousValue;
|
|
1267
1327
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneHorizontal;
|
|
1268
1328
|
break;
|
|
1269
1329
|
case 16: //VANE H SWING MODE SPLIT
|
|
1270
|
-
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue;
|
|
1330
|
+
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1271
1331
|
deviceData.Device.Power = true;
|
|
1272
1332
|
deviceData.Device.VaneHorizontalDirection = state ? 8 : button.previousValue;
|
|
1273
1333
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneHorizontal;
|
|
1274
1334
|
break;
|
|
1275
1335
|
case 17: //VANE H SWING MODE SWING
|
|
1276
|
-
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue;
|
|
1336
|
+
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1277
1337
|
deviceData.Device.Power = true;
|
|
1278
1338
|
deviceData.Device.VaneHorizontalDirection = state ? 12 : button.previousValue;
|
|
1279
1339
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneHorizontal;
|
|
1280
1340
|
break;
|
|
1281
1341
|
case 20: //VANE V SWING MODE AUTO
|
|
1282
|
-
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue;
|
|
1342
|
+
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
|
|
1283
1343
|
deviceData.Device.Power = true;
|
|
1284
1344
|
deviceData.Device.VaneVerticalDirection = state ? 0 : button.previousValue;
|
|
1285
1345
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneVertical;
|
|
1286
1346
|
break;
|
|
1287
1347
|
case 21: //VANE V SWING MODE 1
|
|
1288
|
-
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue;
|
|
1348
|
+
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
|
|
1289
1349
|
deviceData.Device.Power = true;
|
|
1290
1350
|
deviceData.Device.VaneVerticalDirection = state ? 1 : button.previousValue;
|
|
1291
1351
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneVertical;
|
|
1292
1352
|
break;
|
|
1293
1353
|
case 22: //VANE V SWING MODE 2
|
|
1294
|
-
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue;
|
|
1354
|
+
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
|
|
1295
1355
|
deviceData.Device.Power = true;
|
|
1296
1356
|
deviceData.Device.VaneVerticalDirection = state ? 2 : button.previousValue;
|
|
1297
1357
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneVertical;
|
|
1298
1358
|
break;
|
|
1299
1359
|
case 23: //VANE V SWING MODE 3
|
|
1300
|
-
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue;
|
|
1360
|
+
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
|
|
1301
1361
|
deviceData.Device.Power = true;
|
|
1302
1362
|
deviceData.Device.VaneVerticalDirection = state ? 3 : button.previousValue;
|
|
1303
1363
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneVertical;
|
|
1304
1364
|
break;
|
|
1305
1365
|
case 24: //VANE V SWING MODE 4
|
|
1306
|
-
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue;
|
|
1366
|
+
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
|
|
1307
1367
|
deviceData.Device.Power = true;
|
|
1308
1368
|
deviceData.Device.VaneVerticalDirection = state ? 4 : button.previousValue;
|
|
1309
1369
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneVertical;
|
|
1310
1370
|
break;
|
|
1311
1371
|
case 25: //VANE V SWING MODE 5
|
|
1312
|
-
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue;
|
|
1372
|
+
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
|
|
1313
1373
|
deviceData.Device.Power = true;
|
|
1314
1374
|
deviceData.Device.VaneVerticalDirection = state ? 5 : button.previousValue;
|
|
1315
1375
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneVertical;
|
|
1316
1376
|
break;
|
|
1317
1377
|
case 26: //VANE V SWING MODE SWING
|
|
1318
|
-
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue;
|
|
1378
|
+
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
|
|
1319
1379
|
deviceData.Device.Power = true;
|
|
1320
1380
|
deviceData.Device.VaneVerticalDirection = state ? 7 : button.previousValue;
|
|
1321
1381
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.VaneVertical;
|
|
@@ -1324,43 +1384,43 @@ class DeviceAta extends EventEmitter {
|
|
|
1324
1384
|
deviceData.Device.HideVaneControls = state;
|
|
1325
1385
|
break;
|
|
1326
1386
|
case 30: //FAN SPEED MODE AUTO
|
|
1327
|
-
button.previousValue = state ? deviceData.Device.FanSpeed : button.previousValue;
|
|
1387
|
+
button.previousValue = state ? deviceData.Device.FanSpeed : button.previousValue ?? deviceData.Device.FanSpeed;
|
|
1328
1388
|
deviceData.Device.Power = true;
|
|
1329
1389
|
deviceData.Device.FanSpeed = state ? 0 : button.previousValue;
|
|
1330
1390
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
1331
1391
|
break;
|
|
1332
1392
|
case 31: //FAN SPEED MODE 1
|
|
1333
|
-
button.previousValue = state ? deviceData.Device.FanSpeed : button.previousValue;
|
|
1393
|
+
button.previousValue = state ? deviceData.Device.FanSpeed : button.previousValue ?? deviceData.Device.FanSpeed;
|
|
1334
1394
|
deviceData.Device.Power = true;
|
|
1335
1395
|
deviceData.Device.FanSpeed = state ? 1 : button.previousValue;
|
|
1336
1396
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
1337
1397
|
break;
|
|
1338
1398
|
case 32: //FAN SPEED MODE 2
|
|
1339
|
-
button.previousValue = state ? deviceData.Device.FanSpeed : button.previousValue;
|
|
1399
|
+
button.previousValue = state ? deviceData.Device.FanSpeed : button.previousValue ?? deviceData.Device.FanSpeed;
|
|
1340
1400
|
deviceData.Device.Power = true;
|
|
1341
1401
|
deviceData.Device.FanSpeed = state ? 2 : button.previousValue;
|
|
1342
1402
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
1343
1403
|
break;
|
|
1344
1404
|
case 33: //FAN SPEED MODE 3
|
|
1345
|
-
button.previousValue = state ? deviceData.Device.FanSpeed : button.previousValue;
|
|
1405
|
+
button.previousValue = state ? deviceData.Device.FanSpeed : button.previousValue ?? deviceData.Device.FanSpeed;
|
|
1346
1406
|
deviceData.Device.Power = true;
|
|
1347
1407
|
deviceData.Device.FanSpeed = state ? 3 : button.previousValue;
|
|
1348
1408
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
1349
1409
|
break;
|
|
1350
1410
|
case 34: //FAN MODE 4
|
|
1351
|
-
button.previousValue = state ? deviceData.Device.FanSpeed : button.previousValue;
|
|
1411
|
+
button.previousValue = state ? deviceData.Device.FanSpeed : button.previousValue ?? deviceData.Device.FanSpeed;
|
|
1352
1412
|
deviceData.Device.Power = true;
|
|
1353
1413
|
deviceData.Device.FanSpeed = state ? 4 : button.previousValue;
|
|
1354
1414
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
1355
1415
|
break;
|
|
1356
1416
|
case 35: //FAN SPEED MODE 5
|
|
1357
|
-
button.previousValue = state ? deviceData.Device.FanSpeed : button.previousValue;
|
|
1417
|
+
button.previousValue = state ? deviceData.Device.FanSpeed : button.previousValue ?? deviceData.Device.FanSpeed;
|
|
1358
1418
|
deviceData.Device.Power = true;
|
|
1359
1419
|
deviceData.Device.FanSpeed = state ? 5 : button.previousValue;
|
|
1360
1420
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
1361
1421
|
break;
|
|
1362
1422
|
case 36: //FAN SPEED MODE 6
|
|
1363
|
-
button.previousValue = state ? deviceData.Device.FanSpeed : button.previousValue;
|
|
1423
|
+
button.previousValue = state ? deviceData.Device.FanSpeed : button.previousValue ?? deviceData.Device.FanSpeed;
|
|
1364
1424
|
deviceData.Device.Power = true;
|
|
1365
1425
|
deviceData.Device.FanSpeed = state ? 6 : button.previousValue;
|
|
1366
1426
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power + CONSTANTS.AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
@@ -1389,7 +1449,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1389
1449
|
};
|
|
1390
1450
|
|
|
1391
1451
|
await this.melCloudAta.send(deviceData);
|
|
1392
|
-
const info = this.disableLogInfo ? false : this.emit('message', `${state ?
|
|
1452
|
+
const info = this.disableLogInfo ? false : this.emit('message', `${state ? `Set: ${buttonName}` : `Unset: ${buttonName}, Set: ${button.previousValue}`}`);
|
|
1393
1453
|
} catch (error) {
|
|
1394
1454
|
this.emit('warn', `Set button error: ${error}`);
|
|
1395
1455
|
};
|
package/src/deviceatw.js
CHANGED
|
@@ -88,7 +88,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
88
88
|
button.serviceType = buttonServiceType;
|
|
89
89
|
button.characteristicType = buttonCharacteristicType;
|
|
90
90
|
button.state = false;
|
|
91
|
-
button.previousValue =
|
|
91
|
+
button.previousValue = null;
|
|
92
92
|
this.buttonsConfigured.push(button);
|
|
93
93
|
} else {
|
|
94
94
|
const log = buttonDisplayType === 0 ? false : this.emit('warn', `Button Name: ${buttonName ? buttonName : 'Missing'}, Mode: ${buttonMode ? buttonMode : 'Missing'}.`);
|
|
@@ -560,7 +560,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
560
560
|
switch (i) {
|
|
561
561
|
case 0: //Heat Pump - HEAT, COOL, OFF
|
|
562
562
|
this.emit('message', `${heatPumpName}, Power: ${power ? 'ON' : 'OFF'}`)
|
|
563
|
-
this.emit('message', `${heatPumpName}, Operation mode: ${
|
|
563
|
+
this.emit('message', `${heatPumpName}, Operation mode: ${CONSTANTS.HeatPump.System[unitStatus]}`);
|
|
564
564
|
this.emit('message', `${heatPumpName},'Outdoor temperature: ${roomTemperature}${temperatureUnit}`);
|
|
565
565
|
const info = flowTemperature !== null ? this.emit('message', `${heatPumpName}, Flow temperature: ${flowTemperature}${temperatureUnit}`) : false;
|
|
566
566
|
const info1 = returnTemperature !== null ? this.emit('message', `${heatPumpName}, Return temperature: ${returnTemperature}${temperatureUnit}`) : false;
|
|
@@ -569,7 +569,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
569
569
|
break;
|
|
570
570
|
case 1: //Zone 1 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
571
571
|
operationModeText = idleZone1 ? CONSTANTS.HeatPump.ZoneOperation[6] : CONSTANTS.HeatPump.ZoneOperation[operationModeZone1];
|
|
572
|
-
this.emit('message', `${zone1Name}, Operation mode: ${
|
|
572
|
+
this.emit('message', `${zone1Name}, Operation mode: ${operationModeText}`);
|
|
573
573
|
this.emit('message', `${zone1Name}, Temperature: ${roomTemperature}${temperatureUnit}`);
|
|
574
574
|
this.emit('message', `${zone1Name}, Target temperature: ${setTemperature}${temperatureUnit}`)
|
|
575
575
|
const info2 = flowTemperatureZone1 !== null ? this.emit('message', `${zone1Name}, Flow temperature: ${flowTemperatureZone1}${temperatureUnit}`) : false;
|
|
@@ -579,7 +579,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
579
579
|
break;
|
|
580
580
|
case caseHotWater: //Hot Water - AUTO, HEAT NOW
|
|
581
581
|
operationModeText = operationMode === 1 ? CONSTANTS.HeatPump.ForceDhw[1] : CONSTANTS.HeatPump.ForceDhw[forcedHotWaterMode ? 1 : 0];
|
|
582
|
-
this.emit('message', `${hotWaterName}, Operation mode: ${
|
|
582
|
+
this.emit('message', `${hotWaterName}, Operation mode: ${operationModeText}`);
|
|
583
583
|
this.emit('message', `${hotWaterName}, Temperature: ${roomTemperature}${temperatureUnit}`);
|
|
584
584
|
this.emit('message', `${hotWaterName}, Target temperature: ${setTemperature}${temperatureUnit}`)
|
|
585
585
|
const info4 = flowTemperatureWaterTank !== null ? this.emit('message', `${hotWaterName}, Flow temperature: ${flowTemperatureWaterTank}${temperatureUnit}`) : false;
|
|
@@ -589,7 +589,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
589
589
|
break;
|
|
590
590
|
case caseZone2: //Zone 2 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
591
591
|
operationModeText = idleZone2 ? CONSTANTS.HeatPump.ZoneOperation[6] : CONSTANTS.HeatPump.ZoneOperation[operationModeZone2];
|
|
592
|
-
this.emit('message', `${zone2Name}, Operation mode: ${
|
|
592
|
+
this.emit('message', `${zone2Name}, Operation mode: ${operationModeText}`);
|
|
593
593
|
this.emit('message', `${zone2Name}, Temperature: ${roomTemperature}${temperatureUnit}`);
|
|
594
594
|
this.emit('message', `${zone2Name}, Target temperature: ${setTemperature}${temperatureUnit}`)
|
|
595
595
|
const info6 = flowTemperatureZone2 !== null ? this.emit('message', `${zone2Name}, Flow temperature: ${flowTemperatureZone2}${temperatureUnit}`) : false;
|
|
@@ -632,7 +632,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
632
632
|
if (this.buttonsConfiguredCount > 0) {
|
|
633
633
|
for (let i = 0; i < this.buttonsConfiguredCount; i++) {
|
|
634
634
|
const button = this.buttonsConfigured[i];
|
|
635
|
-
const mode =
|
|
635
|
+
const mode = button.mode;
|
|
636
636
|
switch (mode) {
|
|
637
637
|
case 0: //POWER ON,OFF
|
|
638
638
|
button.state = (power === true);
|
|
@@ -1674,13 +1674,13 @@ class DeviceAtw extends EventEmitter {
|
|
|
1674
1674
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power;
|
|
1675
1675
|
break;
|
|
1676
1676
|
case 1: //HEAT PUMP HEAT
|
|
1677
|
-
button.previousValue = state ? deviceData.Device.UnitStatus : button.previousValue;
|
|
1677
|
+
button.previousValue = state ? deviceData.Device.UnitStatus : button.previousValue ?? deviceData.Device.UnitStatus;
|
|
1678
1678
|
deviceData.Device.Power = true;
|
|
1679
1679
|
deviceData.Device.UnitStatus = state ? 0 : button.previousValue;
|
|
1680
1680
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power + CONSTANTS.HeatPump.EffectiveFlags.OperationMode;
|
|
1681
1681
|
break;
|
|
1682
1682
|
case 2: //COOL
|
|
1683
|
-
button.previousValue = state ? deviceData.Device.UnitStatus : button.previousValue;
|
|
1683
|
+
button.previousValue = state ? deviceData.Device.UnitStatus : button.previousValue ?? deviceData.Device.UnitStatus;
|
|
1684
1684
|
deviceData.Device.Power = true;
|
|
1685
1685
|
deviceData.Device.UnitStatus = state ? 1 : button.previousValue;
|
|
1686
1686
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power + CONSTANTS.HeatPump.EffectiveFlags.OperationMode;
|
|
@@ -1696,37 +1696,37 @@ class DeviceAtw extends EventEmitter {
|
|
|
1696
1696
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.ProhibitHeatingZone1 + CONSTANTS.HeatPump.EffectiveFlags.ProhibitHotWater + CONSTANTS.HeatPump.EffectiveFlags.ProhibitHeatingZone2;
|
|
1697
1697
|
break;
|
|
1698
1698
|
case 20: //ZONE 1 HEAT THERMOSTAT
|
|
1699
|
-
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue;
|
|
1699
|
+
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
|
|
1700
1700
|
deviceData.Device.Power = true;
|
|
1701
1701
|
deviceData.Device.OperationModeZone1 = state ? 0 : button.previousValue;
|
|
1702
1702
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power + CONSTANTS.HeatPump.EffectiveFlags.OperationModeZone1;
|
|
1703
1703
|
break;
|
|
1704
1704
|
case 21: //HEAT FLOW
|
|
1705
|
-
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue;
|
|
1705
|
+
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
|
|
1706
1706
|
deviceData.Device.Power = true;
|
|
1707
1707
|
deviceData.Device.OperationModeZone1 = state ? 1 : button.previousValue;
|
|
1708
1708
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power + CONSTANTS.HeatPump.EffectiveFlags.OperationModeZone1;
|
|
1709
1709
|
break;
|
|
1710
1710
|
case 22: //HEAT CURVE
|
|
1711
|
-
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue;
|
|
1711
|
+
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
|
|
1712
1712
|
deviceData.Device.Power = true;
|
|
1713
1713
|
deviceData.Device.OperationModeZone1 = state ? 2 : button.previousValue;
|
|
1714
1714
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power + CONSTANTS.HeatPump.EffectiveFlags.OperationModeZone1;
|
|
1715
1715
|
break;
|
|
1716
1716
|
case 23: //COOL THERMOSTAT
|
|
1717
|
-
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue;
|
|
1717
|
+
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
|
|
1718
1718
|
deviceData.Device.Power = true;
|
|
1719
1719
|
deviceData.Device.OperationModeZone1 = state ? 3 : button.previousValue;
|
|
1720
1720
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power + CONSTANTS.HeatPump.EffectiveFlags.OperationModeZone1;
|
|
1721
1721
|
break;
|
|
1722
1722
|
case 24: //COOL FLOW
|
|
1723
|
-
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue;
|
|
1723
|
+
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
|
|
1724
1724
|
deviceData.Device.Power = true;
|
|
1725
1725
|
deviceData.Device.OperationModeZone1 = state ? 4 : button.previousValue;
|
|
1726
1726
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power + CONSTANTS.HeatPump.EffectiveFlags.OperationModeZone1;
|
|
1727
1727
|
break;
|
|
1728
1728
|
case 25: //FLOOR DRY UP
|
|
1729
|
-
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue;
|
|
1729
|
+
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
|
|
1730
1730
|
deviceData.Device.Power = true;
|
|
1731
1731
|
deviceData.Device.OperationModeZone1 = state ? 5 : button.previousValue;
|
|
1732
1732
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power + CONSTANTS.HeatPump.EffectiveFlags.OperationModeZone1;
|
|
@@ -1750,37 +1750,37 @@ class DeviceAtw extends EventEmitter {
|
|
|
1750
1750
|
CONSTANTS.HeatPump.EffectiveFlags.ProhibitHotWater;
|
|
1751
1751
|
break;
|
|
1752
1752
|
case 60: //ZONE 2 HEAT THERMOSTAT
|
|
1753
|
-
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue;
|
|
1753
|
+
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
|
|
1754
1754
|
deviceData.Device.Power = true;
|
|
1755
1755
|
deviceData.Device.OperationModeZone2 = state ? 0 : button.previousValue;
|
|
1756
1756
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power + CONSTANTS.HeatPump.EffectiveFlags.OperationModeZone2;
|
|
1757
1757
|
break;
|
|
1758
1758
|
case 61: // HEAT FLOW
|
|
1759
|
-
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue;
|
|
1759
|
+
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
|
|
1760
1760
|
deviceData.Device.Power = true;
|
|
1761
1761
|
deviceData.Device.OperationModeZone2 = state ? 1 : button.previousValue;
|
|
1762
1762
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power + CONSTANTS.HeatPump.EffectiveFlags.OperationModeZone2;
|
|
1763
1763
|
break;
|
|
1764
1764
|
case 62: //HEAT CURVE
|
|
1765
|
-
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue;
|
|
1765
|
+
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
|
|
1766
1766
|
deviceData.Device.Power = true;
|
|
1767
1767
|
deviceData.Device.OperationModeZone2 = state ? 2 : button.previousValue;
|
|
1768
1768
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power + CONSTANTS.HeatPump.EffectiveFlags.OperationModeZone2;
|
|
1769
1769
|
break;
|
|
1770
1770
|
case 63: //COOL THERMOSTAT
|
|
1771
|
-
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue;
|
|
1771
|
+
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
|
|
1772
1772
|
deviceData.Device.Power = true;
|
|
1773
1773
|
deviceData.Device.OperationModeZone2 = state ? 3 : button.previousValue;
|
|
1774
1774
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power + CONSTANTS.HeatPump.EffectiveFlags.OperationModeZone2;
|
|
1775
1775
|
break;
|
|
1776
1776
|
case 64: //COOL FLOW
|
|
1777
|
-
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue;
|
|
1777
|
+
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
|
|
1778
1778
|
deviceData.Device.Power = true;
|
|
1779
1779
|
deviceData.Device.OperationModeZone2 = state ? 4 : button.previousValue;
|
|
1780
1780
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power + CONSTANTS.HeatPump.EffectiveFlags.OperationModeZone2;
|
|
1781
1781
|
break;
|
|
1782
1782
|
case 65: //FLOOR DRY UP
|
|
1783
|
-
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue;
|
|
1783
|
+
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
|
|
1784
1784
|
deviceData.Device.Power = true;
|
|
1785
1785
|
deviceData.Device.OperationModeZone2 = state ? 5 : button.previousValue;
|
|
1786
1786
|
deviceData.Device.EffectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.Power + CONSTANTS.HeatPump.EffectiveFlags.OperationModeZone2;
|
|
@@ -1795,7 +1795,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1795
1795
|
};
|
|
1796
1796
|
|
|
1797
1797
|
await this.melCloudAtw.send(deviceData);
|
|
1798
|
-
const info = this.disableLogInfo ? false : this.emit('message', `${state ?
|
|
1798
|
+
const info = this.disableLogInfo ? false : this.emit('message', `${state ? `Set: ${buttonName}` : `Unset: ${buttonName}, Set: ${button.previousValue}`}`);
|
|
1799
1799
|
} catch (error) {
|
|
1800
1800
|
this.emit('warn', `Set button error: ${error}`);
|
|
1801
1801
|
};
|
package/src/deviceerv.js
CHANGED
|
@@ -82,7 +82,7 @@ class DeviceErv extends EventEmitter {
|
|
|
82
82
|
button.serviceType = buttonServiceType;
|
|
83
83
|
button.characteristicType = buttonCharacteristicType;
|
|
84
84
|
button.state = false;
|
|
85
|
-
button.previousValue =
|
|
85
|
+
button.previousValue = null;
|
|
86
86
|
this.buttonsConfigured.push(button);
|
|
87
87
|
} else {
|
|
88
88
|
const log = buttonDisplayType === 0 ? false : this.emit('warn', `Button Name: ${buttonName ? buttonName : 'Missing'}, Mode: ${buttonMode ? buttonMode : 'Missing'}.`);
|
|
@@ -482,7 +482,7 @@ class DeviceErv extends EventEmitter {
|
|
|
482
482
|
if (this.buttonsConfiguredCount > 0) {
|
|
483
483
|
for (let i = 0; i < this.buttonsConfiguredCount; i++) {
|
|
484
484
|
const button = this.buttonsConfigured[i];
|
|
485
|
-
const mode =
|
|
485
|
+
const mode = button.mode;;
|
|
486
486
|
switch (mode) {
|
|
487
487
|
case 0: //POWER ON,OFF
|
|
488
488
|
button.state = (power === true);
|
|
@@ -542,15 +542,14 @@ class DeviceErv extends EventEmitter {
|
|
|
542
542
|
|
|
543
543
|
//log current state
|
|
544
544
|
if (!this.disableLogInfo) {
|
|
545
|
-
const operationModeText = !power ? CONSTANTS.Ventilation.System[0] : CONSTANTS.Ventilation.OperationMode[ventilationMode];
|
|
546
545
|
this.emit('message', `Power: ${power ? 'ON' : 'OFF'}`);
|
|
547
|
-
this.emit('message', `Operation mode: ${
|
|
546
|
+
this.emit('message', `Operation mode: ${CONSTANTS.Ventilation.OperationMode[ventilationMode]}`);
|
|
548
547
|
this.emit('message', `Room temperature: ${roomTemperature}${temperatureUnit}`);
|
|
549
548
|
const info = hasCoolOperationMode || hasHeatOperationMode ? this.emit('message', `Target temperature: ${targetTemperature}${temperatureUnit}`) : false;
|
|
550
549
|
const info1 = hasSupplyTemperature && this.accessory.supplyTemperature !== null ? this.emit('message', `Supply temperature: ${roomTemperature}${temperatureUnit}`) : false;
|
|
551
550
|
const info2 = hasOutdoorTemperature && this.accessory.outdoorTemperature !== null ? this.emit('message', `Outdoor temperature: ${roomTemperature}${temperatureUnit}`) : false;
|
|
552
|
-
const info3 = hasHeatOperationMode
|
|
553
|
-
const info4 = hasCoolOperationMode
|
|
551
|
+
const info3 = hasHeatOperationMode ? this.emit('message', `Heating threshold temperature: ${targetTemperature}${temperatureUnit}`) : false;
|
|
552
|
+
const info4 = hasCoolOperationMode ? this.emit('message', `Cooling threshold temperature: ${targetTemperature}${temperatureUnit}`) : false;
|
|
554
553
|
this.emit('message', `Fan speed mode: ${CONSTANTS.Ventilation.FanSpeed[setFanSpeed]}`);
|
|
555
554
|
this.emit('message', `Temperature display unit: ${temperatureUnit}`);
|
|
556
555
|
this.emit('message', `Core maintenance: ${CONSTANTS.Ventilation.CoreMaintenance[coreMaintenanceRequired]}`);
|
|
@@ -1186,19 +1185,19 @@ class DeviceErv extends EventEmitter {
|
|
|
1186
1185
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Power;
|
|
1187
1186
|
break;
|
|
1188
1187
|
case 1: //OPERATING MODE RECOVERY
|
|
1189
|
-
button.previousValue = state ? deviceData.Device.VentilationMode : button.previousValue;
|
|
1188
|
+
button.previousValue = state ? deviceData.Device.VentilationMode : button.previousValue ?? deviceData.Device.VentilationMode;
|
|
1190
1189
|
deviceData.Device.Power = true;
|
|
1191
1190
|
deviceData.Device.VentilationMode = state ? 0 : button.previousValue;
|
|
1192
1191
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Power + CONSTANTS.Ventilation.EffectiveFlags.VentilationMode;
|
|
1193
1192
|
break;
|
|
1194
1193
|
case 2: //OPERATING MODE BYPASS
|
|
1195
|
-
button.previousValue = state ? deviceData.Device.VentilationMode : button.previousValue;
|
|
1194
|
+
button.previousValue = state ? deviceData.Device.VentilationMode : button.previousValue ?? deviceData.Device.VentilationMode;
|
|
1196
1195
|
deviceData.Device.Power = true;
|
|
1197
1196
|
deviceData.Device.VentilationMode = state ? 1 : button.previousValue;
|
|
1198
1197
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Power + CONSTANTS.Ventilation.EffectiveFlags.VentilationMode;
|
|
1199
1198
|
break
|
|
1200
1199
|
case 3: //OPERATING MODE AUTO
|
|
1201
|
-
button.previousValue = state ? deviceData.Device.VentilationMode : button.previousValue;
|
|
1200
|
+
button.previousValue = state ? deviceData.Device.VentilationMode : button.previousValue ?? deviceData.Device.VentilationMode;
|
|
1202
1201
|
deviceData.Device.Power = true;
|
|
1203
1202
|
deviceData.Device.VentilationMode = state ? 2 : button.previousValue;
|
|
1204
1203
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Power + CONSTANTS.Ventilation.EffectiveFlags.VentilationMode;
|
|
@@ -1209,31 +1208,31 @@ class DeviceErv extends EventEmitter {
|
|
|
1209
1208
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Power
|
|
1210
1209
|
break;
|
|
1211
1210
|
case 10: //FAN SPEED MODE AUTO
|
|
1212
|
-
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue;
|
|
1211
|
+
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue ?? deviceData.Device.SetFanSpeed;
|
|
1213
1212
|
deviceData.Device.Power = true;
|
|
1214
1213
|
deviceData.Device.SetFanSpeed = state ? 0 : button.previousValue;
|
|
1215
1214
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Power + CONSTANTS.Ventilation.EffectiveFlags.SetFanSpeed;
|
|
1216
1215
|
break;
|
|
1217
1216
|
case 11: //FAN SPEED MODE 1
|
|
1218
|
-
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue;
|
|
1217
|
+
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue ?? deviceData.Device.SetFanSpeed;
|
|
1219
1218
|
deviceData.Device.Power = true;
|
|
1220
1219
|
deviceData.Device.SetFanSpeed = state ? 1 : button.previousValue;
|
|
1221
1220
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Power + CONSTANTS.Ventilation.EffectiveFlags.SetFanSpeed;
|
|
1222
1221
|
break;
|
|
1223
1222
|
case 12: //FAN SPEED MODE 2
|
|
1224
|
-
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue;
|
|
1223
|
+
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue ?? deviceData.Device.SetFanSpeed;
|
|
1225
1224
|
deviceData.Device.Power = true;
|
|
1226
1225
|
deviceData.Device.SetFanSpeed = state ? 2 : button.previousValue;
|
|
1227
1226
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Power + CONSTANTS.Ventilation.EffectiveFlags.SetFanSpeed;
|
|
1228
1227
|
break;
|
|
1229
1228
|
case 13: //FAN SPEED MODE 3
|
|
1230
|
-
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue;
|
|
1229
|
+
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue ?? deviceData.Device.SetFanSpeed;
|
|
1231
1230
|
deviceData.Device.Power = true;
|
|
1232
1231
|
deviceData.Device.SetFanSpeed = state ? 3 : button.previousValue;
|
|
1233
1232
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Power + CONSTANTS.Ventilation.EffectiveFlags.SetFanSpeed;
|
|
1234
1233
|
break;
|
|
1235
1234
|
case 14: //FAN MODE 4
|
|
1236
|
-
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue;
|
|
1235
|
+
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue ?? deviceData.Device.SetFanSpeed;
|
|
1237
1236
|
deviceData.Device.Power = true;
|
|
1238
1237
|
deviceData.Device.SetFanSpeed = state ? 4 : button.previousValue;
|
|
1239
1238
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Power + CONSTANTS.Ventilation.EffectiveFlags.SetFanSpeed;
|
|
@@ -1257,7 +1256,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1257
1256
|
};
|
|
1258
1257
|
|
|
1259
1258
|
await this.melCloudErv.send(deviceData);
|
|
1260
|
-
const info = this.disableLogInfo ? false : this.emit('message', `${state ?
|
|
1259
|
+
const info = this.disableLogInfo ? false : this.emit('message', `${state ? `Set: ${buttonName}` : `Unset: ${buttonName}, Set: ${button.previousValue}`}`);
|
|
1261
1260
|
} catch (error) {
|
|
1262
1261
|
this.emit('warn', `Set button error: ${error}`);
|
|
1263
1262
|
};
|
package/src/melcloudata.js
CHANGED
|
@@ -380,14 +380,17 @@ class MelCloudAta extends EventEmitter {
|
|
|
380
380
|
deviceData.Device.SetTemperature = deviceData.Device.SetTemperature < minTempCoolDry ? minTempCoolDry : deviceData.Device.SetTemperature;
|
|
381
381
|
deviceData.Device.SetTemperature = deviceData.Device.SetTemperature > maxTempCoolDry ? maxTempCoolDry : deviceData.Device.SetTemperature;
|
|
382
382
|
break;
|
|
383
|
+
case 7:
|
|
384
|
+
deviceData.Device.SetTemperature = deviceData.Device.SetTemperature < 10 ? 10 : deviceData.Device.SetTemperature;
|
|
385
|
+
deviceData.Device.SetTemperature = deviceData.Device.SetTemperature > 31 ? 31 : deviceData.Device.SetTemperature;
|
|
386
|
+
break;
|
|
383
387
|
case 8:
|
|
384
388
|
deviceData.Device.SetTemperature = deviceData.Device.SetTemperature < minTempAutomatic ? minTempAutomatic : deviceData.Device.SetTemperature;
|
|
385
389
|
deviceData.Device.SetTemperature = deviceData.Device.SetTemperature > maxTempAutomatic ? maxTempAutomatic : deviceData.Device.SetTemperature;
|
|
386
390
|
break;
|
|
387
391
|
default:
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
break;
|
|
392
|
+
this.emit('warn', `Trying to set nknown operating mode: ${deviceData.Device.OperationMode}`);
|
|
393
|
+
return;
|
|
391
394
|
};
|
|
392
395
|
|
|
393
396
|
const payload = {
|
|
@@ -402,8 +405,8 @@ class MelCloudAta extends EventEmitter {
|
|
|
402
405
|
VaneVertical: deviceData.Device.VaneVerticalDirection,
|
|
403
406
|
HideVaneControls: deviceData.Device.HideVaneControls,
|
|
404
407
|
HideDryModeControl: deviceData.Device.HideDryModeControl,
|
|
405
|
-
DefaultCoolingSetTemperature: deviceData.Device.DefaultCoolingSetTemperature ?? 23,
|
|
406
408
|
DefaultHeatingSetTemperature: deviceData.Device.DefaultHeatingSetTemperature ?? 21,
|
|
409
|
+
DefaultCoolingSetTemperature: deviceData.Device.DefaultCoolingSetTemperature ?? 23,
|
|
407
410
|
InStandbyMode: deviceData.Device.InStandbyMode,
|
|
408
411
|
ProhibitSetTemperature: deviceData.Device.ProhibitSetTemperature,
|
|
409
412
|
ProhibitOperationMode: deviceData.Device.ProhibitOperationMode,
|