homebridge-melcloud-control 4.2.6-beta.0 → 4.2.6-beta.10
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/package.json +1 -1
- package/src/deviceata.js +40 -45
- package/src/deviceatw.js +21 -85
- package/src/deviceerv.js +21 -30
- package/src/melcloudata.js +1 -1
- package/src/melclouderv.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -22,6 +22,14 @@ 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.2.6] - (xx.11.2025)
|
|
26
|
+
|
|
27
|
+
## Changes
|
|
28
|
+
|
|
29
|
+
- fix displays (-270 grad) for temperature sensor
|
|
30
|
+
- stability improvements of RESTFul and MQTT start
|
|
31
|
+
- cleanup
|
|
32
|
+
|
|
25
33
|
# [4.2.5] - (17.11.2025)
|
|
26
34
|
|
|
27
35
|
## Changes
|
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.6-beta.
|
|
4
|
+
"version": "4.2.6-beta.10",
|
|
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
|
@@ -104,10 +104,11 @@ class DeviceAta extends EventEmitter {
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
async externalIntegrations() {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
//RESTFul server
|
|
108
|
+
const restFulEnabled = this.restFul.enable || false;
|
|
109
|
+
if (restFulEnabled) {
|
|
110
|
+
try {
|
|
111
|
+
|
|
111
112
|
if (!this.restFulConnected) {
|
|
112
113
|
this.restFul1 = new RestFul({
|
|
113
114
|
port: this.restFul.port,
|
|
@@ -135,11 +136,15 @@ class DeviceAta extends EventEmitter {
|
|
|
135
136
|
this.emit('error', error);
|
|
136
137
|
});
|
|
137
138
|
}
|
|
138
|
-
}
|
|
139
|
+
} catch (error) {
|
|
140
|
+
this.emit('warn', `RESTFul integration start error: ${error}`);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
139
143
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
144
|
+
//MQTT client
|
|
145
|
+
const mqttEnabled = this.mqtt.enable || false;
|
|
146
|
+
if (mqttEnabled) {
|
|
147
|
+
try {
|
|
143
148
|
if (!this.mqttConnected) {
|
|
144
149
|
this.mqtt1 = new Mqtt({
|
|
145
150
|
host: this.mqtt.host,
|
|
@@ -175,10 +180,10 @@ class DeviceAta extends EventEmitter {
|
|
|
175
180
|
this.emit('error', error);
|
|
176
181
|
});
|
|
177
182
|
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
183
|
+
} catch (error) {
|
|
184
|
+
this.emit('warn', `MQTT integration start error: ${error}`);
|
|
185
|
+
};
|
|
186
|
+
}
|
|
182
187
|
}
|
|
183
188
|
|
|
184
189
|
async setOverExternalIntegration(integration, deviceData, key, value) {
|
|
@@ -340,9 +345,9 @@ class DeviceAta extends EventEmitter {
|
|
|
340
345
|
switch (this.displayType) {
|
|
341
346
|
case 1: //Heater Cooler
|
|
342
347
|
if (this.logDebug) this.emit('debug', `Prepare heater/cooler service`);
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
348
|
+
const melCloudService = new Service.HeaterCooler(serviceName, `HeaterCooler ${deviceId}`);
|
|
349
|
+
melCloudService.setPrimaryService(true);
|
|
350
|
+
melCloudService.getCharacteristic(Characteristic.Active)
|
|
346
351
|
.onGet(async () => {
|
|
347
352
|
const state = this.accessory.power;
|
|
348
353
|
return state;
|
|
@@ -357,12 +362,12 @@ class DeviceAta extends EventEmitter {
|
|
|
357
362
|
if (this.logWarn) this.emit('warn', `Set power error: ${error}`);
|
|
358
363
|
};
|
|
359
364
|
});
|
|
360
|
-
|
|
365
|
+
melCloudService.getCharacteristic(Characteristic.CurrentHeaterCoolerState)
|
|
361
366
|
.onGet(async () => {
|
|
362
367
|
const value = this.accessory.currentOperationMode;
|
|
363
368
|
return value;
|
|
364
369
|
});
|
|
365
|
-
|
|
370
|
+
melCloudService.getCharacteristic(Characteristic.TargetHeaterCoolerState)
|
|
366
371
|
.setProps({
|
|
367
372
|
minValue: this.accessory.operationModeSetPropsMinValue,
|
|
368
373
|
maxValue: this.accessory.operationModeSetPropsMaxValue,
|
|
@@ -395,13 +400,13 @@ class DeviceAta extends EventEmitter {
|
|
|
395
400
|
if (this.logWarn) this.emit('warn', `Set operation mode error: ${error}`);
|
|
396
401
|
};
|
|
397
402
|
});
|
|
398
|
-
|
|
403
|
+
melCloudService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
399
404
|
.onGet(async () => {
|
|
400
405
|
const value = this.accessory.roomTemperature;
|
|
401
406
|
return value;
|
|
402
407
|
});
|
|
403
408
|
if (supportsFanSpeed) {
|
|
404
|
-
|
|
409
|
+
melCloudService.getCharacteristic(Characteristic.RotationSpeed)
|
|
405
410
|
.setProps({
|
|
406
411
|
minValue: 0,
|
|
407
412
|
maxValue: this.accessory.fanSpeedSetPropsMaxValue,
|
|
@@ -438,7 +443,7 @@ class DeviceAta extends EventEmitter {
|
|
|
438
443
|
});
|
|
439
444
|
};
|
|
440
445
|
if (supportsSwingFunction) {
|
|
441
|
-
|
|
446
|
+
melCloudService.getCharacteristic(Characteristic.SwingMode)
|
|
442
447
|
.onGet(async () => {
|
|
443
448
|
//Vane Horizontal: Auto, 1, 2, 3, 4, 5, 6, 7 = Sp;it, 12 = Swing //Vertical: Auto, 1, 2, 3, 4, 5, 7 = Swing
|
|
444
449
|
const value = this.accessory.currentSwingMode;
|
|
@@ -455,7 +460,7 @@ class DeviceAta extends EventEmitter {
|
|
|
455
460
|
};
|
|
456
461
|
});
|
|
457
462
|
};
|
|
458
|
-
|
|
463
|
+
melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
|
|
459
464
|
.setProps({
|
|
460
465
|
minValue: this.accessory.minTempCoolDryAuto,
|
|
461
466
|
maxValue: this.accessory.maxTempCoolDryAuto,
|
|
@@ -476,7 +481,7 @@ class DeviceAta extends EventEmitter {
|
|
|
476
481
|
};
|
|
477
482
|
});
|
|
478
483
|
if (supportsHeat) {
|
|
479
|
-
|
|
484
|
+
melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
|
|
480
485
|
.setProps({
|
|
481
486
|
minValue: this.accessory.minTempHeat,
|
|
482
487
|
maxValue: this.accessory.maxTempHeat,
|
|
@@ -497,7 +502,7 @@ class DeviceAta extends EventEmitter {
|
|
|
497
502
|
};
|
|
498
503
|
});
|
|
499
504
|
};
|
|
500
|
-
|
|
505
|
+
melCloudService.getCharacteristic(Characteristic.LockPhysicalControls)
|
|
501
506
|
.onGet(async () => {
|
|
502
507
|
const value = this.accessory.lockPhysicalControl;
|
|
503
508
|
return value;
|
|
@@ -516,7 +521,7 @@ class DeviceAta extends EventEmitter {
|
|
|
516
521
|
if (this.logWarn) this.emit('warn', `Set lock physical controls error: ${error}`);
|
|
517
522
|
};
|
|
518
523
|
});
|
|
519
|
-
|
|
524
|
+
melCloudService.getCharacteristic(Characteristic.TemperatureDisplayUnits)
|
|
520
525
|
.onGet(async () => {
|
|
521
526
|
const value = this.accessory.useFahrenheit;
|
|
522
527
|
return value;
|
|
@@ -533,18 +538,18 @@ class DeviceAta extends EventEmitter {
|
|
|
533
538
|
if (this.logWarn) this.emit('warn', `Set temperature display unit error: ${error}`);
|
|
534
539
|
};
|
|
535
540
|
});
|
|
536
|
-
|
|
541
|
+
this.melCloudService = melCloudService;
|
|
537
542
|
break;
|
|
538
543
|
case 2: //Thermostat
|
|
539
544
|
if (this.logDebug) this.emit('debug', `Prepare thermostat service`);
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
545
|
+
const melCloudServiceT = new Service.Thermostat(serviceName, `HeaterCooler ${deviceId}`);
|
|
546
|
+
melCloudServiceT.setPrimaryService(true);
|
|
547
|
+
melCloudServiceT.getCharacteristic(Characteristic.CurrentHeatingCoolingState)
|
|
543
548
|
.onGet(async () => {
|
|
544
549
|
const value = this.accessory.currentOperationMode;
|
|
545
550
|
return value;
|
|
546
551
|
});
|
|
547
|
-
|
|
552
|
+
melCloudServiceT.getCharacteristic(Characteristic.TargetHeatingCoolingState)
|
|
548
553
|
.setProps({
|
|
549
554
|
minValue: this.accessory.operationModeSetPropsMinValue,
|
|
550
555
|
maxValue: this.accessory.operationModeSetPropsMaxValue,
|
|
@@ -587,12 +592,12 @@ class DeviceAta extends EventEmitter {
|
|
|
587
592
|
if (this.logWarn) this.emit('warn', `Set operation mode error: ${error}`);
|
|
588
593
|
};
|
|
589
594
|
});
|
|
590
|
-
|
|
595
|
+
melCloudServiceT.getCharacteristic(Characteristic.CurrentTemperature)
|
|
591
596
|
.onGet(async () => {
|
|
592
597
|
const value = this.accessory.roomTemperature;
|
|
593
598
|
return value;
|
|
594
599
|
});
|
|
595
|
-
|
|
600
|
+
melCloudServiceT.getCharacteristic(Characteristic.TargetTemperature)
|
|
596
601
|
.setProps({
|
|
597
602
|
minValue: this.accessory.minTempHeat,
|
|
598
603
|
maxValue: this.accessory.maxTempHeat,
|
|
@@ -611,7 +616,7 @@ class DeviceAta extends EventEmitter {
|
|
|
611
616
|
if (this.logWarn) this.emit('warn', `Set temperature error: ${error}`);
|
|
612
617
|
};
|
|
613
618
|
});
|
|
614
|
-
|
|
619
|
+
melCloudServiceT.getCharacteristic(Characteristic.TemperatureDisplayUnits)
|
|
615
620
|
.onGet(async () => {
|
|
616
621
|
const value = this.accessory.useFahrenheit;
|
|
617
622
|
return value;
|
|
@@ -628,7 +633,7 @@ class DeviceAta extends EventEmitter {
|
|
|
628
633
|
if (this.logWarn) this.emit('warn', `Set temperature display unit error: ${error}`);
|
|
629
634
|
};
|
|
630
635
|
});
|
|
631
|
-
|
|
636
|
+
this.melCloudService = melCloudServiceT;
|
|
632
637
|
break;
|
|
633
638
|
};
|
|
634
639
|
|
|
@@ -639,11 +644,6 @@ class DeviceAta extends EventEmitter {
|
|
|
639
644
|
this.roomTemperatureSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
640
645
|
this.roomTemperatureSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Room`);
|
|
641
646
|
this.roomTemperatureSensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
642
|
-
.setProps({
|
|
643
|
-
minValue: -35,
|
|
644
|
-
maxValue: 150,
|
|
645
|
-
minStep: 0.5
|
|
646
|
-
})
|
|
647
647
|
.onGet(async () => {
|
|
648
648
|
const state = this.accessory.roomTemperature;
|
|
649
649
|
return state;
|
|
@@ -657,11 +657,6 @@ class DeviceAta extends EventEmitter {
|
|
|
657
657
|
this.outdoorTemperatureSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
658
658
|
this.outdoorTemperatureSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Outdoor`);
|
|
659
659
|
this.outdoorTemperatureSensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
660
|
-
.setProps({
|
|
661
|
-
minValue: -35,
|
|
662
|
-
maxValue: 150,
|
|
663
|
-
minStep: 0.5
|
|
664
|
-
})
|
|
665
660
|
.onGet(async () => {
|
|
666
661
|
const state = this.accessory.outdoorTemperature;
|
|
667
662
|
return state;
|
|
@@ -669,7 +664,7 @@ class DeviceAta extends EventEmitter {
|
|
|
669
664
|
accessory.addService(this.outdoorTemperatureSensorService);
|
|
670
665
|
};
|
|
671
666
|
|
|
672
|
-
//
|
|
667
|
+
//in standby sensor
|
|
673
668
|
if (this.inStandbySensor && this.accessory.inStandbyMode !== null) {
|
|
674
669
|
if (this.logDebug) this.emit('debug', `Prepare in standby mode service`);
|
|
675
670
|
this.inStandbyService = new Service.ContactSensor(`${serviceName} In Standby`, `inStandbyService${deviceId}`);
|
|
@@ -1614,7 +1609,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1614
1609
|
obj.operationModeSetPropsValidValues = supportsAuto && supportsHeat ? [0, 1, 2, 3] : !supportsAuto && supportsHeat ? [0, 1, 2] : supportsAuto && !supportsHeat ? [0, 2, 3] : [0, 2];
|
|
1615
1610
|
|
|
1616
1611
|
//update characteristics
|
|
1617
|
-
this.
|
|
1612
|
+
this.melCloudServiceT
|
|
1618
1613
|
?.updateCharacteristic(Characteristic.CurrentHeatingCoolingState, obj.currentOperationMode)
|
|
1619
1614
|
.updateCharacteristic(Characteristic.TargetHeatingCoolingState, obj.targetOperationMode)
|
|
1620
1615
|
.updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
|
package/src/deviceatw.js
CHANGED
|
@@ -26,6 +26,9 @@ class DeviceAtw extends EventEmitter {
|
|
|
26
26
|
|
|
27
27
|
//device config
|
|
28
28
|
this.device = device;
|
|
29
|
+
this.deviceId = device.id;
|
|
30
|
+
this.deviceName = device.name;
|
|
31
|
+
this.deviceTypeText = device.typeString;
|
|
29
32
|
this.displayType = device.displayType;
|
|
30
33
|
this.hideZone = device.hideZone;
|
|
31
34
|
this.temperatureSensor = device.temperatureSensor || false;
|
|
@@ -45,9 +48,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
45
48
|
this.schedules = this.accountType === 'melcloudhome' ? (device.schedules || []).filter(schedule => (schedule.displayType ?? 0) > 0 && schedule.id !== '0') : [];
|
|
46
49
|
this.scenes = this.accountType === 'melcloudhome' ? (device.scenes || []).filter(scene => (scene.displayType ?? 0) > 0 && scene.id !== '0') : [];
|
|
47
50
|
this.buttons = (device.buttonsSensors || []).filter(button => (button.displayType ?? 0) > 0);
|
|
48
|
-
this.deviceId = device.id;
|
|
49
|
-
this.deviceName = device.name;
|
|
50
|
-
this.deviceTypeText = device.typeString;
|
|
51
51
|
this.devicesFile = devicesFile;
|
|
52
52
|
this.defaultTempsFile = defaultTempsFile;
|
|
53
53
|
this.accountInfo = accountInfo;
|
|
@@ -105,10 +105,11 @@ class DeviceAtw extends EventEmitter {
|
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
async externalIntegrations() {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
//RESTFul server
|
|
109
|
+
const restFulEnabled = this.restFul.enable || false;
|
|
110
|
+
if (restFulEnabled) {
|
|
111
|
+
try {
|
|
112
|
+
|
|
112
113
|
if (!this.restFulConnected) {
|
|
113
114
|
this.restFul1 = new RestFul({
|
|
114
115
|
port: this.restFul.port,
|
|
@@ -136,11 +137,15 @@ class DeviceAtw extends EventEmitter {
|
|
|
136
137
|
this.emit('error', error);
|
|
137
138
|
});
|
|
138
139
|
}
|
|
139
|
-
}
|
|
140
|
+
} catch (error) {
|
|
141
|
+
this.emit('warn', `RESTFul integration start error: ${error}`);
|
|
142
|
+
};
|
|
143
|
+
}
|
|
140
144
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
145
|
+
//MQTT client
|
|
146
|
+
const mqttEnabled = this.mqtt.enable || false;
|
|
147
|
+
if (mqttEnabled) {
|
|
148
|
+
try {
|
|
144
149
|
if (!this.mqttConnected) {
|
|
145
150
|
this.mqtt1 = new Mqtt({
|
|
146
151
|
host: this.mqtt.host,
|
|
@@ -176,10 +181,10 @@ class DeviceAtw extends EventEmitter {
|
|
|
176
181
|
this.emit('error', error);
|
|
177
182
|
});
|
|
178
183
|
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
184
|
+
} catch (error) {
|
|
185
|
+
this.emit('warn', `MQTT integration start error: ${error}`);
|
|
186
|
+
};
|
|
187
|
+
}
|
|
183
188
|
}
|
|
184
189
|
|
|
185
190
|
async setOverExternalIntegration(integration, deviceData, key, value) {
|
|
@@ -465,11 +470,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
465
470
|
};
|
|
466
471
|
});
|
|
467
472
|
melCloudService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
468
|
-
.setProps({
|
|
469
|
-
minValue: -35,
|
|
470
|
-
maxValue: 150,
|
|
471
|
-
minStep: 0.5
|
|
472
|
-
})
|
|
473
473
|
.onGet(async () => {
|
|
474
474
|
const value = zone.roomTemperature;
|
|
475
475
|
return value;
|
|
@@ -780,11 +780,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
780
780
|
};
|
|
781
781
|
});
|
|
782
782
|
melCloudServiceT.getCharacteristic(Characteristic.CurrentTemperature)
|
|
783
|
-
.setProps({
|
|
784
|
-
minValue: -35,
|
|
785
|
-
maxValue: 150,
|
|
786
|
-
minStep: 0.5
|
|
787
|
-
})
|
|
788
783
|
.onGet(async () => {
|
|
789
784
|
const value = zone.roomTemperature;
|
|
790
785
|
return value;
|
|
@@ -864,11 +859,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
864
859
|
this.roomTemperatureSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
865
860
|
this.roomTemperatureSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} ${zoneName}`);
|
|
866
861
|
this.roomTemperatureSensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
867
|
-
.setProps({
|
|
868
|
-
minValue: -35,
|
|
869
|
-
maxValue: 150,
|
|
870
|
-
minStep: 0.5
|
|
871
|
-
})
|
|
872
862
|
.onGet(async () => {
|
|
873
863
|
const state = zone.roomTemperature;
|
|
874
864
|
return state;
|
|
@@ -882,11 +872,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
882
872
|
this.flowTemperatureSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
883
873
|
this.flowTemperatureSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} ${zoneName} Flow`);
|
|
884
874
|
this.flowTemperatureSensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
885
|
-
.setProps({
|
|
886
|
-
minValue: -35,
|
|
887
|
-
maxValue: 150,
|
|
888
|
-
minStep: 0.5
|
|
889
|
-
})
|
|
890
875
|
.onGet(async () => {
|
|
891
876
|
const state = zone.flowTemperature;
|
|
892
877
|
return state;
|
|
@@ -901,11 +886,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
901
886
|
this.returnTemperatureSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
902
887
|
this.returnTemperatureSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} ${zoneName} Return`);
|
|
903
888
|
this.returnTemperatureSensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
904
|
-
.setProps({
|
|
905
|
-
minValue: -35,
|
|
906
|
-
maxValue: 150,
|
|
907
|
-
minStep: 0.5
|
|
908
|
-
})
|
|
909
889
|
.onGet(async () => {
|
|
910
890
|
const state = zone.returnTemperature;
|
|
911
891
|
return state;
|
|
@@ -920,11 +900,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
920
900
|
this.roomTemperatureZone1SensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
921
901
|
this.roomTemperatureZone1SensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} ${zoneName}`);
|
|
922
902
|
this.roomTemperatureZone1SensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
923
|
-
.setProps({
|
|
924
|
-
minValue: -35,
|
|
925
|
-
maxValue: 150,
|
|
926
|
-
minStep: 0.5
|
|
927
|
-
})
|
|
928
903
|
.onGet(async () => {
|
|
929
904
|
const state = zone.roomTemperature;
|
|
930
905
|
return state;
|
|
@@ -938,11 +913,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
938
913
|
this.flowTemperatureZone1SensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
939
914
|
this.flowTemperatureZone1SensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} ${zoneName} Flow`);
|
|
940
915
|
this.flowTemperatureZone1SensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
941
|
-
.setProps({
|
|
942
|
-
minValue: -35,
|
|
943
|
-
maxValue: 150,
|
|
944
|
-
minStep: 0.5
|
|
945
|
-
})
|
|
946
916
|
.onGet(async () => {
|
|
947
917
|
const state = zone.flowTemperature;
|
|
948
918
|
return state;
|
|
@@ -956,11 +926,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
956
926
|
this.returnTemperatureZone1SensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
957
927
|
this.returnTemperatureZone1SensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} ${zoneName} Return`);
|
|
958
928
|
this.returnTemperatureZone1SensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
959
|
-
.setProps({
|
|
960
|
-
minValue: -35,
|
|
961
|
-
maxValue: 150,
|
|
962
|
-
minStep: 0.5
|
|
963
|
-
})
|
|
964
929
|
.onGet(async () => {
|
|
965
930
|
const state = zone.returnTemperature;
|
|
966
931
|
return state;
|
|
@@ -975,11 +940,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
975
940
|
this.roomTemperatureWaterTankSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
976
941
|
this.roomTemperatureWaterTankSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} ${zoneName}`);
|
|
977
942
|
this.roomTemperatureWaterTankSensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
978
|
-
.setProps({
|
|
979
|
-
minValue: -35,
|
|
980
|
-
maxValue: 150,
|
|
981
|
-
minStep: 0.5
|
|
982
|
-
})
|
|
983
943
|
.onGet(async () => {
|
|
984
944
|
const state = zone.roomTemperature;
|
|
985
945
|
return state;
|
|
@@ -993,11 +953,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
993
953
|
this.flowTemperatureWaterTankSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
994
954
|
this.flowTemperatureWaterTankSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} ${zoneName} Flow`);
|
|
995
955
|
this.flowTemperatureWaterTankSensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
996
|
-
.setProps({
|
|
997
|
-
minValue: -35,
|
|
998
|
-
maxValue: 150,
|
|
999
|
-
minStep: 0.5
|
|
1000
|
-
})
|
|
1001
956
|
.onGet(async () => {
|
|
1002
957
|
const state = zone.flowTemperature;
|
|
1003
958
|
return state;
|
|
@@ -1011,11 +966,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
1011
966
|
this.returnTemperatureWaterTankSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1012
967
|
this.returnTemperatureWaterTankSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} ${zoneName} Return`);
|
|
1013
968
|
this.returnTemperatureWaterTankSensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
1014
|
-
.setProps({
|
|
1015
|
-
minValue: -35,
|
|
1016
|
-
maxValue: 150,
|
|
1017
|
-
minStep: 0.5
|
|
1018
|
-
})
|
|
1019
969
|
.onGet(async () => {
|
|
1020
970
|
const state = zone.returnTemperature;
|
|
1021
971
|
return state;
|
|
@@ -1030,11 +980,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
1030
980
|
this.roomTemperatureZone2SensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1031
981
|
this.roomTemperatureZone2SensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} ${zoneName}`);
|
|
1032
982
|
this.roomTemperatureZone2SensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
1033
|
-
.setProps({
|
|
1034
|
-
minValue: -35,
|
|
1035
|
-
maxValue: 150,
|
|
1036
|
-
minStep: 0.5
|
|
1037
|
-
})
|
|
1038
983
|
.onGet(async () => {
|
|
1039
984
|
const state = zone.roomTemperature;
|
|
1040
985
|
return state;
|
|
@@ -1048,11 +993,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
1048
993
|
this.flowTemperatureZone2SensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1049
994
|
this.flowTemperatureZone2SensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} ${zoneName} Flow`);
|
|
1050
995
|
this.flowTemperatureZone2SensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
1051
|
-
.setProps({
|
|
1052
|
-
minValue: -35,
|
|
1053
|
-
maxValue: 150,
|
|
1054
|
-
minStep: 0.5
|
|
1055
|
-
})
|
|
1056
996
|
.onGet(async () => {
|
|
1057
997
|
const state = zone.flowTemperature;
|
|
1058
998
|
return state;
|
|
@@ -1066,11 +1006,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
1066
1006
|
this.returnTemperatureZone2SensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
1067
1007
|
this.returnTemperatureZone2SensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} ${zoneName} Return`);
|
|
1068
1008
|
this.returnTemperatureZone2SensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
1069
|
-
.setProps({
|
|
1070
|
-
minValue: -35,
|
|
1071
|
-
maxValue: 150,
|
|
1072
|
-
minStep: 0.5
|
|
1073
|
-
})
|
|
1074
1009
|
.onGet(async () => {
|
|
1075
1010
|
const state = zone.returnTemperature;
|
|
1076
1011
|
return state;
|
|
@@ -1082,6 +1017,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1082
1017
|
});
|
|
1083
1018
|
};
|
|
1084
1019
|
|
|
1020
|
+
//in standby sensor
|
|
1085
1021
|
if (this.inStandbySensor && this.accessory.inStandbyMode !== null) {
|
|
1086
1022
|
if (this.logDebug) this.emit('debug', `Prepare in standby mode service`);
|
|
1087
1023
|
this.inStandbyService = new Service.ContactSensor(`${serviceName} In Standby`, `inStandbyService${deviceId}`);
|
package/src/deviceerv.js
CHANGED
|
@@ -26,6 +26,9 @@ class DeviceErv extends EventEmitter {
|
|
|
26
26
|
|
|
27
27
|
//device config
|
|
28
28
|
this.device = device;
|
|
29
|
+
this.deviceId = device.id;
|
|
30
|
+
this.deviceName = device.name;
|
|
31
|
+
this.deviceTypeText = device.typeString;
|
|
29
32
|
this.displayType = device.displayType;
|
|
30
33
|
this.temperatureSensor = device.temperatureSensor || false;
|
|
31
34
|
this.temperatureOutdoorSensor = device.temperatureOutdoorSensor || false;
|
|
@@ -38,9 +41,6 @@ class DeviceErv extends EventEmitter {
|
|
|
38
41
|
this.schedules = this.accountType === 'melcloudhome' ? (device.schedules || []).filter(schedule => (schedule.displayType ?? 0) > 0 && schedule.id !== '0') : [];
|
|
39
42
|
this.scenes = this.accountType === 'melcloudhome' ? (device.scenes || []).filter(scene => (scene.displayType ?? 0) > 0 && scene.id !== '0') : [];
|
|
40
43
|
this.buttons = (device.buttonsSensors || []).filter(button => (button.displayType ?? 0) > 0);
|
|
41
|
-
this.deviceId = device.id;
|
|
42
|
-
this.deviceName = device.name;
|
|
43
|
-
this.deviceTypeText = device.typeString;
|
|
44
44
|
this.devicesFile = devicesFile;
|
|
45
45
|
this.defaultTempsFile = defaultTempsFile;
|
|
46
46
|
this.accountInfo = accountInfo;
|
|
@@ -98,10 +98,11 @@ class DeviceErv extends EventEmitter {
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
async externalIntegrations() {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
//RESTFul server
|
|
102
|
+
const restFulEnabled = this.restFul.enable || false;
|
|
103
|
+
if (restFulEnabled) {
|
|
104
|
+
try {
|
|
105
|
+
|
|
105
106
|
if (!this.restFulConnected) {
|
|
106
107
|
this.restFul1 = new RestFul({
|
|
107
108
|
port: this.restFul.port,
|
|
@@ -129,11 +130,15 @@ class DeviceErv extends EventEmitter {
|
|
|
129
130
|
this.emit('error', error);
|
|
130
131
|
});
|
|
131
132
|
}
|
|
132
|
-
}
|
|
133
|
+
} catch (error) {
|
|
134
|
+
this.emit('warn', `RESTFul integration start error: ${error}`);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
133
137
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
138
|
+
//MQTT client
|
|
139
|
+
const mqttEnabled = this.mqtt.enable || false;
|
|
140
|
+
if (mqttEnabled) {
|
|
141
|
+
try {
|
|
137
142
|
if (!this.mqttConnected) {
|
|
138
143
|
this.mqtt1 = new Mqtt({
|
|
139
144
|
host: this.mqtt.host,
|
|
@@ -169,10 +174,10 @@ class DeviceErv extends EventEmitter {
|
|
|
169
174
|
this.emit('error', error);
|
|
170
175
|
});
|
|
171
176
|
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
177
|
+
} catch (error) {
|
|
178
|
+
this.emit('warn', `MQTT integration start error: ${error}`);
|
|
179
|
+
};
|
|
180
|
+
}
|
|
176
181
|
}
|
|
177
182
|
|
|
178
183
|
async setOverExternalIntegration(integration, deviceData, key, value) {
|
|
@@ -568,11 +573,6 @@ class DeviceErv extends EventEmitter {
|
|
|
568
573
|
this.roomTemperatureSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
569
574
|
this.roomTemperatureSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Room`);
|
|
570
575
|
this.roomTemperatureSensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
571
|
-
.setProps({
|
|
572
|
-
minValue: -35,
|
|
573
|
-
maxValue: 150,
|
|
574
|
-
minStep: 0.5
|
|
575
|
-
})
|
|
576
576
|
.onGet(async () => {
|
|
577
577
|
const state = this.accessory.roomTemperature;
|
|
578
578
|
return state;
|
|
@@ -587,11 +587,6 @@ class DeviceErv extends EventEmitter {
|
|
|
587
587
|
this.supplyTemperatureSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
588
588
|
this.supplyTemperatureSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Supply`);
|
|
589
589
|
this.supplyTemperatureSensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
590
|
-
.setProps({
|
|
591
|
-
minValue: -35,
|
|
592
|
-
maxValue: 150,
|
|
593
|
-
minStep: 0.5
|
|
594
|
-
})
|
|
595
590
|
.onGet(async () => {
|
|
596
591
|
const state = this.accessory.supplyTemperature;
|
|
597
592
|
return state;
|
|
@@ -606,11 +601,6 @@ class DeviceErv extends EventEmitter {
|
|
|
606
601
|
this.outdoorTemperatureSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
|
|
607
602
|
this.outdoorTemperatureSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Outdoor`);
|
|
608
603
|
this.outdoorTemperatureSensorService.getCharacteristic(Characteristic.CurrentTemperature)
|
|
609
|
-
.setProps({
|
|
610
|
-
minValue: -35,
|
|
611
|
-
maxValue: 150,
|
|
612
|
-
minStep: 0.5
|
|
613
|
-
})
|
|
614
604
|
.onGet(async () => {
|
|
615
605
|
const state = this.accessory.outdoorTemperature;
|
|
616
606
|
return state;
|
|
@@ -686,6 +676,7 @@ class DeviceErv extends EventEmitter {
|
|
|
686
676
|
accessory.addService(this.airQualitySensorService);
|
|
687
677
|
}
|
|
688
678
|
|
|
679
|
+
//in standby sensor
|
|
689
680
|
if (this.inStandbySensor && this.accessory.inStandbyMode !== null) {
|
|
690
681
|
if (this.logDebug) this.emit('debug', `Prepare in standby mode service`);
|
|
691
682
|
this.inStandbyService = new Service.ContactSensor(`${serviceName} In Standby`, `inStandbyService${deviceId}`);
|
package/src/melcloudata.js
CHANGED
|
@@ -184,7 +184,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
184
184
|
if (displayType === 1 && deviceData.Device.OperationMode === 8) {
|
|
185
185
|
deviceData.Device.SetTemperature = (deviceData.Device.DefaultCoolingSetTemperature + deviceData.Device.DefaultHeatingSetTemperature) / 2;
|
|
186
186
|
|
|
187
|
-
if (this.
|
|
187
|
+
if (this.deviceData.Device.DefaultCoolingSetTemperature !== deviceData.Device.DefaultCoolingSetTemperature || this.deviceData.Device.DefaultHeatingSetTemperature !== deviceData.Device.DefaultHeatingSetTemperature) {
|
|
188
188
|
const temps = {
|
|
189
189
|
defaultCoolingSetTemperature: deviceData.Device.DefaultCoolingSetTemperature,
|
|
190
190
|
defaultHeatingSetTemperature: deviceData.Device.DefaultHeatingSetTemperature
|
package/src/melclouderv.js
CHANGED
|
@@ -195,7 +195,7 @@ class MelCloudErv extends EventEmitter {
|
|
|
195
195
|
if (displayType === 1 && deviceData.Device.VentilationMode === 2) {
|
|
196
196
|
deviceData.Device.SetTemperature = (deviceData.Device.DefaultCoolingSetTemperature + deviceData.Device.DefaultHeatingSetTemperature) / 2;
|
|
197
197
|
|
|
198
|
-
if (this.
|
|
198
|
+
if (this.deviceData.Device.DefaultCoolingSetTemperature !== deviceData.Device.DefaultCoolingSetTemperature || this.deviceData.Device.DefaultHeatingSetTemperature !== deviceData.Device.DefaultHeatingSetTemperature) {
|
|
199
199
|
const temps = {
|
|
200
200
|
defaultCoolingSetTemperature: deviceData.Device.DefaultCoolingSetTemperature,
|
|
201
201
|
defaultHeatingSetTemperature: deviceData.Device.DefaultHeatingSetTemperature
|