homebridge-melcloud-control 3.3.1 → 3.3.2

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,14 @@ 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.2] - (13.09.2024)
20
+
21
+ ## Changes
22
+
23
+ - corrct setProps for heating/cooling threshold
24
+ - update ERV code to support heating/cooling threshold in auto mode
25
+ - cleanup
26
+
19
27
  ## [3.3.1] - (13.09.2024)
20
28
 
21
29
  ## 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/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.2",
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;
@@ -909,7 +909,7 @@ class DeviceAta extends EventEmitter {
909
909
  if (modelSupportsAuto && modelSupportsHeat) {
910
910
  this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
911
911
  .setProps({
912
- minValue: 0,
912
+ minValue: 10,
913
913
  maxValue: 31,
914
914
  minStep: this.accessory.temperatureIncrement
915
915
  })
@@ -931,7 +931,7 @@ class DeviceAta extends EventEmitter {
931
931
  if (modelSupportsAuto && modelSupportsCool) {
932
932
  this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
933
933
  .setProps({
934
- minValue: 10,
934
+ minValue: 16,
935
935
  maxValue: 31,
936
936
  minStep: this.accessory.temperatureIncrement
937
937
  })
@@ -1061,7 +1061,7 @@ class DeviceAta extends EventEmitter {
1061
1061
  if (modelSupportsAuto && modelSupportsHeat) {
1062
1062
  this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
1063
1063
  .setProps({
1064
- minValue: 0,
1064
+ minValue: 10,
1065
1065
  maxValue: 31,
1066
1066
  minStep: this.accessory.temperatureIncrement
1067
1067
  })
@@ -1083,7 +1083,7 @@ class DeviceAta extends EventEmitter {
1083
1083
  if (modelSupportsAuto && modelSupportsCool) {
1084
1084
  this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
1085
1085
  .setProps({
1086
- minValue: 10,
1086
+ minValue: 16,
1087
1087
  maxValue: 31,
1088
1088
  minStep: this.accessory.temperatureIncrement
1089
1089
  })
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,6 +413,8 @@ 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
420
  default:
@@ -548,8 +554,8 @@ class DeviceErv extends EventEmitter {
548
554
  const info = hasCoolOperationMode || hasHeatOperationMode ? this.emit('message', `Target temperature: ${targetTemperature}${temperatureUnit}`) : false;
549
555
  const info1 = hasSupplyTemperature && this.accessory.supplyTemperature !== null ? this.emit('message', `Supply temperature: ${roomTemperature}${temperatureUnit}`) : false;
550
556
  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;
557
+ const info3 = hasAutoVentilationMode && hasHeatOperationMode ? this.emit('message', `Heating threshold temperature: ${defaultHeatingSetTemperature}${temperatureUnit}`) : false;
558
+ const info4 = hasAutoVentilationMode && hasCoolOperationMode ? this.emit('message', `Cooling threshold temperature: ${defaultCoolingSetTemperature}${temperatureUnit}`) : false;
553
559
  this.emit('message', `Fan speed mode: ${CONSTANTS.Ventilation.FanSpeed[setFanSpeed]}`);
554
560
  this.emit('message', `Temperature display unit: ${temperatureUnit}`);
555
561
  this.emit('message', `Core maintenance: ${CONSTANTS.Ventilation.CoreMaintenance[coreMaintenanceRequired]}`);
@@ -799,20 +805,20 @@ class DeviceErv extends EventEmitter {
799
805
  };
800
806
  });
801
807
  //device can heat
802
- if (hasHeatOperationMode) {
808
+ if (hasAutoVentilationMode && hasHeatOperationMode) {
803
809
  this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
804
810
  .setProps({
805
- minValue: 0,
811
+ minValue: 10,
806
812
  maxValue: 31,
807
813
  minStep: this.accessory.temperatureIncrement
808
814
  })
809
815
  .onGet(async () => {
810
- const value = this.accessory.setTemperature;
816
+ const value = this.accessory.defaultHeatingSetTemperature;
811
817
  return value;
812
818
  })
813
819
  .onSet(async (value) => {
814
820
  try {
815
- deviceData.Device.SetTemperature = value;
821
+ deviceData.Device.DefaultHeatingSetTemperature = value;
816
822
  deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
817
823
  await this.melCloudErv.send(deviceData);
818
824
  const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
@@ -822,20 +828,20 @@ class DeviceErv extends EventEmitter {
822
828
  });
823
829
  };
824
830
  //device can cool
825
- if (hasCoolOperationMode) {
831
+ if (hasAutoVentilationMode && hasCoolOperationMode) {
826
832
  this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
827
833
  .setProps({
828
- minValue: 10,
834
+ minValue: 16,
829
835
  maxValue: 31,
830
836
  minStep: this.accessory.temperatureIncrement
831
837
  })
832
838
  .onGet(async () => {
833
- const value = this.accessory.setTemperature;
839
+ const value = this.accessory.defaultCoolingSetTemperature;
834
840
  return value;
835
841
  })
836
842
  .onSet(async (value) => {
837
843
  try {
838
- deviceData.Device.SetTemperature = value;
844
+ deviceData.Device.DefaultCoolingSetTemperature = value;
839
845
  deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
840
846
  await this.melCloudErv.send(deviceData);
841
847
  const info = this.disableLogInfo ? false : this.emit('message', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
@@ -951,6 +957,52 @@ class DeviceErv extends EventEmitter {
951
957
  this.emit('warn', `Set temperature error: ${error}`);
952
958
  };
953
959
  });
960
+ //device can heat
961
+ if (hasAutoVentilationMode && hasHeatOperationMode) {
962
+ this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
963
+ .setProps({
964
+ minValue: 10,
965
+ maxValue: 31,
966
+ minStep: this.accessory.temperatureIncrement
967
+ })
968
+ .onGet(async () => {
969
+ const value = this.accessory.defaultHeatingSetTemperature;
970
+ return value;
971
+ })
972
+ .onSet(async (value) => {
973
+ try {
974
+ deviceData.Device.DefaultHeatingSetTemperature = value;
975
+ deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
976
+ await this.melCloudErv.send(deviceData);
977
+ const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
978
+ } catch (error) {
979
+ this.emit('warn', `Set heating threshold temperature error: ${error}`);
980
+ };
981
+ });
982
+ };
983
+ //device can cool
984
+ if (hasAutoVentilationMode && hasCoolOperationMode) {
985
+ this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
986
+ .setProps({
987
+ minValue: 16,
988
+ maxValue: 31,
989
+ minStep: this.accessory.temperatureIncrement
990
+ })
991
+ .onGet(async () => {
992
+ const value = this.accessory.defaultCoolingSetTemperature;
993
+ return value;
994
+ })
995
+ .onSet(async (value) => {
996
+ try {
997
+ deviceData.Device.DefaultCoolingSetTemperature = value;
998
+ deviceData.Device.EffectiveFlags = CONSTANTS.Ventilation.EffectiveFlags.SetTemperature;
999
+ await this.melCloudErv.send(deviceData);
1000
+ const info = this.disableLogInfo ? false : this.emit('message', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
1001
+ } catch (error) {
1002
+ this.emit('warn', `Set cooling threshold temperature error: ${error}`);
1003
+ };
1004
+ });
1005
+ };
954
1006
  this.melCloudService.getCharacteristic(Characteristic.TemperatureDisplayUnits)
955
1007
  .onGet(async () => {
956
1008
  const value = this.accessory.useFahrenheit;