homebridge-melcloud-control 3.3.1 → 3.3.3

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 CHANGED
@@ -16,6 +16,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
16
  - do not configure it manually, always using Config UI X
17
17
  - required Homebridge v2.0.0 and above
18
18
 
19
+ ## [3.3.3] - (13.09.2024)
20
+
21
+ ## Changes
22
+
23
+ - fix[#159](https://github.com/grzegorz914/homebridge-melcloud-control/issues/159)
24
+ - fix [#158](https://github.com/grzegorz914/homebridge-melcloud-control/issues/158)
25
+ - cleanup
26
+
27
+ ## [3.3.2] - (13.09.2024)
28
+
29
+ ## Changes
30
+
31
+ - corrct setProps for heating/cooling threshold
32
+ - update ERV code to support heating/cooling threshold in auto mode
33
+ - cleanup
34
+
19
35
  ## [3.3.1] - (13.09.2024)
20
36
 
21
37
  ## Changes
package/README.md CHANGED
@@ -164,7 +164,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
164
164
 
165
165
  ### AUTO Mode
166
166
 
167
- * The AUTO mode tile in Home app display current state as HEATING/COOLING - orange/blue based on actual mode.
167
+ * The dead band between Heating and Cooling setpoint must be 2°C or greater.
168
168
  * If the room temperature `<` Heating Setpoint, the unit will be set to HEAT with a setpoint of 23°C.
169
169
  * In HEAT, if the room temperature `>` Heating Setpoint `+` 1°C, the unit will be set to FAN.
170
170
  * In FAN, if the room temperature `>` Cooling Setpoint, the unit will be set to COOL with a setpoint of 19°C.
package/index.js CHANGED
@@ -162,7 +162,7 @@ class MelCloudPlatform {
162
162
 
163
163
  const deviceName = device.name;
164
164
  const deviceTypeText = device.typeString;
165
- const heatPump = new DeviceAtw(api, account, melCloud, device, accountInfo, contextKey, accountName, deviceId, deviceName, deviceTypeText, devicesFile, deviceRefreshInterval, useFahrenheit)
165
+ const heatPump = new DeviceAtw(api, account, device, melCloud, accountInfo, contextKey, accountName, deviceId, deviceName, deviceTypeText, devicesFile, deviceRefreshInterval, useFahrenheit)
166
166
  heatPump.on('publishAccessory', (accessory) => {
167
167
 
168
168
  //publish device
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "3.3.1",
4
+ "version": "3.3.3",
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
@@ -287,7 +287,7 @@ class DeviceAta extends EventEmitter {
287
287
  switch (operationMode) {
288
288
  case 1: //HEAT
289
289
  this.accessory.currentOperationMode = roomTemperature > setTemperature ? 1 : 2; //INACTIVE, IDLE, HEATING, COOLING
290
- this.accessory.targetOperationMode = 1; //AUTO, HEAT, COOL
290
+ this.accessory.targetOperationMode = 1; //AUTO, HEAT, COOL
291
291
  break;
292
292
  case 2: //DRY
293
293
  this.accessory.currentOperationMode = roomTemperature < setTemperature ? 1 : 3;
@@ -446,9 +446,6 @@ class DeviceAta extends EventEmitter {
446
446
  const updateDefCool = modelSupportsAuto && modelSupportsCool ? this.melCloudService.updateCharacteristic(Characteristic.CoolingThresholdTemperature, defaultCoolingSetTemperature) : false;
447
447
  };
448
448
  break;
449
- default:
450
- this.emit('warn', `Unknown display mode: ${displayMode}`);
451
- return;
452
449
  };
453
450
 
454
451
  if (this.roomTemperatureSensorService) {
@@ -909,7 +906,7 @@ class DeviceAta extends EventEmitter {
909
906
  if (modelSupportsAuto && modelSupportsHeat) {
910
907
  this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
911
908
  .setProps({
912
- minValue: 0,
909
+ minValue: 10,
913
910
  maxValue: 31,
914
911
  minStep: this.accessory.temperatureIncrement
915
912
  })
@@ -931,7 +928,7 @@ class DeviceAta extends EventEmitter {
931
928
  if (modelSupportsAuto && modelSupportsCool) {
932
929
  this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
933
930
  .setProps({
934
- minValue: 10,
931
+ minValue: 16,
935
932
  maxValue: 31,
936
933
  minStep: this.accessory.temperatureIncrement
937
934
  })
@@ -1040,7 +1037,7 @@ class DeviceAta extends EventEmitter {
1040
1037
  });
1041
1038
  this.melCloudService.getCharacteristic(Characteristic.TargetTemperature)
1042
1039
  .setProps({
1043
- minValue: 0,
1040
+ minValue: 10,
1044
1041
  maxValue: 31,
1045
1042
  minStep: this.accessory.temperatureIncrement
1046
1043
  })
@@ -1061,7 +1058,7 @@ class DeviceAta extends EventEmitter {
1061
1058
  if (modelSupportsAuto && modelSupportsHeat) {
1062
1059
  this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
1063
1060
  .setProps({
1064
- minValue: 0,
1061
+ minValue: 10,
1065
1062
  maxValue: 31,
1066
1063
  minStep: this.accessory.temperatureIncrement
1067
1064
  })
@@ -1083,7 +1080,7 @@ class DeviceAta extends EventEmitter {
1083
1080
  if (modelSupportsAuto && modelSupportsCool) {
1084
1081
  this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
1085
1082
  .setProps({
1086
- minValue: 10,
1083
+ minValue: 16,
1087
1084
  maxValue: 31,
1088
1085
  minStep: this.accessory.temperatureIncrement
1089
1086
  })
package/src/deviceatw.js CHANGED
@@ -381,7 +381,7 @@ class DeviceAtw extends EventEmitter {
381
381
  };
382
382
 
383
383
  //update characteristics
384
- if (this.melCloudServices && currentOperationMode !== undefined && targetOperationMode !== undefined) {
384
+ if (this.melCloudServices) {
385
385
  this.melCloudServices[i]
386
386
  .updateCharacteristic(Characteristic.Active, power ? 1 : 0)
387
387
  .updateCharacteristic(Characteristic.CurrentHeaterCoolerState, currentOperationMode)
@@ -453,7 +453,7 @@ class DeviceAtw extends EventEmitter {
453
453
  };
454
454
 
455
455
  //update characteristics
456
- if (this.melCloudServices && currentOperationMode !== undefined && targetOperationMode !== undefined) {
456
+ if (this.melCloudServices) {
457
457
  this.melCloudServices[i]
458
458
  .updateCharacteristic(Characteristic.CurrentHeatingCoolingState, currentOperationMode)
459
459
  .updateCharacteristic(Characteristic.TargetHeatingCoolingState, targetOperationMode)
@@ -462,9 +462,6 @@ class DeviceAtw extends EventEmitter {
462
462
  .updateCharacteristic(Characteristic.TemperatureDisplayUnits, this.accessory.useFahrenheit);
463
463
  }
464
464
  break;
465
- default:
466
- this.emit('warn', `Unknown display mode: ${displayMode}`);
467
- return;
468
465
  };
469
466
 
470
467
  //push value to arrays
package/src/deviceerv.js CHANGED
@@ -241,6 +241,8 @@ class DeviceErv extends EventEmitter {
241
241
  const outdoorTemperature = deviceData.Device.OutdoorTemperature;
242
242
  const nightPurgeMode = deviceData.Device.NightPurgeMode;
243
243
  const setTemperature = deviceData.Device.SetTemperature;
244
+ const defaultHeatingSetTemperature = deviceData.Device.DefaultHeatingSetTemperature;
245
+ const defaultCoolingSetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
244
246
  const setFanSpeed = deviceData.Device.SetFanSpeed;
245
247
  const operationMode = deviceData.Device.OperationMode;
246
248
  const ventilationMode = deviceData.Device.VentilationMode;
@@ -260,6 +262,8 @@ class DeviceErv extends EventEmitter {
260
262
  this.accessory.outdoorTemperature = outdoorTemperature;
261
263
  this.accessory.supplyTemperature = supplyTemperature;
262
264
  this.accessory.setTemperature = targetTemperature;
265
+ this.accessory.defaultHeatingSetTemperature = defaultHeatingSetTemperature;
266
+ this.accessory.defaultCoolingSetTemperature = defaultCoolingSetTemperature;
263
267
  this.accessory.setFanSpeed = setFanSpeed;
264
268
  this.accessory.lockPhysicalControl = 0;
265
269
  this.accessory.temperatureIncrement = temperatureIncrement;
@@ -294,26 +298,26 @@ class DeviceErv extends EventEmitter {
294
298
  case true:
295
299
  switch (ventilationMode) {
296
300
  case 0: //LOSSNAY
297
- this.accessory.currentOperationMode = 2; //HEATING
298
- this.accessory.targetOperationMode = 1; //HEAT
301
+ this.accessory.currentOperationMode = 2; //INACTIVE, IDLE, HEATING, COOLIN
302
+ this.accessory.targetOperationMode = 1; //AUTO, HEAT, COOL
299
303
  break;
300
304
  case 1: //BYPASS
301
- this.accessory.currentOperationMode = 3; //COOLING
302
- this.accessory.targetOperationMode = 2; //COOL
305
+ this.accessory.currentOperationMode = 3;
306
+ this.accessory.targetOperationMode = 2;
303
307
  break;
304
308
  case 2: //AUTO
305
309
  switch (actualVentilationMode) {
306
310
  case 0: //LOSSNAY
307
- this.accessory.currentOperationMode = 2; //HEATING
311
+ this.accessory.currentOperationMode = 2;
308
312
  break;
309
313
  case 1: //BYPASS
310
- this.accessory.currentOperationMode = 3; //COOLING
314
+ this.accessory.currentOperationMode = 3;
311
315
  break;
312
316
  default:
313
317
  this.emit('warn', `Unknown actual ventilation mode: ${actualVentilationMode}`);
314
318
  break;
315
319
  };
316
- this.accessory.targetOperationMode = 0; //AUTO
320
+ this.accessory.targetOperationMode = 0;
317
321
  break;
318
322
  default:
319
323
  this.emit('warn', `Unknown ventilation mode: ${ventilationMode}`);
@@ -321,7 +325,7 @@ class DeviceErv extends EventEmitter {
321
325
  };
322
326
  break;
323
327
  case false:
324
- this.accessory.currentOperationMode = 0; //OFF
328
+ this.accessory.currentOperationMode = 0;
325
329
  break;
326
330
  };
327
331
 
@@ -356,8 +360,8 @@ class DeviceErv extends EventEmitter {
356
360
  .updateCharacteristic(Characteristic.RotationSpeed, this.accessory.fanSpeed)
357
361
  .updateCharacteristic(Characteristic.LockPhysicalControls, this.accessory.lockPhysicalControl)
358
362
  .updateCharacteristic(Characteristic.TemperatureDisplayUnits, this.accessory.useFahrenheit);
359
- const updateHOM = hasHeatOperationMode ? this.melCloudService.updateCharacteristic(Characteristic.HeatingThresholdTemperature, targetTemperature) : false;
360
- const updateCOM = hasCoolOperationMode ? this.melCloudService.updateCharacteristic(Characteristic.CoolingThresholdTemperature, targetTemperature) : false;
363
+ const updateDefHeat = hasAutoVentilationMode && hasHeatOperationMode ? this.melCloudService.updateCharacteristic(Characteristic.HeatingThresholdTemperature, defaultHeatingSetTemperature) : false;
364
+ const updateDefCool = hasAutoVentilationMode && hasCoolOperationMode ? this.melCloudService.updateCharacteristic(Characteristic.CoolingThresholdTemperature, defaultCoolingSetTemperature) : false;
361
365
  };
362
366
  break;
363
367
  case 2: //Thermostat
@@ -366,26 +370,26 @@ class DeviceErv extends EventEmitter {
366
370
  case true:
367
371
  switch (ventilationMode) {
368
372
  case 0: //LOSSNAY
369
- this.accessory.currentOperationMode = 1; //HEATING
370
- this.accessory.targetOperationMode = 1; //HEAT
373
+ this.accessory.currentOperationMode = 1; //OFF, HEAT, COOL
374
+ this.accessory.targetOperationMode = 1; //OFF, HEAT, COOL, AUTO
371
375
  break;
372
376
  case 1: //BYPASS
373
- this.accessory.currentOperationMode = 2; //COOLING
374
- this.accessory.targetOperationMode = 2; //COOL
377
+ this.accessory.currentOperationMode = 2;
378
+ this.accessory.targetOperationMode = 2;
375
379
  break;
376
380
  case 2: //AUTO
377
381
  switch (actualVentilationMode) {
378
382
  case 0: //LOSSNAY
379
- this.accessory.currentOperationMode = 1; //HEATING
383
+ this.accessory.currentOperationMode = 1;
380
384
  break;
381
385
  case 1: //BYPASS
382
- this.accessory.currentOperationMode = 2; //COOLING
386
+ this.accessory.currentOperationMode = 2;
383
387
  break;
384
388
  default:
385
389
  this.emit('warn', `Unknown actual ventilation mode: ${actualVentilationMode}`);
386
390
  break;
387
391
  };
388
- this.accessory.targetOperationMode = 3; //AUTO
392
+ this.accessory.targetOperationMode = 3;
389
393
  break;
390
394
  default:
391
395
  this.emit('warn', `Unknown ventilation mode: ${ventilationMode}`);
@@ -393,8 +397,8 @@ class DeviceErv extends EventEmitter {
393
397
  };
394
398
  break;
395
399
  case false:
396
- this.accessory.currentOperationMode = 0; //OFF
397
- this.accessory.targetOperationMode = 0; //OFF
400
+ this.accessory.currentOperationMode = 0;
401
+ this.accessory.targetOperationMode = 0;
398
402
  break;
399
403
  };
400
404
  this.accessory.operationModeSetPropsMinValue = hasAutoVentilationMode ? 0 : 0;
@@ -409,11 +413,10 @@ class DeviceErv extends EventEmitter {
409
413
  .updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
410
414
  .updateCharacteristic(Characteristic.TargetTemperature, targetTemperature)
411
415
  .updateCharacteristic(Characteristic.TemperatureDisplayUnits, this.accessory.useFahrenheit);
416
+ const updateDefHeat = hasAutoVentilationMode && hasHeatOperationMode ? this.melCloudService.updateCharacteristic(Characteristic.HeatingThresholdTemperature, defaultHeatingSetTemperature) : false;
417
+ const updateDefCool = hasAutoVentilationMode && hasCoolOperationMode ? this.melCloudService.updateCharacteristic(Characteristic.CoolingThresholdTemperature, defaultCoolingSetTemperature) : false;
412
418
  };
413
419
  break;
414
- default:
415
- this.emit('warn', `Unknown display mode: ${displayMode}`);
416
- return;
417
420
  };
418
421
 
419
422
  //update temperature sensors
@@ -548,8 +551,8 @@ class DeviceErv extends EventEmitter {
548
551
  const info = hasCoolOperationMode || hasHeatOperationMode ? this.emit('message', `Target temperature: ${targetTemperature}${temperatureUnit}`) : false;
549
552
  const info1 = hasSupplyTemperature && this.accessory.supplyTemperature !== null ? this.emit('message', `Supply temperature: ${roomTemperature}${temperatureUnit}`) : false;
550
553
  const info2 = hasOutdoorTemperature && this.accessory.outdoorTemperature !== null ? this.emit('message', `Outdoor temperature: ${roomTemperature}${temperatureUnit}`) : false;
551
- const info3 = hasHeatOperationMode ? this.emit('message', `Heating threshold temperature: ${targetTemperature}${temperatureUnit}`) : false;
552
- const info4 = hasCoolOperationMode ? this.emit('message', `Cooling threshold temperature: ${targetTemperature}${temperatureUnit}`) : false;
554
+ const info3 = hasAutoVentilationMode && hasHeatOperationMode ? this.emit('message', `Heating threshold temperature: ${defaultHeatingSetTemperature}${temperatureUnit}`) : false;
555
+ const info4 = hasAutoVentilationMode && hasCoolOperationMode ? this.emit('message', `Cooling threshold temperature: ${defaultCoolingSetTemperature}${temperatureUnit}`) : false;
553
556
  this.emit('message', `Fan speed mode: ${CONSTANTS.Ventilation.FanSpeed[setFanSpeed]}`);
554
557
  this.emit('message', `Temperature display unit: ${temperatureUnit}`);
555
558
  this.emit('message', `Core maintenance: ${CONSTANTS.Ventilation.CoreMaintenance[coreMaintenanceRequired]}`);
@@ -799,20 +802,20 @@ class DeviceErv extends EventEmitter {
799
802
  };
800
803
  });
801
804
  //device can heat
802
- if (hasHeatOperationMode) {
805
+ if (hasAutoVentilationMode && hasHeatOperationMode) {
803
806
  this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
804
807
  .setProps({
805
- minValue: 0,
808
+ minValue: 10,
806
809
  maxValue: 31,
807
810
  minStep: this.accessory.temperatureIncrement
808
811
  })
809
812
  .onGet(async () => {
810
- const value = this.accessory.setTemperature;
813
+ const value = this.accessory.defaultHeatingSetTemperature;
811
814
  return value;
812
815
  })
813
816
  .onSet(async (value) => {
814
817
  try {
815
- deviceData.Device.SetTemperature = value;
818
+ deviceData.Device.DefaultHeatingSetTemperature = value;
816
819
  deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
817
820
  await this.melCloudErv.send(deviceData);
818
821
  const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
@@ -822,20 +825,20 @@ class DeviceErv extends EventEmitter {
822
825
  });
823
826
  };
824
827
  //device can cool
825
- if (hasCoolOperationMode) {
828
+ if (hasAutoVentilationMode && hasCoolOperationMode) {
826
829
  this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
827
830
  .setProps({
828
- minValue: 10,
831
+ minValue: 16,
829
832
  maxValue: 31,
830
833
  minStep: this.accessory.temperatureIncrement
831
834
  })
832
835
  .onGet(async () => {
833
- const value = this.accessory.setTemperature;
836
+ const value = this.accessory.defaultCoolingSetTemperature;
834
837
  return value;
835
838
  })
836
839
  .onSet(async (value) => {
837
840
  try {
838
- deviceData.Device.SetTemperature = value;
841
+ deviceData.Device.DefaultCoolingSetTemperature = value;
839
842
  deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
840
843
  await this.melCloudErv.send(deviceData);
841
844
  const info = this.disableLogInfo ? false : this.emit('message', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
@@ -933,7 +936,7 @@ class DeviceErv extends EventEmitter {
933
936
  });
934
937
  this.melCloudService.getCharacteristic(Characteristic.TargetTemperature)
935
938
  .setProps({
936
- minValue: 0,
939
+ minValue: 10,
937
940
  maxValue: 31,
938
941
  minStep: this.accessory.temperatureIncrement
939
942
  })
@@ -951,6 +954,52 @@ class DeviceErv extends EventEmitter {
951
954
  this.emit('warn', `Set temperature error: ${error}`);
952
955
  };
953
956
  });
957
+ //device can heat
958
+ if (hasAutoVentilationMode && hasHeatOperationMode) {
959
+ this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
960
+ .setProps({
961
+ minValue: 10,
962
+ maxValue: 31,
963
+ minStep: this.accessory.temperatureIncrement
964
+ })
965
+ .onGet(async () => {
966
+ const value = this.accessory.defaultHeatingSetTemperature;
967
+ return value;
968
+ })
969
+ .onSet(async (value) => {
970
+ try {
971
+ deviceData.Device.DefaultHeatingSetTemperature = value;
972
+ deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
973
+ await this.melCloudErv.send(deviceData);
974
+ const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
975
+ } catch (error) {
976
+ this.emit('warn', `Set heating threshold temperature error: ${error}`);
977
+ };
978
+ });
979
+ };
980
+ //device can cool
981
+ if (hasAutoVentilationMode && hasCoolOperationMode) {
982
+ this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
983
+ .setProps({
984
+ minValue: 16,
985
+ maxValue: 31,
986
+ minStep: this.accessory.temperatureIncrement
987
+ })
988
+ .onGet(async () => {
989
+ const value = this.accessory.defaultCoolingSetTemperature;
990
+ return value;
991
+ })
992
+ .onSet(async (value) => {
993
+ try {
994
+ deviceData.Device.DefaultCoolingSetTemperature = value;
995
+ deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
996
+ await this.melCloudErv.send(deviceData);
997
+ const info = this.disableLogInfo ? false : this.emit('message', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
998
+ } catch (error) {
999
+ this.emit('warn', `Set cooling threshold temperature error: ${error}`);
1000
+ };
1001
+ });
1002
+ };
954
1003
  this.melCloudService.getCharacteristic(Characteristic.TemperatureDisplayUnits)
955
1004
  .onGet(async () => {
956
1005
  const value = this.accessory.useFahrenheit;