homebridge-melcloud-control 4.1.2-beta.20 → 4.1.2-beta.22
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/config.schema.json +12 -9
- package/package.json +1 -1
- package/src/constants.js +4 -0
- package/src/deviceata.js +7 -8
- package/src/deviceatw.js +4 -2
- package/src/deviceerv.js +8 -6
- package/src/melcloud.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -22,6 +22,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
22
22
|
|
|
23
23
|
- Do not use Homebridge UI > v5.5.0 because of break config.json
|
|
24
24
|
|
|
25
|
+
## [4.1.2] - (10.11.2025)
|
|
26
|
+
|
|
27
|
+
## Changes
|
|
28
|
+
|
|
29
|
+
- added presets/schedules support for MELCLoud Home ATA devices
|
|
30
|
+
- config schema updated
|
|
31
|
+
- readme updated
|
|
32
|
+
- cleanup
|
|
33
|
+
|
|
25
34
|
## [4.1.1] - (10.11.2025)
|
|
26
35
|
|
|
27
36
|
## Changes
|
package/config.schema.json
CHANGED
|
@@ -235,7 +235,8 @@
|
|
|
235
235
|
"properties": {
|
|
236
236
|
"id": {
|
|
237
237
|
"title": "ID",
|
|
238
|
-
"type": "string"
|
|
238
|
+
"type": "string",
|
|
239
|
+
"default": "0"
|
|
239
240
|
},
|
|
240
241
|
"type": {
|
|
241
242
|
"title": "Type",
|
|
@@ -278,7 +279,7 @@
|
|
|
278
279
|
"name": {
|
|
279
280
|
"title": "Name",
|
|
280
281
|
"type": "string",
|
|
281
|
-
"
|
|
282
|
+
"default": "Air Conditioner"
|
|
282
283
|
},
|
|
283
284
|
"heatDryFanMode": {
|
|
284
285
|
"title": "Heat",
|
|
@@ -839,7 +840,8 @@
|
|
|
839
840
|
"properties": {
|
|
840
841
|
"id": {
|
|
841
842
|
"title": "ID",
|
|
842
|
-
"type": "string"
|
|
843
|
+
"type": "string",
|
|
844
|
+
"default": "0"
|
|
843
845
|
},
|
|
844
846
|
"type": {
|
|
845
847
|
"title": "Type",
|
|
@@ -854,7 +856,7 @@
|
|
|
854
856
|
"name": {
|
|
855
857
|
"title": "Name",
|
|
856
858
|
"type": "string",
|
|
857
|
-
"
|
|
859
|
+
"default": "Heat Pump"
|
|
858
860
|
},
|
|
859
861
|
"displayType": {
|
|
860
862
|
"title": "Display Type",
|
|
@@ -1373,7 +1375,8 @@
|
|
|
1373
1375
|
"properties": {
|
|
1374
1376
|
"id": {
|
|
1375
1377
|
"title": "ID",
|
|
1376
|
-
"type": "string"
|
|
1378
|
+
"type": "string",
|
|
1379
|
+
"default": "0"
|
|
1377
1380
|
},
|
|
1378
1381
|
"type": {
|
|
1379
1382
|
"title": "Type",
|
|
@@ -1388,7 +1391,7 @@
|
|
|
1388
1391
|
"name": {
|
|
1389
1392
|
"title": "Name",
|
|
1390
1393
|
"type": "string",
|
|
1391
|
-
"
|
|
1394
|
+
"default": "Ventilation"
|
|
1392
1395
|
},
|
|
1393
1396
|
"displayType": {
|
|
1394
1397
|
"title": "Display Type",
|
|
@@ -2004,7 +2007,7 @@
|
|
|
2004
2007
|
}
|
|
2005
2008
|
],
|
|
2006
2009
|
"condition": {
|
|
2007
|
-
"functionBody": "return model.accounts[arrayIndices[0]].ataDevices[arrayIndices[1]].id !==
|
|
2010
|
+
"functionBody": "return model.accounts[arrayIndices[0]].ataDevices[arrayIndices[1]].id !== '0';"
|
|
2008
2011
|
}
|
|
2009
2012
|
}
|
|
2010
2013
|
]
|
|
@@ -2124,7 +2127,7 @@
|
|
|
2124
2127
|
}
|
|
2125
2128
|
],
|
|
2126
2129
|
"condition": {
|
|
2127
|
-
"functionBody": "return model.accounts[arrayIndices[0]].atwDevices[arrayIndices[1]].id !==
|
|
2130
|
+
"functionBody": "return model.accounts[arrayIndices[0]].atwDevices[arrayIndices[1]].id !== '0';"
|
|
2128
2131
|
}
|
|
2129
2132
|
}
|
|
2130
2133
|
]
|
|
@@ -2237,7 +2240,7 @@
|
|
|
2237
2240
|
}
|
|
2238
2241
|
],
|
|
2239
2242
|
"condition": {
|
|
2240
|
-
"functionBody": "return model.accounts[arrayIndices[0]].ervDevices[arrayIndices[1]].id !==
|
|
2243
|
+
"functionBody": "return model.accounts[arrayIndices[0]].ervDevices[arrayIndices[1]].id !== '0';"
|
|
2241
2244
|
}
|
|
2242
2245
|
}
|
|
2243
2246
|
]
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.1.2-beta.
|
|
4
|
+
"version": "4.1.2-beta.22",
|
|
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/constants.js
CHANGED
|
@@ -21,8 +21,12 @@ export const ApiUrlsHome = {
|
|
|
21
21
|
BaseURL: "https://melcloudhome.com",
|
|
22
22
|
GetUserContext: "/api/user/context",
|
|
23
23
|
SetAta: "/api/ataunit/deviceid",
|
|
24
|
+
GetAtaSchedule: "/ata/deviceid/schedule",
|
|
24
25
|
SetAtw: "/api/atwunit/deviceid",
|
|
26
|
+
GetAtwSchedule: "/atw/deviceid/schedule",
|
|
25
27
|
SetErv: "/api/ervunit/deviceid",
|
|
28
|
+
GetErvSchedule: "/erv/deviceid/schedule",
|
|
29
|
+
SetSchedule: "/api/cloudschedule/deviceid/enabled",
|
|
26
30
|
};
|
|
27
31
|
|
|
28
32
|
export const DeviceType = [
|
package/src/deviceata.js
CHANGED
|
@@ -706,8 +706,6 @@ class DeviceAta extends EventEmitter {
|
|
|
706
706
|
})
|
|
707
707
|
.onSet(async (state) => {
|
|
708
708
|
try {
|
|
709
|
-
const setTempKey = this.accountType === 'melcloud' ? 'SetTemperature' : 'SetPoint';
|
|
710
|
-
const fanKey = this.accountType === 'melcloud' ? 'FanSpeed' : 'SetFanSpeed';
|
|
711
709
|
switch (state) {
|
|
712
710
|
case true:
|
|
713
711
|
preset.previousSettings = deviceData.Device;
|
|
@@ -716,7 +714,7 @@ class DeviceAta extends EventEmitter {
|
|
|
716
714
|
deviceData.Device.SetTemperature = presetData.SetTemperature;
|
|
717
715
|
deviceData.Device.VaneHorizontalDirection = presetData.VaneHorizontalDirection;
|
|
718
716
|
deviceData.Device.VaneVerticalDirection = presetData.VaneVerticalDirection;
|
|
719
|
-
deviceData.Device
|
|
717
|
+
deviceData.Device.SetFanSpeed = presetData.SetFanSpeed;
|
|
720
718
|
break;
|
|
721
719
|
case false:
|
|
722
720
|
deviceData.Device.Power = preset.previousSettings.Power;
|
|
@@ -724,7 +722,7 @@ class DeviceAta extends EventEmitter {
|
|
|
724
722
|
deviceData.Device.SetTemperature = preset.previousSettings.SetTemperature;
|
|
725
723
|
deviceData.Device.VaneHorizontalDirection = preset.previousSettings.VaneHorizontalDirection;
|
|
726
724
|
deviceData.Device.VaneVerticalDirection = preset.previousSettings.VaneVerticalDirection;
|
|
727
|
-
deviceData.Device
|
|
725
|
+
deviceData.Device.SetFanSpeed = preset.previousSettings.SetFanSpeed;
|
|
728
726
|
break;
|
|
729
727
|
};
|
|
730
728
|
|
|
@@ -1032,8 +1030,10 @@ class DeviceAta extends EventEmitter {
|
|
|
1032
1030
|
const supportCoolKey = this.accountType === 'melcloud' ? 'ModelSupportsCool' : 'HasCoolOperationMode';
|
|
1033
1031
|
|
|
1034
1032
|
//presets schedule
|
|
1033
|
+
const scheduleEnabled = deviceData.ScheduleEnabled;
|
|
1035
1034
|
const presetsOnServer = deviceData[presetsKey] ?? [];
|
|
1036
1035
|
|
|
1036
|
+
|
|
1037
1037
|
//protection
|
|
1038
1038
|
const frostProtectionEnabled = deviceData.FrostProtection?.Enabled;
|
|
1039
1039
|
const frostProtectionActive = deviceData.FrostProtection?.Active;
|
|
@@ -1041,7 +1041,6 @@ class DeviceAta extends EventEmitter {
|
|
|
1041
1041
|
const overheatProtectionActive = deviceData.OverheatProtection?.Active;
|
|
1042
1042
|
const holidayModeEnabled = deviceData.HolidayMode?.Enabled;
|
|
1043
1043
|
const holidayModeActive = deviceData.HolidayMode?.Active;
|
|
1044
|
-
const scheduleEnabled = deviceData.ScheduleEnabled;
|
|
1045
1044
|
|
|
1046
1045
|
//device control
|
|
1047
1046
|
const hideVaneControls = deviceData.HideVaneControls ?? false;
|
|
@@ -1287,12 +1286,12 @@ class DeviceAta extends EventEmitter {
|
|
|
1287
1286
|
this.presets.forEach((preset, i) => {
|
|
1288
1287
|
const presetData = presetsOnServer.find(p => p[presetsIdKey] === preset.id);
|
|
1289
1288
|
|
|
1290
|
-
preset.state = presetData ? (presetData.Power === power
|
|
1291
|
-
&& presetData
|
|
1289
|
+
preset.state = presetData ? (this.accountType === 'melcloudhome' ? scheduleEnabled && presetData.Enabled : (presetData.Power === power
|
|
1290
|
+
&& presetData.SetTemperature === setTemperature
|
|
1292
1291
|
&& presetData.OperationMode === operationMode
|
|
1293
1292
|
&& presetData.VaneHorizontalDirection === vaneHorizontalDirection
|
|
1294
1293
|
&& presetData.VaneVerticalDirection === vaneVerticalDirection
|
|
1295
|
-
&& presetData
|
|
1294
|
+
&& presetData.FanSpeed === setFanSpeed)) : false;
|
|
1296
1295
|
|
|
1297
1296
|
const characteristicType = preset.characteristicType;
|
|
1298
1297
|
this.presetsServices?.[i]?.updateCharacteristic(characteristicType, preset.state);
|
package/src/deviceatw.js
CHANGED
|
@@ -1337,6 +1337,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1337
1337
|
const errorKey = this.accountType === 'melcloud' ? 'HasError' : 'IsInError';
|
|
1338
1338
|
|
|
1339
1339
|
//presets
|
|
1340
|
+
const scheduleEnabled = deviceData.ScheduleEnabled;
|
|
1340
1341
|
const presetsOnServer = deviceData[presetsKey] ?? [];
|
|
1341
1342
|
|
|
1342
1343
|
//device info
|
|
@@ -1439,6 +1440,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1439
1440
|
useFahrenheit: this.useFahrenheit,
|
|
1440
1441
|
temperatureUnit: TemperatureDisplayUnits[this.useFahrenheit],
|
|
1441
1442
|
isInError: isInError,
|
|
1443
|
+
scheduleEnabled: scheduleEnabled,
|
|
1442
1444
|
zones: [],
|
|
1443
1445
|
zonesSensors: []
|
|
1444
1446
|
};
|
|
@@ -1821,7 +1823,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1821
1823
|
this.presets.forEach((preset, i) => {
|
|
1822
1824
|
const presetData = presetsOnServer.find(p => p[presetsIdKey] === preset.id);
|
|
1823
1825
|
|
|
1824
|
-
preset.state = presetData ? (presetData.Power === power
|
|
1826
|
+
preset.state = presetData ? (this.accountType === 'melcloudhome' ? scheduleEnabled && presetData.Enabled : (presetData.Power === power
|
|
1825
1827
|
&& presetData.EcoHotWater === ecoHotWater
|
|
1826
1828
|
&& presetData.OperationModeZone1 === operationModeZone1
|
|
1827
1829
|
&& presetData.OperationModeZone2 === operationModeZone2
|
|
@@ -1832,7 +1834,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1832
1834
|
&& presetData.SetHeatFlowTemperatureZone1 === setHeatFlowTemperatureZone1
|
|
1833
1835
|
&& presetData.SetHeatFlowTemperatureZone2 === setHeatFlowTemperatureZone2
|
|
1834
1836
|
&& presetData.SetCoolFlowTemperatureZone1 === setCoolFlowTemperatureZone1
|
|
1835
|
-
&& presetData.SetCoolFlowTemperatureZone2 === setCoolFlowTemperatureZone2) : false;
|
|
1837
|
+
&& presetData.SetCoolFlowTemperatureZone2 === setCoolFlowTemperatureZone2)) : false;
|
|
1836
1838
|
|
|
1837
1839
|
const characteristicType = preset.characteristicType;
|
|
1838
1840
|
this.presetsServices?.[i]?.updateCharacteristic(characteristicType, preset.state);
|
package/src/deviceerv.js
CHANGED
|
@@ -703,14 +703,14 @@ class DeviceErv extends EventEmitter {
|
|
|
703
703
|
deviceData.Device.Power = presetData.Power;
|
|
704
704
|
deviceData.Device.OperationMode = presetData.OperationMode;
|
|
705
705
|
deviceData.Device.VentilationMode = presetData.VentilationMode;
|
|
706
|
-
deviceData.Device.SetFanSpeed = presetData.
|
|
706
|
+
deviceData.Device.SetFanSpeed = presetData.SetFanSpeed;
|
|
707
707
|
break;
|
|
708
708
|
case false:
|
|
709
709
|
deviceData.Device.SetTemperature = preset.previousSettings.SetTemperature;
|
|
710
710
|
deviceData.Device.Power = preset.previousSettings.Power;
|
|
711
711
|
deviceData.Device.OperationMode = preset.previousSettings.OperationMode;
|
|
712
712
|
deviceData.Device.VentilationMode = preset.previousSettings.VentilationMode;
|
|
713
|
-
deviceData.Device.SetFanSpeed = preset.previousSettings.
|
|
713
|
+
deviceData.Device.SetFanSpeed = preset.previousSettings.SetFanSpeed;
|
|
714
714
|
break;
|
|
715
715
|
};
|
|
716
716
|
|
|
@@ -882,7 +882,8 @@ class DeviceErv extends EventEmitter {
|
|
|
882
882
|
const tempStepKey = this.accountType === 'melcloud' ? 'TemperatureIncrement' : 'HasHalfDegreeIncrements';
|
|
883
883
|
const errorKey = this.accountType === 'melcloud' ? 'HasError' : 'IsInError';
|
|
884
884
|
|
|
885
|
-
//presets
|
|
885
|
+
//presets schedule
|
|
886
|
+
const scheduleEnabled = deviceData.ScheduleEnabled;
|
|
886
887
|
const presetsOnServer = deviceData[presetsKey] ?? [];
|
|
887
888
|
|
|
888
889
|
//device control
|
|
@@ -972,7 +973,8 @@ class DeviceErv extends EventEmitter {
|
|
|
972
973
|
maxTempCoolDry: maxTempCoolDry,
|
|
973
974
|
useFahrenheit: this.useFahrenheit,
|
|
974
975
|
temperatureUnit: TemperatureDisplayUnits[this.useFahrenheit],
|
|
975
|
-
isInError: isInError
|
|
976
|
+
isInError: isInError,
|
|
977
|
+
scheduleEnabled: scheduleEnabled
|
|
976
978
|
};
|
|
977
979
|
|
|
978
980
|
//ventilation mode - 0, HEAT, 2, COOL, 4, 5, 6, FAN, AUTO
|
|
@@ -1117,11 +1119,11 @@ class DeviceErv extends EventEmitter {
|
|
|
1117
1119
|
this.presets.forEach((preset, i) => {
|
|
1118
1120
|
const presetData = presetsOnServer.find(p => p[presetsIdKey] === preset.id);
|
|
1119
1121
|
|
|
1120
|
-
preset.state = presetData ? (presetData.Power === power
|
|
1122
|
+
preset.state = presetData ? (this.accountType === 'melcloudhome' ? scheduleEnabled && presetData.Enabled : (presetData.Power === power
|
|
1121
1123
|
&& presetData.SetTemperature === setTemperature
|
|
1122
1124
|
&& presetData.OperationMode === operationMode
|
|
1123
1125
|
&& presetData.VentilationMode === ventilationMode
|
|
1124
|
-
&& presetData.
|
|
1126
|
+
&& presetData.SetFanSpeed === setFanSpeed)) : false;
|
|
1125
1127
|
|
|
1126
1128
|
const characteristicType = preset.characteristicType;
|
|
1127
1129
|
this.presetsServices?.[i]?.updateCharacteristic(characteristicType, preset.state);
|