homebridge-melcloud-control 4.2.3-beta.4 → 4.2.3-beta.41
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/homebridge-ui/server.js +2 -1
- package/index.js +6 -5
- package/package.json +1 -1
- package/src/constants.js +46 -5
- package/src/deviceata.js +6 -8
- package/src/deviceatw.js +22 -17
- package/src/deviceerv.js +5 -7
- package/src/melcloud.js +38 -371
- package/src/melcloudata.js +24 -26
- package/src/melcloudatw.js +35 -33
- package/src/melclouderv.js +27 -27
- package/src/melcloudhome.js +403 -0
package/homebridge-ui/server.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HomebridgePluginUiServer } from '@homebridge/plugin-ui-utils';
|
|
2
2
|
import MelCloud from '../src/melcloud.js';
|
|
3
|
+
import MelCloudHome from '../src/melcloudhome.js';
|
|
3
4
|
|
|
4
5
|
class PluginUiServer extends HomebridgePluginUiServer {
|
|
5
6
|
constructor() {
|
|
@@ -17,7 +18,7 @@ class PluginUiServer extends HomebridgePluginUiServer {
|
|
|
17
18
|
const accountFile = `${this.homebridgeStoragePath}/melcloud/${accountName}_Account`;
|
|
18
19
|
const buildingsFile = `${this.homebridgeStoragePath}/melcloud/${accountName}_Buildings`;
|
|
19
20
|
const devicesFile = `${this.homebridgeStoragePath}/melcloud/${accountName}_Devices`;
|
|
20
|
-
const melCloud = new MelCloud(account, accountFile, buildingsFile, devicesFile);
|
|
21
|
+
const melCloud = account.type === 'melcloud' ? new MelCloud(account, accountFile, buildingsFile, devicesFile) : new MelCloudHome(account, accountFile, buildingsFile, devicesFile);
|
|
21
22
|
|
|
22
23
|
try {
|
|
23
24
|
const accountInfo = await melCloud.connect();
|
package/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { join } from 'path';
|
|
2
2
|
import { mkdirSync, existsSync, writeFileSync } from 'fs';
|
|
3
3
|
import MelCloud from './src/melcloud.js';
|
|
4
|
+
import MelCloudHome from './src/melcloudhome.js';
|
|
4
5
|
import DeviceAta from './src/deviceata.js';
|
|
5
6
|
import DeviceAtw from './src/deviceatw.js';
|
|
6
7
|
import DeviceErv from './src/deviceerv.js';
|
|
@@ -84,8 +85,8 @@ class MelCloudPlatform {
|
|
|
84
85
|
.on('start', async () => {
|
|
85
86
|
try {
|
|
86
87
|
//melcloud account
|
|
87
|
-
const melCloud = new MelCloud(account, accountFile, buildingsFile, devicesFile, true)
|
|
88
|
-
|
|
88
|
+
const melCloud = account.type === 'melcloud' ? new MelCloud(account, accountFile, buildingsFile, devicesFile, true) : new MelCloudHome(account, accountFile, buildingsFile, devicesFile, true);
|
|
89
|
+
melCloud.on('success', (msg) => logLevel.success && log.success(`${accountName}, ${msg}`))
|
|
89
90
|
.on('info', (msg) => logLevel.info && log.info(`${accountName}, ${msg}`))
|
|
90
91
|
.on('debug', (msg) => logLevel.debug && log.info(`${accountName}, debug: ${msg}`))
|
|
91
92
|
.on('warn', (msg) => logLevel.warn && log.warn(`${accountName}, ${msg}`))
|
|
@@ -182,8 +183,8 @@ class MelCloudPlatform {
|
|
|
182
183
|
|
|
183
184
|
configuredDevice.on('melCloud', async (key, value) => {
|
|
184
185
|
try {
|
|
185
|
-
accountInfo.LoginData[key] = value;
|
|
186
|
-
await melCloud.send(
|
|
186
|
+
const accountDate = account.type === 'melcloud' ? accountInfo.LoginData[key] = value : accountInfo[key];
|
|
187
|
+
await melCloud.send(accountDate);
|
|
187
188
|
} catch (error) {
|
|
188
189
|
if (logLevel.error) log.error(`${accountName}, ${deviceTypeText}, ${deviceName}, ${error.message ?? error}.`);
|
|
189
190
|
}
|
|
@@ -203,7 +204,7 @@ class MelCloudPlatform {
|
|
|
203
204
|
//start impulse generators\
|
|
204
205
|
const timmers = accountType === 'melcloudhome' ? [{ name: 'connect', sampling: 1800000 }, { name: 'checkDevicesList', sampling: deviceRefreshInterval }] : [{ name: 'checkDevicesList', sampling: refreshInterval }];
|
|
205
206
|
await melCloud.impulseGenerator.state(true, timmers, false);
|
|
206
|
-
await configuredDevice.startStopImpulseGenerator(true, [{ name: 'checkState', sampling: deviceRefreshInterval
|
|
207
|
+
await configuredDevice.startStopImpulseGenerator(true, [{ name: 'checkState', sampling: deviceRefreshInterval }]);
|
|
207
208
|
|
|
208
209
|
//stop impulse generator
|
|
209
210
|
await impulseGenerator.state(false);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.2.3-beta.
|
|
4
|
+
"version": "4.2.3-beta.41",
|
|
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
|
@@ -20,14 +20,26 @@ export const ApiUrls = {
|
|
|
20
20
|
export const ApiUrlsHome = {
|
|
21
21
|
BaseURL: "https://melcloudhome.com",
|
|
22
22
|
GetUserContext: "/api/user/context",
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
GetUserScenes: "/api/user/scenes",
|
|
24
|
+
PutAta: "/api/ataunit/deviceid",
|
|
25
|
+
PutAtw: "/api/atwunit/deviceid",
|
|
26
|
+
PutErv: "/api/ervunit/deviceid",
|
|
27
27
|
PostSchedule: " /api/cloudschedule/deviceid", // POST {"days":[2],"time":"17:59:00","enabled":true,"id":"53c5e804-0663-47d0-85c2-2d8ccd2573de","power":false,"operationMode":null,"setPoint":null,"vaneVerticalDirection":null,"vaneHorizontalDirection":null,"setFanSpeed":null}
|
|
28
28
|
PostProtectionFrost: "/api/protection/frost", // POST {"enabled":true,"min":13,"max":16,"units":{"ATA":["ef333525-2699-4290-af5a-2922566676da"]}}
|
|
29
29
|
PostProtectionOverheat: "api/protection/overheat", // POST {"enabled":true,"min":32,"max":35,"units":{"ATA":["ef333525-2699-4290-af5a-2922566676da"]}}
|
|
30
|
-
PostHolidayMode: " /api/holidaymode" // POST {"enabled":true,"startDate":"2025-11-11T17:42:24.913","endDate":"2026-06-01T09:18:00","units":{"ATA":["ef333525-2699-4290-af5a-2922566676da"]}}
|
|
30
|
+
PostHolidayMode: " /api/holidaymode", // POST {"enabled":true,"startDate":"2025-11-11T17:42:24.913","endDate":"2026-06-01T09:18:00","units":{"ATA":["ef333525-2699-4290-af5a-2922566676da"]}}
|
|
31
|
+
PutScheduleEnabled: "/api/cloudschedule/deviceid/enabled", // PUT {"enabled":true}
|
|
32
|
+
PutSceneEnable: "/api/scene/sceneid/enable",
|
|
33
|
+
PutSceneDisable: "/api/scene/sceneid/disable",
|
|
34
|
+
Referers: {
|
|
35
|
+
GetPutScenes: "https://melcloudhome.com/scenes",
|
|
36
|
+
PostHolidayMode: "https://melcloudhome.com/ata/deviceid/holidaymode",
|
|
37
|
+
PostProtectionFrost: "https://melcloudhome.com/ata/deviceid/frostprotection",
|
|
38
|
+
PostProtectionOverheat: "https://melcloudhome.com/ata/deviceid/overheatprotection",
|
|
39
|
+
PutDeviceSettings: "https://melcloudhome.com/dashboard",
|
|
40
|
+
PutScheduleEnabled: "https://melcloudhome.com/ata/deviceid/schedule",
|
|
41
|
+
},
|
|
42
|
+
Origin: "https://melcloudhome.com"
|
|
31
43
|
};
|
|
32
44
|
|
|
33
45
|
export const DeviceType = [
|
|
@@ -163,3 +175,32 @@ export const AccessLevel = {
|
|
|
163
175
|
Quest: 3,
|
|
164
176
|
Owner: 4
|
|
165
177
|
};
|
|
178
|
+
|
|
179
|
+
export const LanguageLocaleMap = {
|
|
180
|
+
"0": "en-US,en;q=0.9",
|
|
181
|
+
"1": "bg-BG,bg;q=0.9",
|
|
182
|
+
"2": "cs-CZ,cs;q=0.9",
|
|
183
|
+
"3": "da-DK,da;q=0.9",
|
|
184
|
+
"4": "de-DE,de;q=0.9",
|
|
185
|
+
"5": "et-EE,et;q=0.9",
|
|
186
|
+
"6": "es-ES,es;q=0.9",
|
|
187
|
+
"7": "fr-FR,fr;q=0.9",
|
|
188
|
+
"8": "hy-AM,hy;q=0.9",
|
|
189
|
+
"9": "lv-LV,lv;q=0.9",
|
|
190
|
+
"10": "lt-LT,lt;q=0.9",
|
|
191
|
+
"11": "hu-HU,hu;q=0.9",
|
|
192
|
+
"12": "nl-NL,nl;q=0.9",
|
|
193
|
+
"13": "no-NO,no;q=0.9",
|
|
194
|
+
"14": "pl-PL,pl;q=0.9",
|
|
195
|
+
"15": "pt-PT,pt;q=0.9",
|
|
196
|
+
"16": "ru-RU,ru;q=0.9",
|
|
197
|
+
"17": "fi-FI,fi;q=0.9",
|
|
198
|
+
"18": "sv-SE,sv;q=0.9",
|
|
199
|
+
"19": "it-IT,it;q=0.9",
|
|
200
|
+
"20": "uk-UA,uk;q=0.9",
|
|
201
|
+
"21": "tr-TR,tr;q=0.9",
|
|
202
|
+
"22": "el-GR,el;q=0.9",
|
|
203
|
+
"23": "hr-HR,hr;q=0.9",
|
|
204
|
+
"24": "ro-RO,ro;q=0.9",
|
|
205
|
+
"25": "sl-SI,sl;q=0.9"
|
|
206
|
+
};
|
package/src/deviceata.js
CHANGED
|
@@ -334,8 +334,6 @@ class DeviceAta extends EventEmitter {
|
|
|
334
334
|
return state;
|
|
335
335
|
})
|
|
336
336
|
.onSet(async (state) => {
|
|
337
|
-
if (!!state === this.accessory.power) return;
|
|
338
|
-
|
|
339
337
|
try {
|
|
340
338
|
deviceData.Device.Power = state ? true : false;
|
|
341
339
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, AirConditioner.EffectiveFlags.Power);
|
|
@@ -1211,7 +1209,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1211
1209
|
try {
|
|
1212
1210
|
//melcloud device
|
|
1213
1211
|
this.melCloudAta = new MelCloudAta(this.account, this.device, this.devicesFile, this.defaultTempsFile)
|
|
1214
|
-
.on('deviceInfo', (
|
|
1212
|
+
.on('deviceInfo', (modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion) => {
|
|
1215
1213
|
if (this.logDeviceInfo && this.displayDeviceInfo) {
|
|
1216
1214
|
this.emit('devInfo', `---- ${this.deviceTypeText}: ${this.deviceName} ----`);
|
|
1217
1215
|
this.emit('devInfo', `Account: ${this.accountName}`);
|
|
@@ -1219,13 +1217,13 @@ class DeviceAta extends EventEmitter {
|
|
|
1219
1217
|
if (modelOutdoor) this.emit('devInfo', `Outdoor: ${modelOutdoor}`);
|
|
1220
1218
|
if (serialNumber) this.emit('devInfo', `Serial: ${serialNumber}`);
|
|
1221
1219
|
if (firmwareAppVersion) this.emit('devInfo', `Firmware: ${firmwareAppVersion}`);
|
|
1222
|
-
this.emit('devInfo', `Manufacturer:
|
|
1220
|
+
this.emit('devInfo', `Manufacturer: Mitsubishi`);
|
|
1223
1221
|
this.emit('devInfo', '----------------------------------');
|
|
1224
1222
|
this.displayDeviceInfo = false;
|
|
1225
1223
|
}
|
|
1226
1224
|
|
|
1227
1225
|
//accessory info
|
|
1228
|
-
this.manufacturer =
|
|
1226
|
+
this.manufacturer = 'Mitsubishi';
|
|
1229
1227
|
this.model = modelIndoor ? modelIndoor : modelOutdoor ? modelOutdoor : `${this.deviceTypeText}`;
|
|
1230
1228
|
this.serialNumber = serialNumber.toString();
|
|
1231
1229
|
this.firmwareRevision = firmwareAppVersion.toString();
|
|
@@ -1331,7 +1329,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1331
1329
|
maxTempHeat: maxTempHeat,
|
|
1332
1330
|
minTempCoolDryAuto: minTempCoolDryAuto,
|
|
1333
1331
|
maxTempCoolDryAuto: maxTempCoolDryAuto,
|
|
1334
|
-
power: power
|
|
1332
|
+
power: power,
|
|
1335
1333
|
inStandbyMode: inStandbyMode,
|
|
1336
1334
|
operationMode: operationMode,
|
|
1337
1335
|
currentOperationMode: 0,
|
|
@@ -1427,7 +1425,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1427
1425
|
|
|
1428
1426
|
//update characteristics
|
|
1429
1427
|
this.melCloudService
|
|
1430
|
-
?.updateCharacteristic(Characteristic.Active, power
|
|
1428
|
+
?.updateCharacteristic(Characteristic.Active, power)
|
|
1431
1429
|
.updateCharacteristic(Characteristic.CurrentHeaterCoolerState, obj.currentOperationMode)
|
|
1432
1430
|
.updateCharacteristic(Characteristic.TargetHeaterCoolerState, obj.targetOperationMode)
|
|
1433
1431
|
.updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
|
|
@@ -1693,7 +1691,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1693
1691
|
|
|
1694
1692
|
//log current state
|
|
1695
1693
|
if (this.logInfo) {
|
|
1696
|
-
this.emit('info', `Power: ${power ? '
|
|
1694
|
+
this.emit('info', `Power: ${power ? 'On' : 'Off'}`);
|
|
1697
1695
|
this.emit('info', `Target operation mode: ${AirConditioner.OperationModeMapEnumToString[operationMode]}`);
|
|
1698
1696
|
this.emit('info', `Current operation mode: ${this.displayType === 1 ? AirConditioner.CurrentOperationModeHeatherCoolerMapEnumToString[obj.currentOperationMode] : AirConditioner.CurrentOperationModeThermostatMapEnumToString[obj.currentOperationMode]}`);
|
|
1699
1697
|
this.emit('info', `Target temperature: ${setTemperature}${obj.temperatureUnit}`);
|
package/src/deviceatw.js
CHANGED
|
@@ -340,8 +340,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
340
340
|
return state;
|
|
341
341
|
})
|
|
342
342
|
.onSet(async (state) => {
|
|
343
|
-
if (!!state === this.accessory.power) return;
|
|
344
|
-
|
|
345
343
|
try {
|
|
346
344
|
switch (i) {
|
|
347
345
|
case 0: //Heat Pump
|
|
@@ -1340,8 +1338,15 @@ class DeviceAtw extends EventEmitter {
|
|
|
1340
1338
|
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
|
|
1341
1339
|
break;
|
|
1342
1340
|
case 3: //HOLIDAY
|
|
1343
|
-
|
|
1344
|
-
|
|
1341
|
+
if (this.accountType === 'melcloud') {
|
|
1342
|
+
deviceData.Device.HolidayMode = state;
|
|
1343
|
+
effectiveFlags = HeatPump.EffectiveFlags.HolidayMode;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
if (this.accountType === 'melcloudhome') {
|
|
1347
|
+
deviceData.Device.HolidayMode.Enabled = state;
|
|
1348
|
+
effectiveFlags = 'holidaymode';
|
|
1349
|
+
}
|
|
1345
1350
|
break;
|
|
1346
1351
|
case 10: //ALL ZONES PHYSICAL LOCK CONTROL
|
|
1347
1352
|
deviceData.Device.ProhibitZone1 = state;
|
|
@@ -1471,7 +1476,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1471
1476
|
try {
|
|
1472
1477
|
//melcloud device
|
|
1473
1478
|
this.melCloudAtw = new MelCloudAtw(this.account, this.device, this.devicesFile, this.defaultTempsFile)
|
|
1474
|
-
.on('deviceInfo', (
|
|
1479
|
+
.on('deviceInfo', ( modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion, supportsHotWaterTank, supportsZone2) => {
|
|
1475
1480
|
if (this.logDeviceInfo && this.displayDeviceInfo) {
|
|
1476
1481
|
this.emit('devInfo', `---- ${this.deviceTypeText}: ${this.deviceName} ----`);
|
|
1477
1482
|
this.emit('devInfo', `Account: ${this.accountName}`);
|
|
@@ -1479,7 +1484,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1479
1484
|
if (modelOutdoor) this.emit('devInfo', `Outdoor: ${modelOutdoor}`);
|
|
1480
1485
|
this.emit('devInfo', `Serial: ${serialNumber}`)
|
|
1481
1486
|
this.emit('devInfo', `Firmware: ${firmwareAppVersion}`);
|
|
1482
|
-
this.emit('devInfo', `Manufacturer:
|
|
1487
|
+
this.emit('devInfo', `Manufacturer: Mitsubishi`);
|
|
1483
1488
|
this.emit('devInfo', '----------------------------------');
|
|
1484
1489
|
this.emit('devInfo', `Zone 1: Yes`);
|
|
1485
1490
|
this.emit('devInfo', `Hot Water Tank: ${supportsHotWaterTank ? 'Yes' : 'No'}`);
|
|
@@ -1489,7 +1494,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1489
1494
|
}
|
|
1490
1495
|
|
|
1491
1496
|
//accessory info
|
|
1492
|
-
this.manufacturer =
|
|
1497
|
+
this.manufacturer = 'Mitsubishi';
|
|
1493
1498
|
this.model = modelIndoor ? modelIndoor : modelOutdoor ? modelOutdoor : `${this.deviceTypeText} ${this.deviceId}`;
|
|
1494
1499
|
this.serialNumber = serialNumber.toString();
|
|
1495
1500
|
this.firmwareRevision = firmwareAppVersion.toString();
|
|
@@ -1510,7 +1515,8 @@ class DeviceAtw extends EventEmitter {
|
|
|
1510
1515
|
const scheduleEnabled = deviceData.ScheduleEnabled;
|
|
1511
1516
|
const schedulesOnServer = deviceData.Schedule ?? [];
|
|
1512
1517
|
const presetsOnServer = deviceData.Presets ?? [];
|
|
1513
|
-
const
|
|
1518
|
+
const holidayMode = deviceData.Device.HolidayMode;
|
|
1519
|
+
const holidayModeEnabled = accountTypeMelcloud ? holidayMode : deviceData.HolidayMode?.Enabled;
|
|
1514
1520
|
const holidayModeActive = deviceData.HolidayMode?.Active ?? false;
|
|
1515
1521
|
|
|
1516
1522
|
//device info
|
|
@@ -1545,12 +1551,11 @@ class DeviceAtw extends EventEmitter {
|
|
|
1545
1551
|
|
|
1546
1552
|
//heat pump
|
|
1547
1553
|
const heatPumpName = 'Heat Pump';
|
|
1548
|
-
const power = deviceData.Device.Power
|
|
1554
|
+
const power = deviceData.Device.Power;
|
|
1549
1555
|
const inStandbyMode = deviceData.Device.InStandbyMode;
|
|
1550
1556
|
const unitStatus = deviceData.Device.UnitStatus ?? 0;
|
|
1551
1557
|
const operationMode = deviceData.Device.OperationMode;
|
|
1552
1558
|
const outdoorTemperature = deviceData.Device.OutdoorTemperature;
|
|
1553
|
-
const holidayMode = deviceData.Device.HolidayMode ?? false;
|
|
1554
1559
|
const flowTemperatureHeatPump = deviceData.Device.FlowTemperature;
|
|
1555
1560
|
const returnTemperatureHeatPump = deviceData.Device.ReturnTemperature;
|
|
1556
1561
|
const isConnected = accountTypeMelcloud ? !deviceData.Device[connectKey] : deviceData.Device[connectKey];
|
|
@@ -1594,7 +1599,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1594
1599
|
const obj = {
|
|
1595
1600
|
presets: presetsOnServer,
|
|
1596
1601
|
schedules: schedulesOnServer,
|
|
1597
|
-
power: power
|
|
1602
|
+
power: power,
|
|
1598
1603
|
inStandbyMode: inStandbyMode,
|
|
1599
1604
|
unitStatus: unitStatus,
|
|
1600
1605
|
idleZone1: idleZone1,
|
|
@@ -1880,11 +1885,11 @@ class DeviceAtw extends EventEmitter {
|
|
|
1880
1885
|
let operationModeText = '';
|
|
1881
1886
|
switch (i) {
|
|
1882
1887
|
case caseHeatPump: //Heat Pump - HEAT, COOL, OFF
|
|
1883
|
-
this.emit('info', `${heatPumpName}, Power: ${power ? '
|
|
1888
|
+
this.emit('info', `${heatPumpName}, Power: ${power ? 'On' : 'Off'}`)
|
|
1884
1889
|
this.emit('info', `${heatPumpName}, Operation mode: ${HeatPump.SystemMapEnumToString[unitStatus]}`);
|
|
1885
1890
|
this.emit('info', `${heatPumpName},'Outdoor temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1886
1891
|
this.emit('info', `${heatPumpName}, Temperature display unit: ${obj.temperatureUnit}`);
|
|
1887
|
-
this.emit('info', `${heatPumpName}, Lock physical controls: ${lockPhysicalControl ? '
|
|
1892
|
+
this.emit('info', `${heatPumpName}, Lock physical controls: ${lockPhysicalControl ? 'Locked' : 'Unlocked'}`);
|
|
1888
1893
|
break;
|
|
1889
1894
|
case caseZone1: //Zone 1 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
1890
1895
|
operationModeText = idleZone1 ? HeatPump.ZoneOperationMapEnumToString[6] : HeatPump.ZoneOperationMapEnumToString[operationModeZone1];
|
|
@@ -1892,7 +1897,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1892
1897
|
this.emit('info', `${zone1Name}, Temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1893
1898
|
this.emit('info', `${zone1Name}, Target temperature: ${setTemperature}${obj.temperatureUnit}`)
|
|
1894
1899
|
this.emit('info', `${zone1Name}, Temperature display unit: ${obj.temperatureUnit}`);
|
|
1895
|
-
this.emit('info', `${zone1Name}, Lock physical controls: ${lockPhysicalControl ? '
|
|
1900
|
+
this.emit('info', `${zone1Name}, Lock physical controls: ${lockPhysicalControl ? 'Locked' : 'Unlocked'}`);
|
|
1896
1901
|
break;
|
|
1897
1902
|
case caseHotWater: //Hot Water - AUTO, HEAT NOW
|
|
1898
1903
|
operationModeText = operationMode === 1 ? HeatPump.ForceDhwMapEnumToString[1] : HeatPump.ForceDhwMapEnumToString[forcedHotWaterMode ? 1 : 0];
|
|
@@ -1900,7 +1905,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1900
1905
|
this.emit('info', `${hotWaterName}, Temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1901
1906
|
this.emit('info', `${hotWaterName}, Target temperature: ${setTemperature}${obj.temperatureUnit}`)
|
|
1902
1907
|
this.emit('info', `${hotWaterName}, Temperature display unit: ${obj.temperatureUnit}`);
|
|
1903
|
-
this.emit('info', `${hotWaterName}, Lock physical controls: ${lockPhysicalControl ? '
|
|
1908
|
+
this.emit('info', `${hotWaterName}, Lock physical controls: ${lockPhysicalControl ? 'Locked' : 'Unlocked'}`);
|
|
1904
1909
|
break;
|
|
1905
1910
|
case caseZone2: //Zone 2 - HEAT THERMOSTAT, HEAT FLOW, HEAT CURVE, COOL THERMOSTAT, COOL FLOW, FLOOR DRY UP
|
|
1906
1911
|
operationModeText = idleZone2 ? HeatPump.ZoneOperationMapEnumToString[6] : HeatPump.ZoneOperationMapEnumToString[operationModeZone2];
|
|
@@ -1908,7 +1913,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1908
1913
|
this.emit('info', `${zone2Name}, Temperature: ${roomTemperature}${obj.temperatureUnit}`);
|
|
1909
1914
|
this.emit('info', `${zone2Name}, Target temperature: ${setTemperature}${obj.temperatureUnit}`)
|
|
1910
1915
|
this.emit('info', `${zone2Name}, Temperature display unit: ${obj.temperatureUnit}`);
|
|
1911
|
-
this.emit('info', `${zone2Name}, Lock physical controls: ${lockPhysicalControl ? '
|
|
1916
|
+
this.emit('info', `${zone2Name}, Lock physical controls: ${lockPhysicalControl ? 'Locked' : 'Unlocked'}`);
|
|
1912
1917
|
break;
|
|
1913
1918
|
};
|
|
1914
1919
|
};
|
|
@@ -2065,7 +2070,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
2065
2070
|
button.state = power ? (operationMode === 1) : false;
|
|
2066
2071
|
break;
|
|
2067
2072
|
case 53: //HOLIDAY
|
|
2068
|
-
button.state = power ? (
|
|
2073
|
+
button.state = power ? (holidayModeEnabled === true) : false;
|
|
2069
2074
|
break;
|
|
2070
2075
|
case 10: //ALL ZONES PHYSICAL LOCK CONTROL
|
|
2071
2076
|
button.state = power ? (prohibitZone1 === true && prohibitHotWater === true && prohibitZone2 === true) : false;
|
package/src/deviceerv.js
CHANGED
|
@@ -305,8 +305,6 @@ class DeviceErv extends EventEmitter {
|
|
|
305
305
|
return state;
|
|
306
306
|
})
|
|
307
307
|
.onSet(async (state) => {
|
|
308
|
-
if (!!state === this.accessory.power) return;
|
|
309
|
-
|
|
310
308
|
try {
|
|
311
309
|
deviceData.Device.Power = state ? true : false;
|
|
312
310
|
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, Ventilation.EffectiveFlags.Power);
|
|
@@ -1023,7 +1021,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1023
1021
|
try {
|
|
1024
1022
|
//melcloud device
|
|
1025
1023
|
this.melCloudErv = new MelCloudErv(this.account, this.device, this.devicesFile, this.defaultTempsFile)
|
|
1026
|
-
.on('deviceInfo', (
|
|
1024
|
+
.on('deviceInfo', (modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion) => {
|
|
1027
1025
|
if (this.logDeviceInfo && this.displayDeviceInfo) {
|
|
1028
1026
|
this.emit('devInfo', `---- ${this.deviceTypeText}: ${this.deviceName} ----`);
|
|
1029
1027
|
this.emit('devInfo', `Account: ${this.accountName}`);
|
|
@@ -1031,13 +1029,13 @@ class DeviceErv extends EventEmitter {
|
|
|
1031
1029
|
if (modelOutdoor) this.emit('devInfo', `Outdoor: ${modelOutdoor}`);
|
|
1032
1030
|
this.emit('devInfo', `Serial: ${serialNumber}`);
|
|
1033
1031
|
this.emit('devInfo', `Firmware: ${firmwareAppVersion}`);
|
|
1034
|
-
this.emit('devInfo', `Manufacturer:
|
|
1032
|
+
this.emit('devInfo', `Manufacturer: Mitsubishi`);
|
|
1035
1033
|
this.emit('devInfo', '----------------------------------');
|
|
1036
1034
|
this.displayDeviceInfo = false;
|
|
1037
1035
|
}
|
|
1038
1036
|
|
|
1039
1037
|
//accessory info
|
|
1040
|
-
this.manufacturer =
|
|
1038
|
+
this.manufacturer = 'Mitsubishi';
|
|
1041
1039
|
this.model = modelIndoor ? modelIndoor : modelOutdoor ? modelOutdoor : `${this.deviceTypeText} ${this.deviceId}`;
|
|
1042
1040
|
this.serialNumber = serialNumber.toString();
|
|
1043
1041
|
this.firmwareRevision = firmwareAppVersion.toString();
|
|
@@ -1136,7 +1134,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1136
1134
|
actualVentilationMode: actualVentilationMode,
|
|
1137
1135
|
numberOfFanSpeeds: numberOfFanSpeeds,
|
|
1138
1136
|
supportsFanSpeed: supportsFanSpeed,
|
|
1139
|
-
power: power
|
|
1137
|
+
power: power,
|
|
1140
1138
|
inStandbyMode: inStandbyMode,
|
|
1141
1139
|
operationMode: operationMode,
|
|
1142
1140
|
currentOperationMode: 0,
|
|
@@ -1402,7 +1400,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1402
1400
|
|
|
1403
1401
|
//log current state
|
|
1404
1402
|
if (this.logInfo) {
|
|
1405
|
-
this.emit('info', `Power: ${power ? '
|
|
1403
|
+
this.emit('info', `Power: ${power ? 'On' : 'Off'}`);
|
|
1406
1404
|
this.emit('info', `Target ventilation mode: ${Ventilation.OperationModeMapEnumToString[ventilationMode]}`);
|
|
1407
1405
|
this.emit('info', `Current ventilation mode: ${Ventilation.OperationModeMapEnumToString[actualVentilationMode]}`);
|
|
1408
1406
|
this.emit('info', `Target temperature: ${setTemperature}${obj.temperatureUnit}`);
|