homebridge-melcloud-control 3.3.13-beta.1 → 3.3.13
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 +8 -0
- package/README.md +7 -1
- package/package.json +1 -1
- package/src/deviceata.js +26 -28
- package/src/deviceerv.js +43 -39
- package/src/melcloudata.js +31 -28
- package/src/melclouderv.js +20 -7
package/CHANGELOG.md
CHANGED
|
@@ -16,6 +16,14 @@ 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.13] - (20.09.2024)
|
|
20
|
+
|
|
21
|
+
## Changes
|
|
22
|
+
|
|
23
|
+
- fix [#166](https://github.com/grzegorz914/homebridge-melcloud-control/issues/166)
|
|
24
|
+
- redme update with explanation of AUTO mode in Heather/Cooler and Thermostat mode
|
|
25
|
+
- cleanup
|
|
26
|
+
|
|
19
27
|
## [3.3.5] - (15.09.2024)
|
|
20
28
|
|
|
21
29
|
## Changes
|
package/README.md
CHANGED
|
@@ -164,7 +164,13 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
164
164
|
|
|
165
165
|
### AUTO Mode
|
|
166
166
|
|
|
167
|
-
*
|
|
167
|
+
* Heather/Coolert
|
|
168
|
+
* In this mode we can set heathing threshold and cooling threshold temperature:
|
|
169
|
+
* Target temperature is calculated as a middle value between `LO` and `HI` and the rest is calculated internally.
|
|
170
|
+
* Thermostat
|
|
171
|
+
* In this mode we can set only target temperature:
|
|
172
|
+
* Target temperature issend to device and calculated internally:
|
|
173
|
+
* Calculation method in device internally:
|
|
168
174
|
* If the room temperature `<` Heating Setpoint, the unit will be set to HEAT with a setpoint of 23°C.
|
|
169
175
|
* In HEAT, if the room temperature `>` Heating Setpoint `+` 1°C, the unit will be set to FAN.
|
|
170
176
|
* In FAN, if the room temperature `>` Cooling Setpoint, the unit will be set to COOL with a setpoint of 19°C.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "3.3.13
|
|
4
|
+
"version": "3.3.13",
|
|
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
|
@@ -234,8 +234,6 @@ class DeviceAta extends EventEmitter {
|
|
|
234
234
|
const maxTempHeat = deviceData.Device.MaxTempHeat ?? 31;
|
|
235
235
|
const minTempCoolDry = deviceData.Device.MinTempCoolDry ?? 16;
|
|
236
236
|
const maxTempCoolDry = deviceData.Device.MaxTempCoolDry ?? 31;
|
|
237
|
-
const minTempAutomatic = deviceData.Device.MinTempAutomatic ?? 16;
|
|
238
|
-
const maxTempAutomatic = deviceData.Device.MaxTempAutomatic ?? 31;
|
|
239
237
|
|
|
240
238
|
//device state
|
|
241
239
|
const power = deviceData.Device.Power ?? false;
|
|
@@ -677,67 +675,67 @@ class DeviceAta extends EventEmitter {
|
|
|
677
675
|
case 'Power':
|
|
678
676
|
deviceData.Device[key] = value;
|
|
679
677
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power;
|
|
680
|
-
set = await this.melCloudAta.send(deviceData);
|
|
678
|
+
set = await this.melCloudAta.send(deviceData, this.displayMode);
|
|
681
679
|
break;
|
|
682
680
|
case 'OperationMode':
|
|
683
681
|
deviceData.Device[key] = value;
|
|
684
682
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.OperationMode;
|
|
685
|
-
set = await this.melCloudAta.send(deviceData);
|
|
683
|
+
set = await this.melCloudAta.send(deviceData, this.displayMode);
|
|
686
684
|
break;
|
|
687
685
|
case 'SetTemperature':
|
|
688
686
|
deviceData.Device[key] = value;
|
|
689
687
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
690
|
-
set = await this.melCloudAta.send(deviceData);
|
|
688
|
+
set = await this.melCloudAta.send(deviceData, this.displayMode);
|
|
691
689
|
break;
|
|
692
690
|
case 'DefaultCoolingSetTemperature':
|
|
693
691
|
deviceData.Device[key] = value;
|
|
694
692
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
695
|
-
set = await this.melCloudAta.send(deviceData);
|
|
693
|
+
set = await this.melCloudAta.send(deviceData, this.displayMode);
|
|
696
694
|
break;
|
|
697
695
|
case 'DefaultHeatingSetTemperature':
|
|
698
696
|
deviceData.Device[key] = value;
|
|
699
697
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
700
|
-
set = await this.melCloudAta.send(deviceData);
|
|
698
|
+
set = await this.melCloudAta.send(deviceData, this.displayMode);
|
|
701
699
|
break;
|
|
702
700
|
case 'FanSpeed':
|
|
703
701
|
deviceData.Device[key] = value;
|
|
704
702
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
705
|
-
set = await this.melCloudAta.send(deviceData);
|
|
703
|
+
set = await this.melCloudAta.send(deviceData, this.displayMode);
|
|
706
704
|
break;
|
|
707
705
|
case 'VaneHorizontalDirection':
|
|
708
706
|
deviceData.Device[key] = value;
|
|
709
707
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.VaneHorizontal;
|
|
710
|
-
set = await this.melCloudAta.send(deviceData);
|
|
708
|
+
set = await this.melCloudAta.send(deviceData, this.displayMode);
|
|
711
709
|
break;
|
|
712
710
|
case 'VaneVerticalDirection':
|
|
713
711
|
deviceData.Device[key] = value;
|
|
714
712
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.VaneVertical;
|
|
715
|
-
set = await this.melCloudAta.send(deviceData);
|
|
713
|
+
set = await this.melCloudAta.send(deviceData, this.displayMode);
|
|
716
714
|
break;
|
|
717
715
|
case 'HideVaneControls':
|
|
718
716
|
deviceData[key] = value;
|
|
719
717
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Prohibit;
|
|
720
|
-
set = await this.melCloudAta.send(deviceData);
|
|
718
|
+
set = await this.melCloudAta.send(deviceData, this.displayMode);
|
|
721
719
|
break;
|
|
722
720
|
case 'HideDryModeControl':
|
|
723
721
|
deviceData[key] = value;
|
|
724
722
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Prohibit;
|
|
725
|
-
await this.melCloudAta.send(deviceData);
|
|
723
|
+
await this.melCloudAta.send(deviceData, this.displayMode);
|
|
726
724
|
break;
|
|
727
725
|
case 'ProhibitSetTemperature':
|
|
728
726
|
deviceData.Device[key] = value;
|
|
729
727
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Prohibit;
|
|
730
|
-
set = await this.melCloudAta.send(deviceData);
|
|
728
|
+
set = await this.melCloudAta.send(deviceData, this.displayMode);
|
|
731
729
|
break;
|
|
732
730
|
case 'ProhibitOperationMode':
|
|
733
731
|
deviceData.Device[key] = value;
|
|
734
732
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Prohibit;
|
|
735
|
-
await this.melCloudAta.send(deviceData);
|
|
733
|
+
await this.melCloudAta.send(deviceData, this.displayMode);
|
|
736
734
|
break;
|
|
737
735
|
case 'ProhibitPower':
|
|
738
736
|
deviceData.Device[key] = value;
|
|
739
737
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Prohibit;
|
|
740
|
-
set = await this.melCloudAta.send(deviceData);
|
|
738
|
+
set = await this.melCloudAta.send(deviceData, this.displayMode);
|
|
741
739
|
break;
|
|
742
740
|
default:
|
|
743
741
|
this.emit('warn', `${integration}, received key: ${key}, value: ${value}`);
|
|
@@ -796,7 +794,7 @@ class DeviceAta extends EventEmitter {
|
|
|
796
794
|
try {
|
|
797
795
|
deviceData.Device.Power = [false, true][state];
|
|
798
796
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Power;
|
|
799
|
-
await this.melCloudAta.send(deviceData);
|
|
797
|
+
await this.melCloudAta.send(deviceData, this.displayMode);
|
|
800
798
|
const info = this.disableLogInfo ? false : this.emit('message', `Set power: ${state ? 'ON' : 'OFF'}`);
|
|
801
799
|
} catch (error) {
|
|
802
800
|
this.emit('warn', `Set power error: ${error}`);
|
|
@@ -832,7 +830,7 @@ class DeviceAta extends EventEmitter {
|
|
|
832
830
|
};
|
|
833
831
|
|
|
834
832
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.OperationMode;
|
|
835
|
-
await this.melCloudAta.send(deviceData);
|
|
833
|
+
await this.melCloudAta.send(deviceData, this.displayMode);
|
|
836
834
|
const operationModeText = CONSTANTS.AirConditioner.DriveMode[deviceData.Device.OperationMode];
|
|
837
835
|
const info = this.disableLogInfo ? false : this.emit('message', `Set operation mode: ${operationModeText}`);
|
|
838
836
|
} catch (error) {
|
|
@@ -882,7 +880,7 @@ class DeviceAta extends EventEmitter {
|
|
|
882
880
|
};
|
|
883
881
|
|
|
884
882
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
885
|
-
await this.melCloudAta.send(deviceData);
|
|
883
|
+
await this.melCloudAta.send(deviceData, this.displayMode);
|
|
886
884
|
const info = this.disableLogInfo ? false : this.emit('message', `Set fan speed mode: ${CONSTANTS.AirConditioner.FanSpeed[fanSpeedModeText]}`);
|
|
887
885
|
} catch (error) {
|
|
888
886
|
this.emit('warn', `Set fan speed mode error: ${error}`);
|
|
@@ -901,7 +899,7 @@ class DeviceAta extends EventEmitter {
|
|
|
901
899
|
deviceData.Device.VaneHorizontal = value ? 12 : 0;
|
|
902
900
|
deviceData.Device.VaneVertical = value ? 7 : 0;
|
|
903
901
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.VaneHorizontal + CONSTANTS.AirConditioner.EffectiveFlags.VaneVertical;
|
|
904
|
-
await this.melCloudAta.send(deviceData);
|
|
902
|
+
await this.melCloudAta.send(deviceData, this.displayMode);
|
|
905
903
|
const info = this.disableLogInfo ? false : this.emit('message', `Set air direction mode: ${CONSTANTS.AirConditioner.AirDirection[value]}`);
|
|
906
904
|
} catch (error) {
|
|
907
905
|
this.emit('warn', `Set vane swing mode error: ${error}`);
|
|
@@ -922,7 +920,7 @@ class DeviceAta extends EventEmitter {
|
|
|
922
920
|
try {
|
|
923
921
|
deviceData.Device.DefaultCoolingSetTemperature = value;
|
|
924
922
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
925
|
-
await this.melCloudAta.send(deviceData);
|
|
923
|
+
await this.melCloudAta.send(deviceData, this.displayMode);
|
|
926
924
|
const info = this.disableLogInfo ? false : this.emit('message', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
927
925
|
} catch (error) {
|
|
928
926
|
this.emit('warn', `Set cooling threshold temperature error: ${error}`);
|
|
@@ -943,7 +941,7 @@ class DeviceAta extends EventEmitter {
|
|
|
943
941
|
try {
|
|
944
942
|
deviceData.Device.DefaultHeatingSetTemperature = value;
|
|
945
943
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
946
|
-
await this.melCloudAta.send(deviceData);
|
|
944
|
+
await this.melCloudAta.send(deviceData, this.displayMode);
|
|
947
945
|
const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
948
946
|
} catch (error) {
|
|
949
947
|
this.emit('warn', `Set heating threshold temperature error: ${error}`);
|
|
@@ -962,7 +960,7 @@ class DeviceAta extends EventEmitter {
|
|
|
962
960
|
deviceData.Device.ProhibitOperationMode = value;
|
|
963
961
|
deviceData.Device.ProhibitPower = value;
|
|
964
962
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.Prohibit;
|
|
965
|
-
await this.melCloudAta.send(deviceData);
|
|
963
|
+
await this.melCloudAta.send(deviceData, this.displayMode);
|
|
966
964
|
const info = this.disableLogInfo ? false : this.emit('message', `Set local physical controls: ${value ? 'LOCK' : 'UNLOCK'}`);
|
|
967
965
|
} catch (error) {
|
|
968
966
|
this.emit('warn', `Set lock physical controls error: ${error}`);
|
|
@@ -1027,7 +1025,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1027
1025
|
break;
|
|
1028
1026
|
};
|
|
1029
1027
|
|
|
1030
|
-
await this.melCloudAta.send(deviceData);
|
|
1028
|
+
await this.melCloudAta.send(deviceData, this.displayMode);
|
|
1031
1029
|
const operationModeText = CONSTANTS.AirConditioner.DriveMode[deviceData.Device.OperationMode];
|
|
1032
1030
|
const info = this.disableLogInfo ? false : this.emit('message', `Set operation mode: ${operationModeText}`);
|
|
1033
1031
|
} catch (error) {
|
|
@@ -1041,8 +1039,8 @@ class DeviceAta extends EventEmitter {
|
|
|
1041
1039
|
});
|
|
1042
1040
|
this.melCloudService.getCharacteristic(Characteristic.TargetTemperature)
|
|
1043
1041
|
.setProps({
|
|
1044
|
-
minValue:
|
|
1045
|
-
maxValue:
|
|
1042
|
+
minValue: this.accessory.minTempHeat,
|
|
1043
|
+
maxValue: this.accessory.maxTempHeat,
|
|
1046
1044
|
minStep: this.accessory.temperatureIncrement
|
|
1047
1045
|
})
|
|
1048
1046
|
.onGet(async () => {
|
|
@@ -1053,7 +1051,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1053
1051
|
try {
|
|
1054
1052
|
deviceData.Device.SetTemperature = value;
|
|
1055
1053
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
1056
|
-
await this.melCloudAta.send(deviceData);
|
|
1054
|
+
await this.melCloudAta.send(deviceData, this.displayMode);
|
|
1057
1055
|
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
1058
1056
|
} catch (error) {
|
|
1059
1057
|
this.emit('warn', `Set temperature error: ${error}`);
|
|
@@ -1165,7 +1163,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1165
1163
|
break;
|
|
1166
1164
|
};
|
|
1167
1165
|
|
|
1168
|
-
await this.melCloudAta.send(deviceData);
|
|
1166
|
+
await this.melCloudAta.send(deviceData, this.displayMode);
|
|
1169
1167
|
const info = this.disableLogInfo ? false : this.emit('message', `${state ? 'Set:' : 'Unset:'} ${presetName}`);
|
|
1170
1168
|
} catch (error) {
|
|
1171
1169
|
this.emit('warn', `Set preset error: ${error}`);
|
|
@@ -1408,7 +1406,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1408
1406
|
break;
|
|
1409
1407
|
};
|
|
1410
1408
|
|
|
1411
|
-
await this.melCloudAta.send(deviceData);
|
|
1409
|
+
await this.melCloudAta.send(deviceData, this.displayMode);
|
|
1412
1410
|
const info = this.disableLogInfo ? false : this.emit('message', `${state ? `Set: ${buttonName}` : `Unset: ${buttonName}, Set: ${button.previousValue}`}`);
|
|
1413
1411
|
} catch (error) {
|
|
1414
1412
|
this.emit('warn', `Set button error: ${error}`);
|
package/src/deviceerv.js
CHANGED
|
@@ -237,6 +237,10 @@ class DeviceErv extends EventEmitter {
|
|
|
237
237
|
const actualVentilationMode = deviceData.Device.ActualVentilationMode;
|
|
238
238
|
const numberOfFanSpeeds = deviceData.Device.NumberOfFanSpeeds ?? 0;
|
|
239
239
|
const temperatureIncrement = deviceData.Device.TemperatureIncrement ?? 1;
|
|
240
|
+
const minTempHeat = deviceData.Device.MinTempHeat ?? 10;
|
|
241
|
+
const maxTempHeat = deviceData.Device.MaxTempHeat ?? 31;
|
|
242
|
+
const minTempCoolDry = deviceData.Device.MinTempCoolDry ?? 16;
|
|
243
|
+
const maxTempCoolDry = deviceData.Device.MaxTempCoolDry ?? 31;
|
|
240
244
|
|
|
241
245
|
//device state
|
|
242
246
|
const power = deviceData.Device.Power ?? false;
|
|
@@ -284,8 +288,12 @@ class DeviceErv extends EventEmitter {
|
|
|
284
288
|
this.accessory.defaultCoolingSetTemperature = defaultCoolingSetTemperature;
|
|
285
289
|
this.accessory.lockPhysicalControl = 0;
|
|
286
290
|
this.accessory.temperatureIncrement = temperatureIncrement;
|
|
291
|
+
this.accessory.minTempHeat = minTempHeat;
|
|
292
|
+
this.accessory.temperatureIncrement = maxTempHeat;
|
|
293
|
+
this.accessory.minTempCoolDry = minTempCoolDry;
|
|
294
|
+
this.accessory.maxTempCoolDry = maxTempCoolDry;
|
|
287
295
|
|
|
288
|
-
//
|
|
296
|
+
//ventilation mode - 0, HEAT, 2, COOL, 4, 5, 6, FAN, AUTO
|
|
289
297
|
switch (this.displayMode) {
|
|
290
298
|
case 1: //Heater Cooler
|
|
291
299
|
switch (power) {
|
|
@@ -354,8 +362,8 @@ class DeviceErv extends EventEmitter {
|
|
|
354
362
|
.updateCharacteristic(Characteristic.RotationSpeed, this.accessory.fanSpeed)
|
|
355
363
|
.updateCharacteristic(Characteristic.LockPhysicalControls, this.accessory.lockPhysicalControl)
|
|
356
364
|
.updateCharacteristic(Characteristic.TemperatureDisplayUnits, this.accessory.useFahrenheit);
|
|
357
|
-
const updateDefCool = hasCoolOperationMode ? this.melCloudService.updateCharacteristic(Characteristic.CoolingThresholdTemperature,
|
|
358
|
-
const updateDefHeat = hasHeatOperationMode ? this.melCloudService.updateCharacteristic(Characteristic.HeatingThresholdTemperature,
|
|
365
|
+
const updateDefCool = hasCoolOperationMode ? this.melCloudService.updateCharacteristic(Characteristic.CoolingThresholdTemperature, defaultCoolingSetTemperature) : false;
|
|
366
|
+
const updateDefHeat = hasHeatOperationMode ? this.melCloudService.updateCharacteristic(Characteristic.HeatingThresholdTemperature, defaultHeatingSetTemperature) : false;
|
|
359
367
|
};
|
|
360
368
|
break;
|
|
361
369
|
case 2: //Thermostat
|
|
@@ -539,7 +547,7 @@ class DeviceErv extends EventEmitter {
|
|
|
539
547
|
if (!this.disableLogInfo) {
|
|
540
548
|
this.emit('message', `Power: ${power ? 'ON' : 'OFF'}`);
|
|
541
549
|
this.emit('message', `Target ventilation mode: ${CONSTANTS.Ventilation.OperationMode[ventilationMode]}`);
|
|
542
|
-
this.emit('message', `Current
|
|
550
|
+
this.emit('message', `Current ventilation mode: ${CONSTANTS.Ventilation.OperationMode[actualVentilationMode]}`);
|
|
543
551
|
this.emit('message', `Target temperature: ${targetTemperature}${this.accessory.temperatureUnit}`);
|
|
544
552
|
this.emit('message', `Room temperature: ${roomTemperature}${this.accessory.temperatureUnit}`);
|
|
545
553
|
const info1 = hasSupplyTemperature && deviceData.Device.SupplyTemperature !== null ? this.emit('message', `Supply temperature: ${roomTemperature}${this.accessory.temperatureUnit}`) : false;
|
|
@@ -599,57 +607,57 @@ class DeviceErv extends EventEmitter {
|
|
|
599
607
|
case 'Power':
|
|
600
608
|
deviceData.Device[key] = value;
|
|
601
609
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Power;
|
|
602
|
-
set = await this.melCloudErv.send(deviceData);
|
|
610
|
+
set = await this.melCloudErv.send(deviceData, this.displayMode);
|
|
603
611
|
break;
|
|
604
612
|
case 'OperationMode':
|
|
605
613
|
deviceData.Device[key] = value;
|
|
606
614
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.OperationMode;
|
|
607
|
-
set = await this.melCloudErv.send(deviceData);
|
|
615
|
+
set = await this.melCloudErv.send(deviceData, this.displayMode);
|
|
608
616
|
break;
|
|
609
617
|
case 'VentilationMode':
|
|
610
618
|
deviceData.Device[key] = value;
|
|
611
619
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.VentilationMode;
|
|
612
|
-
set = await this.melCloudErv.send(deviceData);
|
|
620
|
+
set = await this.melCloudErv.send(deviceData, this.displayMode);
|
|
613
621
|
break;
|
|
614
622
|
case 'SetTemperature':
|
|
615
623
|
deviceData.Device[key] = value;
|
|
616
624
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
|
|
617
|
-
set = await this.melCloudErv.send(deviceData);
|
|
625
|
+
set = await this.melCloudErv.send(deviceData, this.displayMode);
|
|
618
626
|
break;
|
|
619
627
|
case 'DefaultCoolingSetTemperature':
|
|
620
628
|
deviceData.Device[key] = value;
|
|
621
629
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
|
|
622
|
-
set = await this.melCloudErv.send(deviceData);
|
|
630
|
+
set = await this.melCloudErv.send(deviceData, this.displayMode);
|
|
623
631
|
break;
|
|
624
632
|
case 'DefaultHeatingSetTemperature':
|
|
625
633
|
deviceData.Device[key] = value;
|
|
626
634
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
|
|
627
|
-
set = await this.melCloudErv.send(deviceData);
|
|
635
|
+
set = await this.melCloudErv.send(deviceData, this.displayMode);
|
|
628
636
|
break;
|
|
629
637
|
case 'NightPurgeMode':
|
|
630
638
|
deviceData.Device[key] = value;
|
|
631
639
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.NightPurgeMode;
|
|
632
|
-
set = await this.melCloudErv.send(deviceData);
|
|
640
|
+
set = await this.melCloudErv.send(deviceData, this.displayMode);
|
|
633
641
|
break;
|
|
634
642
|
case 'SetFanSpeed':
|
|
635
643
|
deviceData.Device[key] = value;
|
|
636
644
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetFanSpeed;
|
|
637
|
-
set = await this.melCloudErv.send(deviceData);
|
|
645
|
+
set = await this.melCloudErv.send(deviceData, this.displayMode);
|
|
638
646
|
break;
|
|
639
647
|
case 'HideRoomTemperature':
|
|
640
648
|
deviceData[key] = value;
|
|
641
649
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Prohibit;
|
|
642
|
-
set = await this.melCloudErv.send(deviceData);
|
|
650
|
+
set = await this.melCloudErv.send(deviceData, this.displayMode);
|
|
643
651
|
break;
|
|
644
652
|
case 'HideSupplyTemperature':
|
|
645
653
|
deviceData[key] = value;
|
|
646
654
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Prohibit;
|
|
647
|
-
set = await this.melCloudErv.send(deviceData);
|
|
655
|
+
set = await this.melCloudErv.send(deviceData, this.displayMode);
|
|
648
656
|
break;
|
|
649
657
|
case 'HideOutdoorTemperature':
|
|
650
658
|
deviceData[key] = value;
|
|
651
659
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Prohibit;
|
|
652
|
-
set = await this.melCloudErv.send(deviceData);
|
|
660
|
+
set = await this.melCloudErv.send(deviceData, this.displayMode);
|
|
653
661
|
break;
|
|
654
662
|
default:
|
|
655
663
|
this.emit('warn', `${integration}, received key: ${key}, value: ${value}`);
|
|
@@ -706,7 +714,7 @@ class DeviceErv extends EventEmitter {
|
|
|
706
714
|
try {
|
|
707
715
|
deviceData.Device.Power = [false, true][state];
|
|
708
716
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Power;
|
|
709
|
-
await this.melCloudErv.send(deviceData);
|
|
717
|
+
await this.melCloudErv.send(deviceData, this.displayMode);
|
|
710
718
|
const info = this.disableLogInfo ? false : this.emit('message', `Set power: ${state ? 'ON' : 'OFF'}`);
|
|
711
719
|
} catch (error) {
|
|
712
720
|
this.emit('warn', `Set power error: ${error}`);
|
|
@@ -742,7 +750,7 @@ class DeviceErv extends EventEmitter {
|
|
|
742
750
|
};
|
|
743
751
|
|
|
744
752
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.VentilationMode;
|
|
745
|
-
await this.melCloudErv.send(deviceData);
|
|
753
|
+
await this.melCloudErv.send(deviceData, this.displayMode);
|
|
746
754
|
const operationModeText = CONSTANTS.Ventilation.VentilationMode[deviceData.Device.VentilationMode];
|
|
747
755
|
const info = this.disableLogInfo ? false : this.emit('message', `Set operation mode: ${operationModeText}`);
|
|
748
756
|
} catch (error) {
|
|
@@ -783,7 +791,7 @@ class DeviceErv extends EventEmitter {
|
|
|
783
791
|
};
|
|
784
792
|
|
|
785
793
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetFanSpeed;
|
|
786
|
-
await this.melCloudErv.send(deviceData);
|
|
794
|
+
await this.melCloudErv.send(deviceData, this.displayMode);
|
|
787
795
|
const info = this.disableLogInfo ? false : this.emit('message', `Set fan speed mode: ${CONSTANTS.Ventilation.FanSpeed[fanSpeedModeText]}`);
|
|
788
796
|
} catch (error) {
|
|
789
797
|
this.emit('warn', `Set fan speed mode error: ${error}`);
|
|
@@ -793,8 +801,8 @@ class DeviceErv extends EventEmitter {
|
|
|
793
801
|
if (hasAutoVentilationMode && hasCoolOperationMode) {
|
|
794
802
|
this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
|
|
795
803
|
.setProps({
|
|
796
|
-
minValue:
|
|
797
|
-
maxValue:
|
|
804
|
+
minValue: this.accessory.minTempCoolDry,
|
|
805
|
+
maxValue: this.accessory.maxTempCoolDry,
|
|
798
806
|
minStep: this.accessory.temperatureIncrement
|
|
799
807
|
})
|
|
800
808
|
.onGet(async () => {
|
|
@@ -803,10 +811,10 @@ class DeviceErv extends EventEmitter {
|
|
|
803
811
|
})
|
|
804
812
|
.onSet(async (value) => {
|
|
805
813
|
try {
|
|
806
|
-
deviceData.Device.
|
|
814
|
+
deviceData.Device.DefaultCoolingSetTemperature = value;
|
|
807
815
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
808
|
-
await this.melCloudErv.send(deviceData);
|
|
809
|
-
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
816
|
+
await this.melCloudErv.send(deviceData, this.displayMode);
|
|
817
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
810
818
|
} catch (error) {
|
|
811
819
|
this.emit('warn', `Set cooling threshold temperature error: ${error}`);
|
|
812
820
|
};
|
|
@@ -816,8 +824,8 @@ class DeviceErv extends EventEmitter {
|
|
|
816
824
|
if (hasAutoVentilationMode && hasHeatOperationMode) {
|
|
817
825
|
this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
|
|
818
826
|
.setProps({
|
|
819
|
-
minValue:
|
|
820
|
-
maxValue:
|
|
827
|
+
minValue: this.accessory.minTempHeat,
|
|
828
|
+
maxValue: this.accessory.maxTempHeat,
|
|
821
829
|
minStep: this.accessory.temperatureIncrement
|
|
822
830
|
})
|
|
823
831
|
.onGet(async () => {
|
|
@@ -826,14 +834,10 @@ class DeviceErv extends EventEmitter {
|
|
|
826
834
|
})
|
|
827
835
|
.onSet(async (value) => {
|
|
828
836
|
try {
|
|
829
|
-
|
|
830
|
-
this.melCloudService.updateCharacteristic(Characteristic.HeatingThresholdTemperature, 10)
|
|
831
|
-
return;
|
|
832
|
-
};
|
|
833
|
-
|
|
837
|
+
deviceData.Device.DefaultHeatingSetTemperature = value;
|
|
834
838
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
|
|
835
|
-
await this.melCloudErv.send(deviceData);
|
|
836
|
-
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
839
|
+
await this.melCloudErv.send(deviceData, this.displayMode);
|
|
840
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
837
841
|
} catch (error) {
|
|
838
842
|
this.emit('warn', `Set heating threshold temperature error: ${error}`);
|
|
839
843
|
};
|
|
@@ -850,7 +854,7 @@ class DeviceErv extends EventEmitter {
|
|
|
850
854
|
// value = value ? true : false;
|
|
851
855
|
// deviceData.Device = deviceData.Device;
|
|
852
856
|
// deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.Prohibit;
|
|
853
|
-
// await this.melCloudErv.send(deviceData);
|
|
857
|
+
// await this.melCloudErv.send(deviceData, this.displayMode);
|
|
854
858
|
// const info = this.disableLogInfo ? false : this.emit('message', `Set local physical controls: ${value ? 'LOCK' : 'UNLOCK'}`);
|
|
855
859
|
// } catch (error) {
|
|
856
860
|
// this.emit('warn', `Set lock physical controls error: ${error}`);
|
|
@@ -915,7 +919,7 @@ class DeviceErv extends EventEmitter {
|
|
|
915
919
|
break;
|
|
916
920
|
};
|
|
917
921
|
|
|
918
|
-
await this.melCloudErv.send(deviceData);
|
|
922
|
+
await this.melCloudErv.send(deviceData, this.displayMode);
|
|
919
923
|
const operationModeText = CONSTANTS.Ventilation.VentilationMode[deviceData.Device.VentilationMode];
|
|
920
924
|
const info = this.disableLogInfo ? false : this.emit('message', `Set operation mode: ${operationModeText}`);
|
|
921
925
|
} catch (error) {
|
|
@@ -929,8 +933,8 @@ class DeviceErv extends EventEmitter {
|
|
|
929
933
|
});
|
|
930
934
|
this.melCloudService.getCharacteristic(Characteristic.TargetTemperature)
|
|
931
935
|
.setProps({
|
|
932
|
-
minValue:
|
|
933
|
-
maxValue:
|
|
936
|
+
minValue: this.accessory.minTempHeat,
|
|
937
|
+
maxValue: this.accessory.maxTempHeat,
|
|
934
938
|
minStep: this.accessory.temperatureIncrement
|
|
935
939
|
})
|
|
936
940
|
.onGet(async () => {
|
|
@@ -941,7 +945,7 @@ class DeviceErv extends EventEmitter {
|
|
|
941
945
|
try {
|
|
942
946
|
deviceData.Device.SetTemperature = value;
|
|
943
947
|
deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
|
|
944
|
-
await this.melCloudErv.send(deviceData);
|
|
948
|
+
await this.melCloudErv.send(deviceData, this.displayMode);
|
|
945
949
|
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
946
950
|
} catch (error) {
|
|
947
951
|
this.emit('warn', `Set temperature error: ${error}`);
|
|
@@ -1135,7 +1139,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1135
1139
|
break;
|
|
1136
1140
|
};
|
|
1137
1141
|
|
|
1138
|
-
await this.melCloudErv.send(deviceData);
|
|
1142
|
+
await this.melCloudErv.send(deviceData, this.displayMode);
|
|
1139
1143
|
const info = this.disableLogInfo ? false : this.emit('message', `${state ? 'Set:' : 'Unset:'} ${presetName}`);
|
|
1140
1144
|
} catch (error) {
|
|
1141
1145
|
this.emit('warn', `Set preset error: ${error}`);
|
|
@@ -1252,7 +1256,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1252
1256
|
break;
|
|
1253
1257
|
};
|
|
1254
1258
|
|
|
1255
|
-
await this.melCloudErv.send(deviceData);
|
|
1259
|
+
await this.melCloudErv.send(deviceData, this.displayMode);
|
|
1256
1260
|
const info = this.disableLogInfo ? false : this.emit('message', `${state ? `Set: ${buttonName}` : `Unset: ${buttonName}, Set: ${button.previousValue}`}`);
|
|
1257
1261
|
} catch (error) {
|
|
1258
1262
|
this.emit('warn', `Set button error: ${error}`);
|
package/src/melcloudata.js
CHANGED
|
@@ -367,38 +367,41 @@ class MelCloudAta extends EventEmitter {
|
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
-
async send(deviceData) {
|
|
370
|
+
async send(deviceData, displayMode) {
|
|
371
371
|
try {
|
|
372
|
-
//
|
|
373
|
-
switch (
|
|
372
|
+
//set target temp based on current mode
|
|
373
|
+
switch (displayMode) {
|
|
374
374
|
case 1:
|
|
375
|
-
deviceData.Device.
|
|
376
|
-
|
|
375
|
+
switch (deviceData.Device.OperationMode) {//operating mode 0, HEAT, DRY, COOL, 4, 5, 6, FAN, AUTO, ISEE HEAT, ISEE DRY, ISEE COOL
|
|
376
|
+
case 1:
|
|
377
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultHeatingSetTemperature;
|
|
378
|
+
break;
|
|
379
|
+
case 2:
|
|
380
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
381
|
+
break;
|
|
382
|
+
case 3:
|
|
383
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
384
|
+
break;
|
|
385
|
+
case 7:
|
|
386
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
387
|
+
break;
|
|
388
|
+
case 8:
|
|
389
|
+
const setTemp = (deviceData.Device.DefaultCoolingSetTemperature + deviceData.Device.DefaultHeatingSetTemperature) / 2;
|
|
390
|
+
deviceData.Device.SetTemperature = setTemp;
|
|
391
|
+
break;
|
|
392
|
+
case 9:
|
|
393
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultHeatingSetTemperature;
|
|
394
|
+
break;
|
|
395
|
+
case 10:
|
|
396
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
397
|
+
break;
|
|
398
|
+
case 11:
|
|
399
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
400
|
+
break;
|
|
401
|
+
};
|
|
377
402
|
case 2:
|
|
378
|
-
deviceData.Device.SetTemperature = deviceData.Device.
|
|
379
|
-
break;
|
|
380
|
-
case 3:
|
|
381
|
-
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
382
|
-
break;
|
|
383
|
-
case 7:
|
|
384
|
-
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
385
|
-
break;
|
|
386
|
-
case 8:
|
|
387
|
-
const setTemp = (deviceData.Device.DefaultCoolingSetTemperature + deviceData.Device.DefaultHeatingSetTemperature) / 2;
|
|
388
|
-
deviceData.Device.SetTemperature = setTemp;
|
|
389
|
-
break;
|
|
390
|
-
case 9:
|
|
391
|
-
deviceData.Device.SetTemperature = deviceData.Device.DefaultHeatingSetTemperature;
|
|
392
|
-
break;
|
|
393
|
-
case 10:
|
|
394
|
-
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
395
|
-
break;
|
|
396
|
-
case 11:
|
|
397
|
-
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
403
|
+
deviceData.Device.SetTemperature = deviceData.Device.SetTemperature;
|
|
398
404
|
break;
|
|
399
|
-
default:
|
|
400
|
-
this.emit('warn', `Trying to set nknown operating mode: ${deviceData.Device.OperationMode}`);
|
|
401
|
-
return;
|
|
402
405
|
};
|
|
403
406
|
|
|
404
407
|
const payload = {
|
package/src/melclouderv.js
CHANGED
|
@@ -354,14 +354,27 @@ class MelCloudErv extends EventEmitter {
|
|
|
354
354
|
throw new Error(`Read data error: ${error.message ?? error}`);
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
|
|
358
|
-
async send(deviceData) {
|
|
357
|
+
async send(deviceData, displayMode) {
|
|
359
358
|
try {
|
|
360
|
-
//
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
359
|
+
//set target temp based on current mode
|
|
360
|
+
switch (displayMode) {
|
|
361
|
+
case 1:
|
|
362
|
+
switch (deviceData.Device.VentilationMode) {//LOSNAY, BYPASS, AUTO
|
|
363
|
+
case 0:
|
|
364
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultHeatingSetTemperature;
|
|
365
|
+
break;
|
|
366
|
+
case 1:
|
|
367
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
368
|
+
break;
|
|
369
|
+
case 2:
|
|
370
|
+
const setTemp = (deviceData.Device.DefaultCoolingSetTemperature + deviceData.Device.DefaultHeatingSetTemperature) / 2;
|
|
371
|
+
deviceData.Device.SetTemperature = setTemp;
|
|
372
|
+
break;
|
|
373
|
+
};
|
|
374
|
+
case 2:
|
|
375
|
+
deviceData.Device.SetTemperature = deviceData.Device.SetTemperature;
|
|
376
|
+
break;
|
|
377
|
+
};
|
|
365
378
|
|
|
366
379
|
//device state
|
|
367
380
|
const payload = {
|