homebridge-melcloud-control 4.0.2 → 4.0.3-beta.1
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/package.json +2 -2
- package/src/constants.js +39 -28
- package/src/deviceatw.js +11 -11
- package/src/deviceerv.js +16 -19
- package/src/melcloudatw.js +26 -30
- package/src/melclouderv.js +3 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.3-beta.1",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"async-mqtt": "^2.6.3",
|
|
40
40
|
"axios": "^1.13.2",
|
|
41
41
|
"express": "^5.1.0",
|
|
42
|
-
"puppeteer-core": "^24.29.
|
|
42
|
+
"puppeteer-core": "^24.29.1",
|
|
43
43
|
"util": "^0.12.5"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
package/src/constants.js
CHANGED
|
@@ -71,22 +71,22 @@ export const AirConditioner = {
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
export const HeatPump = {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
74
|
+
SystemMapEnumToString: { 0: "SystemOff", 1: "SystemOn", 2: "Emergency Run", 3: "Test Run" },
|
|
75
|
+
ZoneNameMapEnumToString: { 0: "Heat Pump", 1: "Zone 1", 2: "Hot Water", 3: "Zone 2" },
|
|
76
|
+
ControlTypeMapStringToEnum: { "Heat": 0, "Cool": 1 },
|
|
77
|
+
ControlTypeMapEnumToString: { 0: "Heat", 1: "Cool" },
|
|
78
|
+
DefrostMapStringToEnum: { "Normal": 0, "Standby": 1, "Defrost": 2, "Waiting Restart": 3 },
|
|
79
|
+
DefrostMapEnumToString: { 0: "Normal", 1: "Standby", 2: "Defrost", 3: "Waiting Restart" },
|
|
80
|
+
OperationModeMapStringToEnum: { "Idle": 0, "Hot Water": 1, "Heat Zones": 2, "Cool": 3, "Hot Water Storage": 4, "FreezeStat": 5, "Legionella": 6, "Heat Eco": 7, "Mode 1": 8, "Mode 2": 9, "Mode 3": 10, "Heat Up": 11 },
|
|
81
|
+
OperationModeMapEnumToString: { 0: "Idle", 1: "Hot Water", 2: "Heat Zones", 3: "Cool", 4: "Hot Water Storage", 5: "FreezeStat", 6: "Legionella", 7: "Heat Eco", 8: "Mode 1", 9: "Mode 2", 10: "Mode 3", 11: "Heat Up" },
|
|
82
|
+
OperationModeDhwMapStringToEnum: { "Normal": 0, "Eco": 1 },
|
|
83
|
+
OperationModeDhwMapEnumToString: { 0: "Normal", 1: "Eco" },
|
|
84
|
+
ForceDhwMapStringToEnum: { "Normal": 0, "Heat Now": 1 },
|
|
85
|
+
ForceDhwMapEnumToString: { 0: "Normal", 1: "Heat Now" },
|
|
86
|
+
HolidayMapStringToEnum: { "Normal": 0, "Holiday": 1 },
|
|
87
|
+
HolidayMapEnumToString: { 0: "Normal", 1: "Holiday" },
|
|
88
|
+
ZoneOperationMapStringToEnum: { "Heat Thermostat": 0, "Heat Flow": 1, "Heat Curve": 2, "Cool Thermostat": 3, "Cool Flow": 4, "Flor Dry Up": 5, "Idle": 6 },
|
|
89
|
+
ZoneOperationMapEnumToString: { 0: "Heat Thermostat", 1: "Heat Flow", 2: "Heat Curve", 3: "Cool Thermostat", 4: "Cool Flow", 5: "Flor Dry Up", 6: "Idle" },
|
|
90
90
|
EffectiveFlags: {
|
|
91
91
|
Power: 1,
|
|
92
92
|
OperationMode: 2,
|
|
@@ -118,20 +118,31 @@ export const HeatPump = {
|
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
export const Ventilation = {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
121
|
+
SystemMapEnymToString: { 0: "Ventilation Off", 1: "Ventilation On", 2: "Ventilation Offline" },
|
|
122
|
+
OperationModeMapStringToEnum: { "0": 0, "HEAT": 1, "2": 2, "COOL": 3, "4": 4, "5": 5, "6": 6, "Fan": 7, "Auto": 8 },
|
|
123
|
+
OperationModeMapEnumToString: { 0: "0", 1: "Heat", 2: "2", 3: "Cool", 4: "4", 5: "5", 6: "6", 7: "Fan", 8: "Auto" },
|
|
124
|
+
ActualOperationModeMapStringToEnum: { "Not Auto": 0, "Deterermining": 1, "Heating": 2, "Cooling": 3 },
|
|
125
|
+
ActualOperationModeMapEnumToString: { 0: "Not Auto", 1: "Deterermining", 2: "Heating", 3: "Cooling" },
|
|
126
|
+
AutoFanSpeedControlMapStringToEnum: { "Not Available": 0, "Available": 1 },
|
|
127
|
+
AutoFanSpeedControlMapEnumToString: { 0: "Not Available", 1: "Available" },
|
|
128
|
+
NightPurgeMapStringToEnum: { "Normal": 0, "Night Purge": 1 },
|
|
129
|
+
NightPurgeMapEnumToString: { 0: "Normal", 1: "Night Purge" },
|
|
130
|
+
VentilationModeMapStringToEnum: { "Lossnay": 0, "Bypass": 1, "Auto": 2 },
|
|
131
|
+
VentilationModeMapEnumToString: { 0: "Lossnay", 1: "Bypass", 2: "Auto" },
|
|
132
|
+
FanSpeedMapStringToEnum: { "Auto": 0, "1": 1, "2": 2, "3": 3, "4": 4, "Off": 5 },
|
|
133
|
+
FanSpeedMapEnumToString: { 0: "Auto", 1: "1", 2: "2", 3: "3", 4: "4", 5: "Off" },
|
|
134
|
+
ActualVentilationModeMapStringToEnum: { "Lossnay": 0, "Bypass": 1 },
|
|
135
|
+
ActualVentilationModeMapEnumToString: { 0: "Lossnay", 1: "Bypass" },
|
|
129
136
|
ActualSupplyFanSpeed: ["STOP", "1", "2", "3", "4"],
|
|
130
137
|
ActualExtractFanSpeed: ["STOP", "1", "2", "3", "4"],
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
138
|
+
Co2DetectedMapStringToEnum: { "NO": 0, "YES": 1 },
|
|
139
|
+
Co2DetectedMapEnumToString: { 0: "NO", 1: "YES" },
|
|
140
|
+
PM25AirQualityMapStringToEnum: { "Unknown": 0, "Excellent": 1, "Good": 2, "Fair": 3, "Inferior": 4, "Poor": 5 },
|
|
141
|
+
PM25AirQualityMapEnumToString: { 0: "Unknown", 1: "Excellent", 2: "Good", 3: "Fair", 4: "Inferior", 5: "Poor" },
|
|
142
|
+
CoreMaintenanceMapStringToEnum: { "All Ok": 0, "Required": 1 },
|
|
143
|
+
CoreMaintenanceMapEnumToString: { 0: "All Ok", 1: "Required" },
|
|
144
|
+
FilterMaintenanceMapStringToEnum: { "All Ok": 0, "Required": 1 },
|
|
145
|
+
FilterMaintenanceMapEnumToString: { 0: "All Ok", 1: "Required" },
|
|
135
146
|
EffectiveFlags: {
|
|
136
147
|
Power: 1,
|
|
137
148
|
OperationMode: 2,
|
package/src/deviceatw.js
CHANGED
|
@@ -358,7 +358,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
358
358
|
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
|
|
359
359
|
break;
|
|
360
360
|
};
|
|
361
|
-
operationModeText = [HeatPump.
|
|
361
|
+
operationModeText = [HeatPump.SystemMapEnumToString[0], HeatPump.SystemMapEnumToString[deviceData.Device.UnitStatus]][this.accessory.power];
|
|
362
362
|
break;
|
|
363
363
|
case caseZone1: //Zone 1 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
364
364
|
switch (value) {
|
|
@@ -392,7 +392,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
392
392
|
effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
|
|
393
393
|
break
|
|
394
394
|
};
|
|
395
|
-
operationModeText = deviceData.Device.OperationMode === 1 ? HeatPump.
|
|
395
|
+
operationModeText = deviceData.Device.OperationMode === 1 ? HeatPump.ForceDhwMapEnumToString[1] : HeatPump.ForceDhwMapEnumToString[deviceData.Device.ForcedHotWaterMode ? 1 : 0];
|
|
396
396
|
break;
|
|
397
397
|
case caseZone2: //Zone 2 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
398
398
|
switch (value) {
|
|
@@ -409,7 +409,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
409
409
|
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
|
|
410
410
|
break;
|
|
411
411
|
};
|
|
412
|
-
operationModeText = HeatPump.
|
|
412
|
+
operationModeText = HeatPump.ZoneOperationMapEnumToString[deviceData.Device.OperationModeZone2];
|
|
413
413
|
break;
|
|
414
414
|
};
|
|
415
415
|
|
|
@@ -661,7 +661,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
661
661
|
effectiveFlags = HeatPump.EffectiveFlags.Power;
|
|
662
662
|
break;
|
|
663
663
|
};
|
|
664
|
-
operationModeText = [HeatPump.
|
|
664
|
+
operationModeText = [HeatPump.SystemMapEnumToString[0], HeatPump.SystemMapEnumToString[deviceData.Device.UnitStatus]][this.accessory.power];
|
|
665
665
|
break;
|
|
666
666
|
case caseZone1: //Zone 1 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
667
667
|
switch (value) {
|
|
@@ -682,7 +682,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
682
682
|
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
|
|
683
683
|
break;
|
|
684
684
|
};
|
|
685
|
-
operationModeText = HeatPump.
|
|
685
|
+
operationModeText = HeatPump.ZoneOperationMapEnumToString[deviceData.Device.OperationModeZone1];
|
|
686
686
|
break;
|
|
687
687
|
case caseHotWater: //Hot Water - AUTO, HEAT NOW
|
|
688
688
|
switch (value) {
|
|
@@ -703,7 +703,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
703
703
|
effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
|
|
704
704
|
break;
|
|
705
705
|
};
|
|
706
|
-
operationModeText = deviceData.Device.OperationMode === 1 ? HeatPump.
|
|
706
|
+
operationModeText = deviceData.Device.OperationMode === 1 ? HeatPump.ForceDhwMapEnumToString[1] : HeatPump.ForceDhwMapEnumToString[deviceData.Device.ForcedHotWaterMode ? 1 : 0];
|
|
707
707
|
break;
|
|
708
708
|
case caseZone2: //Zone 2 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
709
709
|
switch (value) {
|
|
@@ -724,7 +724,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
724
724
|
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
|
|
725
725
|
break;
|
|
726
726
|
};
|
|
727
|
-
operationModeText = HeatPump.
|
|
727
|
+
operationModeText = HeatPump.ZoneOperationMapEnumToString[deviceData.Device.OperationModeZone2];
|
|
728
728
|
break;
|
|
729
729
|
};
|
|
730
730
|
|
|
@@ -1693,13 +1693,13 @@ class DeviceAtw extends EventEmitter {
|
|
|
1693
1693
|
switch (i) {
|
|
1694
1694
|
case caseHeatPump: //Heat Pump - HEAT, COOL, OFF
|
|
1695
1695
|
this.emit('info', `${heatPumpName}, Power: ${power ? 'ON' : 'OFF'}`)
|
|
1696
|
-
this.emit('info', `${heatPumpName}, Operation mode: ${HeatPump.
|
|
1696
|
+
this.emit('info', `${heatPumpName}, Operation mode: ${HeatPump.SystemMapEnumToString[unitStatus]}`);
|
|
1697
1697
|
this.emit('info', `${heatPumpName},'Outdoor temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1698
1698
|
this.emit('info', `${heatPumpName}, Temperature display unit: ${obj.temperatureUnit}`);
|
|
1699
1699
|
this.emit('info', `${heatPumpName}, Lock physical controls: ${lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
|
|
1700
1700
|
break;
|
|
1701
1701
|
case caseZone1: //Zone 1 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
1702
|
-
operationModeText = idleZone1 ? HeatPump.
|
|
1702
|
+
operationModeText = idleZone1 ? HeatPump.ZoneOperationMapEnumToString[6] : HeatPump.ZoneOperationMapEnumToString[operationModeZone1];
|
|
1703
1703
|
this.emit('info', `${zone1Name}, Operation mode: ${operationModeText}`);
|
|
1704
1704
|
this.emit('info', `${zone1Name}, Temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1705
1705
|
this.emit('info', `${zone1Name}, Target temperature: ${setTemperature}${obj.temperatureUnit}`)
|
|
@@ -1707,7 +1707,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1707
1707
|
this.emit('info', `${zone1Name}, Lock physical controls: ${lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
|
|
1708
1708
|
break;
|
|
1709
1709
|
case caseHotWater: //Hot Water - AUTO, HEAT NOW
|
|
1710
|
-
operationModeText = operationMode === 1 ? HeatPump.
|
|
1710
|
+
operationModeText = operationMode === 1 ? HeatPump.ForceDhwMapEnumToString[1] : HeatPump.ForceDhwMapEnumToString[forcedHotWaterMode ? 1 : 0];
|
|
1711
1711
|
this.emit('info', `${hotWaterName}, Operation mode: ${operationModeText}`);
|
|
1712
1712
|
this.emit('info', `${hotWaterName}, Temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1713
1713
|
this.emit('info', `${hotWaterName}, Target temperature: ${setTemperature}${obj.temperatureUnit}`)
|
|
@@ -1715,7 +1715,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1715
1715
|
this.emit('info', `${hotWaterName}, Lock physical controls: ${lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
|
|
1716
1716
|
break;
|
|
1717
1717
|
case caseZone2: //Zone 2 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
1718
|
-
operationModeText = idleZone2 ? HeatPump.
|
|
1718
|
+
operationModeText = idleZone2 ? HeatPump.ZoneOperationMapEnumToString[6] : HeatPump.ZoneOperationMapEnumToString[operationModeZone2];
|
|
1719
1719
|
this.emit('info', `${zone2Name}, Operation mode: ${operationModeText}`);
|
|
1720
1720
|
this.emit('info', `${zone2Name}, Temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1721
1721
|
this.emit('info', `${zone2Name}, Target temperature: ${setTemperature}${obj.temperatureUnit}`)
|
package/src/deviceerv.js
CHANGED
|
@@ -311,7 +311,7 @@ class DeviceErv extends EventEmitter {
|
|
|
311
311
|
};
|
|
312
312
|
|
|
313
313
|
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, Ventilation.EffectiveFlags.VentilationMode);
|
|
314
|
-
const operationModeText = Ventilation.
|
|
314
|
+
const operationModeText = Ventilation.VentilationModeMapEnumToString[deviceData.Device.VentilationMode];
|
|
315
315
|
if (this.logInfo) this.emit('info', `Set operation mode: ${operationModeText}`);
|
|
316
316
|
} catch (error) {
|
|
317
317
|
if (this.logWarn) this.emit('warn', `Set operation mode error: ${error}`);
|
|
@@ -334,27 +334,24 @@ class DeviceErv extends EventEmitter {
|
|
|
334
334
|
})
|
|
335
335
|
.onSet(async (value) => {
|
|
336
336
|
try {
|
|
337
|
-
let fanSpeedModeText = '';
|
|
338
337
|
switch (numberOfFanSpeeds) {
|
|
339
338
|
case 2: //Fan speed mode 2
|
|
340
|
-
|
|
341
|
-
deviceData.Device.SetFanSpeed = hasAutomaticFanSpeed ? [0, 1, 2, 0][value] : [1, 1, 2][value];
|
|
339
|
+
value = hasAutomaticFanSpeed ? [0, 1, 2, 0][value] : [1, 1, 2][value];
|
|
342
340
|
break;
|
|
343
341
|
case 3: //Fan speed mode 3
|
|
344
|
-
|
|
345
|
-
deviceData.Device.SetFanSpeed = hasAutomaticFanSpeed ? [0, 1, 2, 3, 0][value] : [1, 1, 2, 3][value];
|
|
342
|
+
value = hasAutomaticFanSpeed ? [0, 1, 2, 3, 0][value] : [1, 1, 2, 3][value];
|
|
346
343
|
break;
|
|
347
344
|
case 4: //Fan speed mode 4
|
|
348
|
-
|
|
349
|
-
deviceData.Device.SetFanSpeed = hasAutomaticFanSpeed ? [0, 1, 2, 3, 4, 0][value] : [1, 1, 2, 3, 4][value];
|
|
345
|
+
value = hasAutomaticFanSpeed ? [0, 1, 2, 3, 4, 0][value] : [1, 1, 2, 3, 4][value];
|
|
350
346
|
break;
|
|
351
347
|
case 5: //Fan speed mode 5
|
|
352
|
-
|
|
353
|
-
deviceData.Device.SetFanSpeed = hasAutomaticFanSpeed ? [0, 1, 2, 3, 4, 5, 0][value] : [1, 1, 2, 3, 4, 5][value];
|
|
348
|
+
value = hasAutomaticFanSpeed ? [0, 1, 2, 3, 4, 5, 0][value] : [1, 1, 2, 3, 4, 5][value];
|
|
354
349
|
break;;
|
|
355
350
|
};
|
|
351
|
+
|
|
352
|
+
deviceData.Device.SetFanSpeed = value
|
|
356
353
|
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, Ventilation.EffectiveFlags.SetFanSpeed);
|
|
357
|
-
if (this.logInfo) this.emit('info', `Set fan speed mode: ${Ventilation.
|
|
354
|
+
if (this.logInfo) this.emit('info', `Set fan speed mode: ${Ventilation.FanSpeedMapEnumToString[value]}`);
|
|
358
355
|
} catch (error) {
|
|
359
356
|
if (this.logWarn) this.emit('warn', `Set fan speed mode error: ${error}`);
|
|
360
357
|
};
|
|
@@ -483,7 +480,7 @@ class DeviceErv extends EventEmitter {
|
|
|
483
480
|
};
|
|
484
481
|
|
|
485
482
|
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, effectiveFlags);
|
|
486
|
-
const operationModeText = Ventilation.
|
|
483
|
+
const operationModeText = Ventilation.VentilationModeMapEnumToString[deviceData.Device.VentilationMode];
|
|
487
484
|
if (this.logInfo) this.emit('info', `Set operation mode: ${operationModeText}`);
|
|
488
485
|
} catch (error) {
|
|
489
486
|
if (this.logWarn) this.emit('warn', `Set operation mode error: ${error}`);
|
|
@@ -1190,19 +1187,19 @@ class DeviceErv extends EventEmitter {
|
|
|
1190
1187
|
//log current state
|
|
1191
1188
|
if (this.logInfo) {
|
|
1192
1189
|
this.emit('info', `Power: ${power ? 'ON' : 'OFF'}`);
|
|
1193
|
-
this.emit('info', `Target ventilation mode: ${Ventilation.
|
|
1194
|
-
this.emit('info', `Current ventilation mode: ${Ventilation.
|
|
1190
|
+
this.emit('info', `Target ventilation mode: ${Ventilation.OperationModeMapEnumToString[ventilationMode]}`);
|
|
1191
|
+
this.emit('info', `Current ventilation mode: ${Ventilation.OperationModeMapEnumToString[actualVentilationMode]}`);
|
|
1195
1192
|
this.emit('info', `Target temperature: ${setTemperature}${obj.temperatureUnit}`);
|
|
1196
1193
|
this.emit('info', `Room temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1197
1194
|
if (hasSupplyTemperature && deviceData.Device.SupplyTemperature !== null) this.emit('info', `Supply temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1198
1195
|
if (hasOutdoorTemperature && deviceData.Device.OutdoorTemperature !== null) this.emit('info', `Outdoor temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1199
|
-
this.emit('info', `Fan speed mode: ${Ventilation.
|
|
1196
|
+
this.emit('info', `Fan speed mode: ${Ventilation.FanSpeedMapEnumToString[setFanSpeed]}`);
|
|
1200
1197
|
this.emit('info', `Temperature display unit: ${obj.temperatureUnit}`);
|
|
1201
|
-
this.emit('info', `Core maintenance: ${Ventilation.
|
|
1202
|
-
this.emit('info', `Filter maintenance: ${Ventilation.
|
|
1203
|
-
if (hasCO2Sensor) this.emit('info', `CO2 detected: ${Ventilation.
|
|
1198
|
+
this.emit('info', `Core maintenance: ${Ventilation.CoreMaintenanceMapEnumToString[coreMaintenanceRequired]}`);
|
|
1199
|
+
this.emit('info', `Filter maintenance: ${Ventilation.FilterMaintenanceMapEnumToString[filterMaintenanceRequired]}`);
|
|
1200
|
+
if (hasCO2Sensor) this.emit('info', `CO2 detected: ${Ventilation.Co2DetectedMapEnumToString[roomCO2Detected]}`);
|
|
1204
1201
|
if (hasCO2Sensor) this.emit('info', `CO2 level: ${roomCO2Level} ppm`);
|
|
1205
|
-
if (hasPM25Sensor) this.emit('info', `PM2.5 air quality: ${Ventilation.
|
|
1202
|
+
if (hasPM25Sensor) this.emit('info', `PM2.5 air quality: ${Ventilation.PM25AirQualityMapEnumToString[pM25AirQuality]}`);
|
|
1206
1203
|
if (hasPM25Sensor) this.emit('info', `PM2.5 level: ${pM25Level} µg/m`);
|
|
1207
1204
|
};
|
|
1208
1205
|
})
|
package/src/melcloudatw.js
CHANGED
|
@@ -189,6 +189,20 @@ class MelCloudAtw extends EventEmitter {
|
|
|
189
189
|
|
|
190
190
|
async send(accountType, displayType, deviceData, effectiveFlags) {
|
|
191
191
|
try {
|
|
192
|
+
|
|
193
|
+
//prevent to set out of range temp
|
|
194
|
+
const minTempZones = 0;
|
|
195
|
+
const maxTempZones = 60;
|
|
196
|
+
const minTempWaterTank = 16;
|
|
197
|
+
const maxTempWaterTank = deviceData.Device.MaxTankTemperature ?? 70;
|
|
198
|
+
|
|
199
|
+
deviceData.Device.SetTemperatureZone1 = deviceData.Device.SetTemperatureZone1 < minTempZones ? minTempZones : deviceData.Device.SetTemperatureZone1;
|
|
200
|
+
deviceData.Device.SetTemperatureZone1 = deviceData.Device.SetTemperatureZone1 > maxTempZones ? maxTempZones : deviceData.Device.SetTemperatureZone1;
|
|
201
|
+
deviceData.Device.SetTemperatureZone1 = deviceData.Device.SetTemperatureZone2 < minTempZones ? minTempZones : deviceData.Device.SetTemperatureZone2;
|
|
202
|
+
deviceData.Device.SetTemperatureZone1 = deviceData.Device.SetTemperatureZone2 > maxTempZones ? maxTempZones : deviceData.Device.SetTemperatureZone2;
|
|
203
|
+
deviceData.Device.SetTankWaterTemperature = deviceData.Device.SetTankWaterTemperature < minTempWaterTank ? minTempWaterTank : deviceData.Device.SetTankWaterTemperature;
|
|
204
|
+
deviceData.Device.SetTankWaterTemperature = deviceData.Device.SetTankWaterTemperature > maxTempWaterTank ? maxTempWaterTank : deviceData.Device.SetTankWaterTemperature;
|
|
205
|
+
|
|
192
206
|
switch (accountType) {
|
|
193
207
|
case "melcloud":
|
|
194
208
|
const axiosInstancePost = axios.create({
|
|
@@ -199,19 +213,6 @@ class MelCloudAtw extends EventEmitter {
|
|
|
199
213
|
withCredentials: true
|
|
200
214
|
});
|
|
201
215
|
|
|
202
|
-
//prevent to set out of range temp
|
|
203
|
-
const minTempZones = 0;
|
|
204
|
-
const maxTempZones = 60;
|
|
205
|
-
const minTempWaterTank = 16;
|
|
206
|
-
const maxTempWaterTank = deviceData.Device.MaxTankTemperature ?? 70;
|
|
207
|
-
|
|
208
|
-
deviceData.Device.SetTemperatureZone1 = deviceData.Device.SetTemperatureZone1 < minTempZones ? minTempZones : deviceData.Device.SetTemperatureZone1;
|
|
209
|
-
deviceData.Device.SetTemperatureZone1 = deviceData.Device.SetTemperatureZone1 > maxTempZones ? maxTempZones : deviceData.Device.SetTemperatureZone1;
|
|
210
|
-
deviceData.Device.SetTemperatureZone1 = deviceData.Device.SetTemperatureZone2 < minTempZones ? minTempZones : deviceData.Device.SetTemperatureZone2;
|
|
211
|
-
deviceData.Device.SetTemperatureZone1 = deviceData.Device.SetTemperatureZone2 > maxTempZones ? maxTempZones : deviceData.Device.SetTemperatureZone2;
|
|
212
|
-
deviceData.Device.SetTankWaterTemperature = deviceData.Device.SetTankWaterTemperature < minTempWaterTank ? minTempWaterTank : deviceData.Device.SetTankWaterTemperature;
|
|
213
|
-
deviceData.Device.SetTankWaterTemperature = deviceData.Device.SetTankWaterTemperature > maxTempWaterTank ? maxTempWaterTank : deviceData.Device.SetTankWaterTemperature;
|
|
214
|
-
|
|
215
216
|
deviceData.Device.EffectiveFlags = effectiveFlags;
|
|
216
217
|
const payload = {
|
|
217
218
|
data: {
|
|
@@ -250,26 +251,21 @@ class MelCloudAtw extends EventEmitter {
|
|
|
250
251
|
withCredentials: true
|
|
251
252
|
});
|
|
252
253
|
|
|
253
|
-
if (displayType === 1 && deviceData.Device.OperationMode === 8) {
|
|
254
|
-
deviceData.Device.SetTemperature = (deviceData.Device.DefaultCoolingSetTemperature + deviceData.Device.DefaultHeatingSetTemperature) / 2;
|
|
255
|
-
|
|
256
|
-
if (this.deviceState.DefaultCoolingSetTemperature !== deviceData.Device.DefaultCoolingSetTemperature || this.deviceState.DefaultHeatingSetTemperature !== deviceData.Device.DefaultHeatingSetTemperature) {
|
|
257
|
-
const temps = {
|
|
258
|
-
defaultCoolingSetTemperature: deviceData.Device.DefaultCoolingSetTemperature,
|
|
259
|
-
defaultHeatingSetTemperature: deviceData.Device.DefaultHeatingSetTemperature
|
|
260
|
-
};
|
|
261
|
-
await this.functions.saveData(this.defaultTempsFile, temps);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
254
|
const settings = {
|
|
266
255
|
data: {
|
|
267
256
|
Power: deviceData.Device.Power,
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
OperationMode:
|
|
271
|
-
|
|
272
|
-
|
|
257
|
+
SetTemperatureZone1: deviceData.Device.SetTemperatureZone1,
|
|
258
|
+
SetTemperatureZone2: deviceData.Device.SetTemperatureZone2,
|
|
259
|
+
OperationMode: HeatPump.OperationModeMapEnumToString[deviceData.Device.OperationMode],
|
|
260
|
+
OperationModeZone1: HeatPump.OperationModeMapEnumToString[deviceData.Device.OperationModeZone1],
|
|
261
|
+
OperationModeZone2: HeatPump.OperationModeMapEnumToString[deviceData.Device.OperationModeZone2],
|
|
262
|
+
SetHeatFlowTemperatureZone1: deviceData.Device.SetHeatFlowTemperatureZone1,
|
|
263
|
+
SetHeatFlowTemperatureZone2: deviceData.Device.SetHeatFlowTemperatureZone2,
|
|
264
|
+
SetCoolFlowTemperatureZone1: deviceData.Device.SetCoolFlowTemperatureZone1,
|
|
265
|
+
SetCoolFlowTemperatureZone2: deviceData.Device.SetCoolFlowTemperatureZone2,
|
|
266
|
+
SetTankWaterTemperature: deviceData.Device.SetTankWaterTemperature,
|
|
267
|
+
ForcedHotWaterMode: deviceData.Device.ForcedHotWaterMode,
|
|
268
|
+
EcoHotWater: deviceData.Device.EcoHotWater,
|
|
273
269
|
}
|
|
274
270
|
};
|
|
275
271
|
if (this.logDebug) this.emit('debug', `Send Data: ${JSON.stringify(settings.data, null, 2)}`);
|
package/src/melclouderv.js
CHANGED
|
@@ -244,7 +244,7 @@ class MelCloudErv extends EventEmitter {
|
|
|
244
244
|
withCredentials: true
|
|
245
245
|
});
|
|
246
246
|
|
|
247
|
-
if (displayType === 1 && deviceData.Device.
|
|
247
|
+
if (displayType === 1 && deviceData.Device.VentilationMode === 2) {
|
|
248
248
|
deviceData.Device.SetTemperature = (deviceData.Device.DefaultCoolingSetTemperature + deviceData.Device.DefaultHeatingSetTemperature) / 2;
|
|
249
249
|
|
|
250
250
|
if (this.deviceState.DefaultCoolingSetTemperature !== deviceData.Device.DefaultCoolingSetTemperature || this.deviceState.DefaultHeatingSetTemperature !== deviceData.Device.DefaultHeatingSetTemperature) {
|
|
@@ -261,9 +261,8 @@ class MelCloudErv extends EventEmitter {
|
|
|
261
261
|
Power: deviceData.Device.Power,
|
|
262
262
|
SetTemperature: deviceData.Device.SetTemperature,
|
|
263
263
|
SetFanSpeed: String(deviceData.Device.SetFanSpeed),
|
|
264
|
-
OperationMode:
|
|
265
|
-
|
|
266
|
-
VaneVerticalDirection: AirConditioner.VaneVerticalDirectionMapEnumToString[deviceData.Device.VaneVerticalDirection]
|
|
264
|
+
OperationMode: Ventilation.OperationModeMapEnumToString[deviceData.Device.OperationMode],
|
|
265
|
+
VentilationMode: Ventilation.VentilationModeMapEnumToString[deviceData.Device.VentilationMode],
|
|
267
266
|
}
|
|
268
267
|
};
|
|
269
268
|
if (this.logDebug) this.emit('debug', `Send Data: ${JSON.stringify(settings.data, null, 2)}`);
|