homebridge-melcloud-control 4.3.1 → 4.3.2-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/README.md +6 -0
- package/config.schema.json +10 -0
- package/package.json +2 -2
- package/src/deviceata.js +1 -0
- package/src/deviceatw.js +62 -0
- package/src/deviceerv.js +1 -0
package/README.md
CHANGED
|
@@ -90,6 +90,8 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
90
90
|
* Shedules control.
|
|
91
91
|
* Shedule active.
|
|
92
92
|
* Scene control.
|
|
93
|
+
* In standby.
|
|
94
|
+
* Is connected.
|
|
93
95
|
* Error.
|
|
94
96
|
* Heat Pump:
|
|
95
97
|
* Heater Cooler:
|
|
@@ -146,6 +148,8 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
146
148
|
* Shedules control.
|
|
147
149
|
* Shedule active.
|
|
148
150
|
* Scene control.
|
|
151
|
+
* In standby.
|
|
152
|
+
* Is connected.
|
|
149
153
|
* Error.
|
|
150
154
|
* Energy Recovery Ventilation Lossnay:
|
|
151
155
|
* Heater Cooler:
|
|
@@ -183,6 +187,8 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
183
187
|
* Shedules control.
|
|
184
188
|
* Shedule active.
|
|
185
189
|
* Scene control.
|
|
190
|
+
* In standby.
|
|
191
|
+
* Is connected.
|
|
186
192
|
* Error.
|
|
187
193
|
|
|
188
194
|
### HOME app current device mode display
|
package/config.schema.json
CHANGED
|
@@ -1287,6 +1287,15 @@
|
|
|
1287
1287
|
"functionBody": "return model.accounts[arrayIndices[0]].type === 'melcloudhome';"
|
|
1288
1288
|
}
|
|
1289
1289
|
},
|
|
1290
|
+
"frostProtectionSupport": {
|
|
1291
|
+
"title": "Frost Protection Support",
|
|
1292
|
+
"type": "boolean",
|
|
1293
|
+
"default": false,
|
|
1294
|
+
"description": "This enable extra frost protection control and sensors to use with automations in HomeKit app.",
|
|
1295
|
+
"condition": {
|
|
1296
|
+
"functionBody": "return model.accounts[arrayIndices[0]].type === 'melcloudhome';"
|
|
1297
|
+
}
|
|
1298
|
+
},
|
|
1290
1299
|
"refreshInterval": {
|
|
1291
1300
|
"title": "Refresh Interval",
|
|
1292
1301
|
"type": "integer",
|
|
@@ -2769,6 +2778,7 @@
|
|
|
2769
2778
|
"items": [
|
|
2770
2779
|
"accounts[].atwDevices[].hideZone",
|
|
2771
2780
|
"accounts[].atwDevices[].name",
|
|
2781
|
+
"accounts[].atwDevices[].frostProtectionSupport",
|
|
2772
2782
|
"accounts[].atwDevices[].holidayModeSupport",
|
|
2773
2783
|
"accounts[].atwDevices[].refreshInterval"
|
|
2774
2784
|
],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.3.1",
|
|
4
|
+
"version": "4.3.2-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": "^24.
|
|
42
|
+
"puppeteer": "^24.31.0",
|
|
43
43
|
"ws": "^8.18.3"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
package/src/deviceata.js
CHANGED
|
@@ -1868,6 +1868,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1868
1868
|
if (supportsSwingFunction) this.emit('info', `Air direction: ${AirConditioner.AirDirectionMapEnumToString[obj.currentSwingMode]}`);
|
|
1869
1869
|
this.emit('info', `Temperature display unit: ${obj.temperatureUnit}`);
|
|
1870
1870
|
this.emit('info', `Lock physical controls: ${obj.lockPhysicalControl ? 'Locked' : 'Unlocked'}`);
|
|
1871
|
+
if (this.accountType === 'melcloudhome') this.emit('info', `Signal strength: ${deviceData.rssi}dBm`);
|
|
1871
1872
|
};
|
|
1872
1873
|
})
|
|
1873
1874
|
.on('success', (success) => this.emit('success', success))
|
package/src/deviceatw.js
CHANGED
|
@@ -44,6 +44,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
44
44
|
this.inStandbySensor = device.inStandbySensor || false;
|
|
45
45
|
this.connectSensor = device.connectSensor || false;
|
|
46
46
|
this.errorSensor = device.errorSensor || false;
|
|
47
|
+
this.frostProtectionSupport = device.frostProtectionSupport || false;
|
|
47
48
|
this.holidayModeSupport = device.holidayModeSupport || false;
|
|
48
49
|
this.presets = this.accountType === 'melcloud' ? (device.presets || []).filter(preset => (preset.displayType ?? 0) > 0 && preset.id !== '0') : [];
|
|
49
50
|
this.schedules = this.accountType === 'melcloudhome' ? (device.schedules || []).filter(schedule => (schedule.displayType ?? 0) > 0 && schedule.id !== '0') : [];
|
|
@@ -1066,6 +1067,53 @@ class DeviceAtw extends EventEmitter {
|
|
|
1066
1067
|
accessory.addService(this.errorService);
|
|
1067
1068
|
}
|
|
1068
1069
|
|
|
1070
|
+
//frost protection
|
|
1071
|
+
if (this.frostProtectionSupport && this.accessory.frostProtectionEnabled !== null) {
|
|
1072
|
+
//control
|
|
1073
|
+
if (this.logDebug) this.emit('debug', `Prepare frost protection control service`);
|
|
1074
|
+
this.frostProtectionControlService = new Service.Switch(`${serviceName} Frost Protection`, `frostProtectionControlService${deviceId}`);
|
|
1075
|
+
this.frostProtectionControlService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1076
|
+
this.frostProtectionControlService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Frost Protection`);
|
|
1077
|
+
this.frostProtectionControlService.getCharacteristic(Characteristic.On)
|
|
1078
|
+
.onGet(async () => {
|
|
1079
|
+
const state = this.accessory.frostProtectionEnabled;
|
|
1080
|
+
return state;
|
|
1081
|
+
})
|
|
1082
|
+
.onSet(async (state) => {
|
|
1083
|
+
try {
|
|
1084
|
+
deviceData.FrostProtection.Enabled = state;
|
|
1085
|
+
if (this.logInfo) this.emit('info', `Frost protection: ${state ? 'Enabled' : 'Disabled'}`);
|
|
1086
|
+
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'frostprotection');
|
|
1087
|
+
} catch (error) {
|
|
1088
|
+
if (this.logWarn) this.emit('warn', `Set frost protection error: ${error}`);
|
|
1089
|
+
};
|
|
1090
|
+
});
|
|
1091
|
+
accessory.addService(this.frostProtectionControlService);
|
|
1092
|
+
|
|
1093
|
+
if (this.logDebug) this.emit('debug', `Prepare frost protection control sensor service`);
|
|
1094
|
+
this.frostProtectionControlSensorService = new Service.ContactSensor(`${serviceName} Frost Protection Control`, `frostProtectionControlSensorService${deviceId}`);
|
|
1095
|
+
this.frostProtectionControlSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1096
|
+
this.frostProtectionControlSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Frost Protection Control`);
|
|
1097
|
+
this.frostProtectionControlSensorService.getCharacteristic(Characteristic.ContactSensorState)
|
|
1098
|
+
.onGet(async () => {
|
|
1099
|
+
const state = this.accessory.frostProtectionEnabled;
|
|
1100
|
+
return state;
|
|
1101
|
+
})
|
|
1102
|
+
accessory.addService(this.frostProtectionControlSensorService);
|
|
1103
|
+
|
|
1104
|
+
//sensor
|
|
1105
|
+
if (this.logDebug) this.emit('debug', `Prepare frost protection service`);
|
|
1106
|
+
this.frostProtectionSensorService = new Service.ContactSensor(`${serviceName} Frost Protection`, `frostProtectionSensorService${deviceId}`);
|
|
1107
|
+
this.frostProtectionSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1108
|
+
this.frostProtectionSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Frost Protection`);
|
|
1109
|
+
this.frostProtectionSensorService.getCharacteristic(Characteristic.ContactSensorState)
|
|
1110
|
+
.onGet(async () => {
|
|
1111
|
+
const state = this.accessory.frostProtectionActive;
|
|
1112
|
+
return state;
|
|
1113
|
+
})
|
|
1114
|
+
accessory.addService(this.frostProtectionSensorService);
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1069
1117
|
//holiday mode
|
|
1070
1118
|
if (this.holidayModeSupport && this.accessory.holidayModeEnabled !== null) {
|
|
1071
1119
|
//control
|
|
@@ -1574,6 +1622,10 @@ class DeviceAtw extends EventEmitter {
|
|
|
1574
1622
|
const holidayModeEnabled = accountTypeMelcloud ? holidayMode : deviceData.HolidayMode?.Enabled;
|
|
1575
1623
|
const holidayModeActive = deviceData.HolidayMode?.Active ?? false;
|
|
1576
1624
|
|
|
1625
|
+
//protection
|
|
1626
|
+
const frostProtectionEnabled = deviceData.FrostProtection?.Enabled;
|
|
1627
|
+
const frostProtectionActive = deviceData.FrostProtection?.Active ?? false;
|
|
1628
|
+
|
|
1577
1629
|
//device info
|
|
1578
1630
|
const supportsStanbyMode = deviceData.Device[supportStandbyKey];
|
|
1579
1631
|
const supportsHeatPump = ![1, 2, 3, 4, 5, 6, 7, 15].includes(this.hideZone);
|
|
@@ -1681,6 +1733,8 @@ class DeviceAtw extends EventEmitter {
|
|
|
1681
1733
|
temperatureUnit: TemperatureDisplayUnits[this.accountInfo.useFahrenheit ? 1 : 0],
|
|
1682
1734
|
isConnected: isConnected,
|
|
1683
1735
|
isInError: isInError,
|
|
1736
|
+
frostProtectionEnabled: frostProtectionEnabled,
|
|
1737
|
+
frostProtectionActive: frostProtectionActive,
|
|
1684
1738
|
scheduleEnabled: scheduleEnabled,
|
|
1685
1739
|
holidayModeEnabled: holidayModeEnabled,
|
|
1686
1740
|
holidayModeActive: holidayModeActive,
|
|
@@ -1952,6 +2006,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1952
2006
|
this.emit('info', `${heatPumpName},'Outdoor temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1953
2007
|
this.emit('info', `${heatPumpName}, Temperature display unit: ${obj.temperatureUnit}`);
|
|
1954
2008
|
this.emit('info', `${heatPumpName}, Lock physical controls: ${lockPhysicalControl ? 'Locked' : 'Unlocked'}`);
|
|
2009
|
+
if (this.accountType === 'melcloudhome') this.emit('info', `Signal strength: ${deviceData.rssi}dBm`);
|
|
1955
2010
|
break;
|
|
1956
2011
|
case caseZone1: //Zone 1 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
1957
2012
|
operationModeText = idleZone1 ? HeatPump.ZoneOperationMapEnumToString[6] : HeatPump.ZoneOperationMapEnumToString[operationModeZone1];
|
|
@@ -2078,6 +2133,13 @@ class DeviceAtw extends EventEmitter {
|
|
|
2078
2133
|
this.connectService?.updateCharacteristic(Characteristic.ContactSensorState, isConnected);
|
|
2079
2134
|
this.errorService?.updateCharacteristic(Characteristic.ContactSensorState, isInError);
|
|
2080
2135
|
|
|
2136
|
+
//frost protection
|
|
2137
|
+
if (this.frostProtectionSupport && frostProtectionEnabled !== null) {
|
|
2138
|
+
this.frostProtectionControlService?.updateCharacteristic(Characteristic.On, frostProtectionEnabled);
|
|
2139
|
+
this.frostProtectionControlSensorService?.updateCharacteristic(Characteristic.ContactSensorState, frostProtectionEnabled);
|
|
2140
|
+
this.frostProtectionSensorService?.updateCharacteristic(Characteristic.ContactSensorState, frostProtectionActive);
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2081
2143
|
//holiday mode
|
|
2082
2144
|
if (this.holidayModeSupport && holidayModeEnabled !== null) {
|
|
2083
2145
|
this.holidayModeControlService?.updateCharacteristic(Characteristic.On, holidayModeEnabled);
|
package/src/deviceerv.js
CHANGED
|
@@ -1571,6 +1571,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1571
1571
|
if (supportsCO2Sensor) this.emit('info', `CO2 level: ${roomCO2Level} ppm`);
|
|
1572
1572
|
if (supportsPM25Sensor) this.emit('info', `PM2.5 air quality: ${Ventilation.PM25AirQualityMapEnumToString[pM25AirQuality]}`);
|
|
1573
1573
|
if (supportsPM25Sensor) this.emit('info', `PM2.5 level: ${pM25Level} µg/m`);
|
|
1574
|
+
if (this.accountType === 'melcloudhome') this.emit('info', `Signal strength: ${deviceData.rssi}dBm`);
|
|
1574
1575
|
};
|
|
1575
1576
|
})
|
|
1576
1577
|
.on('success', (success) => this.emit('success', success))
|