homebridge-melcloud-control 4.3.16-beta.0 → 4.3.16-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 CHANGED
@@ -22,6 +22,24 @@ 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.4.0] - (10.12.2025)
26
+
27
+ ## Changes
28
+
29
+ - added possibility to set frost protection min/max temperaure (ATA, ATW)
30
+ - added possibility to set overheat protection min/max temperture (ATA)
31
+ - bump dependencies
32
+ - cleanup
33
+
34
+ # [4.3.16] - (09.12.2025)
35
+
36
+ ## Changes
37
+
38
+ - stability and performance improvements
39
+ - moved MQTT to v5
40
+ - bump dependencies
41
+ - cleanup
42
+
25
43
  # [4.3.11] - (07.12.2025)
26
44
 
27
45
  ## 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.3.16-beta.0",
4
+ "version": "4.3.16-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",
@@ -36,10 +36,10 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@homebridge/plugin-ui-utils": "^2.1.2",
39
- "async-mqtt": "^2.6.3",
39
+ "mqtt": "^5.14.1",
40
40
  "axios": "^1.13.2",
41
41
  "express": "^5.2.1",
42
- "puppeteer": "^24.32.0",
42
+ "puppeteer": "^24.32.1",
43
43
  "ws": "^8.18.3"
44
44
  },
45
45
  "keywords": [
package/src/deviceata.js CHANGED
@@ -113,34 +113,31 @@ class DeviceAta extends EventEmitter {
113
113
  const restFulEnabled = this.restFul.enable || false;
114
114
  if (restFulEnabled) {
115
115
  try {
116
-
117
- if (!this.restFulConnected) {
118
- this.restFul1 = new RestFul({
119
- port: this.restFul.port,
120
- logWarn: this.logWarn,
121
- logDebug: this.logDebug
116
+ this.restFul1 = new RestFul({
117
+ port: this.restFul.port,
118
+ logWarn: this.logWarn,
119
+ logDebug: this.logDebug
120
+ })
121
+ .on('connected', (message) => {
122
+ this.restFulConnected = true;
123
+ this.emit('success', message);
122
124
  })
123
- .on('connected', (message) => {
124
- this.restFulConnected = true;
125
- this.emit('success', message);
126
- })
127
- .on('set', async (key, value) => {
128
- try {
129
- await this.setOverExternalIntegration('RESTFul', this.deviceData, key, value);
130
- } catch (error) {
131
- this.emit('warn', error);
132
- };
133
- })
134
- .on('debug', (debug) => {
135
- this.emit('debug', debug);
136
- })
137
- .on('warn', (warn) => {
138
- this.emit('warn', warn);
139
- })
140
- .on('error', (error) => {
141
- this.emit('error', error);
142
- });
143
- }
125
+ .on('set', async (key, value) => {
126
+ try {
127
+ await this.setOverExternalIntegration('RESTFul', this.deviceData, key, value);
128
+ } catch (error) {
129
+ this.emit('warn', error);
130
+ };
131
+ })
132
+ .on('debug', (debug) => {
133
+ this.emit('debug', debug);
134
+ })
135
+ .on('warn', (warn) => {
136
+ this.emit('warn', warn);
137
+ })
138
+ .on('error', (error) => {
139
+ this.emit('error', error);
140
+ });
144
141
  } catch (error) {
145
142
  if (this.logWarn) this.emit('warn', `RESTFul integration start error: ${error}`);
146
143
  };
@@ -150,41 +147,39 @@ class DeviceAta extends EventEmitter {
150
147
  const mqttEnabled = this.mqtt.enable || false;
151
148
  if (mqttEnabled) {
152
149
  try {
153
- if (!this.mqttConnected) {
154
- this.mqtt1 = new Mqtt({
155
- host: this.mqtt.host,
156
- port: this.mqtt.port || 1883,
157
- clientId: this.mqtt.clientId ? `melcloud_${this.mqtt.clientId}_${Math.random().toString(16).slice(3)}` : `melcloud_${Math.random().toString(16).slice(3)}`,
158
- prefix: this.mqtt.prefix ? `melcloud/${this.mqtt.prefix}/${this.deviceTypeString}/${this.deviceName}` : `melcloud/${this.deviceTypeString}/${this.deviceName}`,
159
- user: this.mqtt.auth?.user,
160
- passwd: this.mqtt.auth?.passwd,
161
- logWarn: this.logWarn,
162
- logDebug: this.logDebug
150
+ this.mqtt1 = new Mqtt({
151
+ host: this.mqtt.host,
152
+ port: this.mqtt.port || 1883,
153
+ clientId: this.mqtt.clientId ? `melcloud_${this.mqtt.clientId}_${Math.random().toString(16).slice(3)}` : `melcloud_${Math.random().toString(16).slice(3)}`,
154
+ prefix: this.mqtt.prefix ? `melcloud/${this.mqtt.prefix}/${this.deviceTypeString}/${this.deviceName}` : `melcloud/${this.deviceTypeString}/${this.deviceName}`,
155
+ user: this.mqtt.auth?.user,
156
+ passwd: this.mqtt.auth?.passwd,
157
+ logWarn: this.logWarn,
158
+ logDebug: this.logDebug
159
+ })
160
+ .on('connected', (message) => {
161
+ this.mqttConnected = true;
162
+ this.emit('success', message);
163
163
  })
164
- .on('connected', (message) => {
165
- this.mqttConnected = true;
166
- this.emit('success', message);
167
- })
168
- .on('subscribed', (message) => {
169
- this.emit('success', message);
170
- })
171
- .on('set', async (key, value) => {
172
- try {
173
- await this.setOverExternalIntegration('MQTT', this.deviceData, key, value);
174
- } catch (error) {
175
- this.emit('warn', error);
176
- };
177
- })
178
- .on('debug', (debug) => {
179
- this.emit('debug', debug);
180
- })
181
- .on('warn', (warn) => {
182
- this.emit('warn', warn);
183
- })
184
- .on('error', (error) => {
185
- this.emit('error', error);
186
- });
187
- }
164
+ .on('subscribed', (message) => {
165
+ this.emit('success', message);
166
+ })
167
+ .on('set', async (key, value) => {
168
+ try {
169
+ await this.setOverExternalIntegration('MQTT', this.deviceData, key, value);
170
+ } catch (error) {
171
+ this.emit('warn', error);
172
+ };
173
+ })
174
+ .on('debug', (debug) => {
175
+ this.emit('debug', debug);
176
+ })
177
+ .on('warn', (warn) => {
178
+ this.emit('warn', warn);
179
+ })
180
+ .on('error', (error) => {
181
+ this.emit('error', error);
182
+ });
188
183
  } catch (error) {
189
184
  if (this.logWarn) this.emit('warn', `MQTT integration start error: ${error}`);
190
185
  };
@@ -702,27 +697,95 @@ class DeviceAta extends EventEmitter {
702
697
  }
703
698
 
704
699
  //frost protection
705
- if (this.frostProtectionSupport && this.accessory.frostProtectionEnabled !== null) {
700
+ if (this.frostProtectionSupport && this.accessory.frostProtection.Enabled !== null) {
706
701
  //control
707
702
  if (this.logDebug) this.emit('debug', `Prepare frost protection control service`);
708
- this.frostProtectionControlService = new Service.Switch(`${serviceName} Frost Protection`, `frostProtectionControlService${deviceId}`);
709
- this.frostProtectionControlService.addOptionalCharacteristic(Characteristic.ConfiguredName);
710
- this.frostProtectionControlService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Frost Protection`);
711
- this.frostProtectionControlService.getCharacteristic(Characteristic.On)
703
+ const frostProtectionControlService = new Service.HeaterCooler(`${serviceName} Frost Protection`, `frostProtectionControlService${deviceId}`);
704
+ frostProtectionControlService.addOptionalCharacteristic(Characteristic.ConfiguredName);
705
+ frostProtectionControlService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Frost Protection`);
706
+ frostProtectionControlService.getCharacteristic(Characteristic.Active)
712
707
  .onGet(async () => {
713
- const state = this.accessory.frostProtectionEnabled;
708
+ const state = this.accessory.frostProtection.Enabled;
714
709
  return state;
715
710
  })
716
711
  .onSet(async (state) => {
717
712
  try {
718
- deviceData.FrostProtection.Enabled = state;
713
+ deviceData.FrostProtection.Enabled = state ? true : false;
719
714
  if (this.logInfo) this.emit('info', `Frost protection: ${state ? 'Enabled' : 'Disabled'}`);
720
715
  await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'frostprotection');
721
716
  } catch (error) {
722
717
  if (this.logWarn) this.emit('warn', `Set frost protection error: ${error}`);
723
718
  };
724
719
  });
725
- accessory.addService(this.frostProtectionControlService);
720
+ frostProtectionControlService.getCharacteristic(Characteristic.CurrentHeaterCoolerState)
721
+ .onGet(async () => {
722
+ const value = this.accessory.frostProtection.Active ? 2 : 1;
723
+ return value;
724
+ })
725
+ frostProtectionControlService.getCharacteristic(Characteristic.TargetHeaterCoolerState)
726
+ .setProps({
727
+ minValue: 0,
728
+ maxValue: 0,
729
+ validValues: [0]
730
+ })
731
+ .onGet(async () => {
732
+ const value = 0
733
+ return value;
734
+ })
735
+ .onSet(async (value) => {
736
+ try {
737
+ deviceData.FrostProtection.Enabled = true;
738
+ if (this.logInfo) this.emit('info', `Frost protection: Enabled`);
739
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'frostprotection');
740
+ } catch (error) {
741
+ if (this.logWarn) this.emit('warn', `Set frost protection error: ${error}`);
742
+ };
743
+ });
744
+ frostProtectionControlService.getCharacteristic(Characteristic.CurrentTemperature)
745
+ .onGet(async () => {
746
+ const value = this.accessory.roomTemperature;
747
+ return value;
748
+ });
749
+ frostProtectionControlService.getCharacteristic(Characteristic.CoolingThresholdTemperature) //max
750
+ .setProps({
751
+ minValue: 6,
752
+ maxValue: 16,
753
+ minStep: 1
754
+ })
755
+ .onGet(async () => {
756
+ const value = this.accessory.frostProtection.Max;
757
+ return value;
758
+ })
759
+ .onSet(async (value) => {
760
+ try {
761
+ deviceData.FrostProtection.Max = value;
762
+ if (this.logInfo) this.emit('info', `Set frost protection max. temperature: ${value}${this.accessory.temperatureUnit}`);
763
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'frostprotection');
764
+ } catch (error) {
765
+ if (this.logWarn) this.emit('warn', `Set frost protection max. temperature error: ${error}`);
766
+ };
767
+ });
768
+ frostProtectionControlService.getCharacteristic(Characteristic.HeatingThresholdTemperature) //min
769
+ .setProps({
770
+ minValue: 4,
771
+ maxValue: 14,
772
+ minStep: 1
773
+ })
774
+ .onGet(async () => {
775
+ const value = this.accessory.frostProtection.Min;
776
+ return value;
777
+ })
778
+ .onSet(async (value) => {
779
+ try {
780
+ deviceData.FrostProtection.Min = value;
781
+ if (this.logInfo) this.emit('info', `Set frost protection min. temperature: ${value}${this.accessory.temperatureUnit}`);
782
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'frostprotection');
783
+ } catch (error) {
784
+ if (this.logWarn) this.emit('warn', `Set frost protection min. temperature error: ${error}`);
785
+ };
786
+ });
787
+ this.frostProtectionControlService = frostProtectionControlService;
788
+ accessory.addService(frostProtectionControlService);
726
789
 
727
790
  if (this.logDebug) this.emit('debug', `Prepare frost protection control sensor service`);
728
791
  this.frostProtectionControlSensorService = new Service.ContactSensor(`${serviceName} Frost Protection Control`, `frostProtectionControlSensorService${deviceId}`);
@@ -730,7 +793,7 @@ class DeviceAta extends EventEmitter {
730
793
  this.frostProtectionControlSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Frost Protection Control`);
731
794
  this.frostProtectionControlSensorService.getCharacteristic(Characteristic.ContactSensorState)
732
795
  .onGet(async () => {
733
- const state = this.accessory.frostProtectionEnabled;
796
+ const state = this.accessory.frostProtection.Enabled;
734
797
  return state;
735
798
  })
736
799
  accessory.addService(this.frostProtectionControlSensorService);
@@ -742,34 +805,102 @@ class DeviceAta extends EventEmitter {
742
805
  this.frostProtectionSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Frost Protection`);
743
806
  this.frostProtectionSensorService.getCharacteristic(Characteristic.ContactSensorState)
744
807
  .onGet(async () => {
745
- const state = this.accessory.frostProtectionActive;
808
+ const state = this.accessory.frostProtection.Active;
746
809
  return state;
747
810
  })
748
811
  accessory.addService(this.frostProtectionSensorService);
749
812
  }
750
813
 
751
814
  //overheat protection
752
- if (this.overheatProtectionSupport && this.accessory.overheatProtectionEnabled !== null) {
815
+ if (this.overheatProtectionSupport && this.accessory.overheatProtection.Enabled !== null) {
753
816
  //control
754
817
  if (this.logDebug) this.emit('debug', `Prepare overheat protection control service`);
755
- this.overheatProtectionControlService = new Service.Switch(`${serviceName} Overheat Protection`, `overheatProtectionControlService${deviceId}`);
756
- this.overheatProtectionControlService.addOptionalCharacteristic(Characteristic.ConfiguredName);
757
- this.overheatProtectionControlService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Overheat Protection`);
758
- this.overheatProtectionControlService.getCharacteristic(Characteristic.On)
818
+ const overheatProtectionControlService = new Service.HeaterCooler(`${serviceName} Overheat Protection`, `overheatProtectionControlService${deviceId}`);
819
+ overheatProtectionControlService.addOptionalCharacteristic(Characteristic.ConfiguredName);
820
+ overheatProtectionControlService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Overheat Protection`);
821
+ overheatProtectionControlService.getCharacteristic(Characteristic.Active)
759
822
  .onGet(async () => {
760
- const state = this.accessory.overheatProtectionEnabled;
823
+ const state = this.accessory.overheatProtection.Enabled;
761
824
  return state;
762
825
  })
763
826
  .onSet(async (state) => {
764
827
  try {
765
- deviceData.OverheatProtection.Enabled = state;
828
+ deviceData.OverheatProtection.Enabled = state ? true : false;
766
829
  if (this.logInfo) this.emit('info', `Overheat protection: ${state ? 'Enabled' : 'Disabled'}`);
767
830
  await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'overheatprotection');
768
831
  } catch (error) {
769
832
  if (this.logWarn) this.emit('warn', `Set overheat protection error: ${error}`);
770
833
  };
771
834
  });
772
- accessory.addService(this.overheatProtectionControlService);
835
+ overheatProtectionControlService.getCharacteristic(Characteristic.CurrentHeaterCoolerState)
836
+ .onGet(async () => {
837
+ const value = this.accessory.overheatProtection.Active ? 2 : 1;
838
+ return value;
839
+ })
840
+ overheatProtectionControlService.getCharacteristic(Characteristic.TargetHeaterCoolerState)
841
+ .setProps({
842
+ minValue: 0,
843
+ maxValue: 0,
844
+ validValues: [0]
845
+ })
846
+ .onGet(async () => {
847
+ const value = 0
848
+ return value;
849
+ })
850
+ .onSet(async (value) => {
851
+ try {
852
+ deviceData.OverheatProtection.Enabled = true;
853
+ if (this.logInfo) this.emit('info', `Set overheat protection: Enabled`);
854
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'overheatprotection');
855
+ } catch (error) {
856
+ if (this.logWarn) this.emit('warn', `Set overheat protection error: ${error}`);
857
+ };
858
+ });
859
+ overheatProtectionControlService.getCharacteristic(Characteristic.CurrentTemperature)
860
+ .onGet(async () => {
861
+ const value = this.accessory.roomTemperature;
862
+ return value;
863
+ });
864
+ overheatProtectionControlService.getCharacteristic(Characteristic.CoolingThresholdTemperature) //max
865
+ .setProps({
866
+ minValue: 33,
867
+ maxValue: 40,
868
+ minStep: 1
869
+ })
870
+ .onGet(async () => {
871
+ const value = this.accessory.overheatProtection.Max;
872
+ return value;
873
+ })
874
+ .onSet(async (value) => {
875
+ try {
876
+ deviceData.OverheatProtection.Max = value;
877
+ if (this.logInfo) this.emit('info', `Set overheat protection max. temperature: ${value}${this.accessory.temperatureUnit}`);
878
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'overheatprotection');
879
+ } catch (error) {
880
+ if (this.logWarn) this.emit('warn', `Set overheat protection max. temperature error: ${error}`);
881
+ };
882
+ });
883
+ overheatProtectionControlService.getCharacteristic(Characteristic.HeatingThresholdTemperature) //min
884
+ .setProps({
885
+ minValue: 31,
886
+ maxValue: 38,
887
+ minStep: 1
888
+ })
889
+ .onGet(async () => {
890
+ const value = this.accessory.overheatProtection.Min;
891
+ return value;
892
+ })
893
+ .onSet(async (value) => {
894
+ try {
895
+ deviceData.OverheatProtection.Min = value;
896
+ if (this.logInfo) this.emit('info', `Set overheat protection min. temperature: ${value}${this.accessory.temperatureUnit}`);
897
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'overheatprotection');
898
+ } catch (error) {
899
+ if (this.logWarn) this.emit('warn', `Set overheat protection min. temperature error: ${error}`);
900
+ };
901
+ });
902
+ this.overheatProtectionControlService = overheatProtectionControlService;
903
+ accessory.addService(overheatProtectionControlService);
773
904
 
774
905
  if (this.logDebug) this.emit('debug', `Prepare overheat protection control sensor service`);
775
906
  this.overheatProtectionControlSensorService = new Service.ContactSensor(`${serviceName} Overheat Protection Control`, `overheatProtectionControlSensorService${deviceId}`);
@@ -777,7 +908,7 @@ class DeviceAta extends EventEmitter {
777
908
  this.overheatProtectionControlSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Overheat Protection Control`);
778
909
  this.overheatProtectionControlSensorService.getCharacteristic(Characteristic.ContactSensorState)
779
910
  .onGet(async () => {
780
- const state = this.accessory.overheatProtectionEnabled;
911
+ const state = this.accessory.overheatProtection.Enabled;
781
912
  return state;
782
913
  })
783
914
  accessory.addService(this.overheatProtectionControlSensorService);
@@ -788,7 +919,7 @@ class DeviceAta extends EventEmitter {
788
919
  this.overheatProtectionSensorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Overheat Protection`);
789
920
  this.overheatProtectionSensorService.getCharacteristic(Characteristic.ContactSensorState)
790
921
  .onGet(async () => {
791
- const state = this.accessory.overheatProtectionActive;
922
+ const state = this.accessory.overheatProtection.Active;
792
923
  return state;
793
924
  })
794
925
  accessory.addService(this.overheatProtectionSensorService);
@@ -1374,10 +1505,8 @@ class DeviceAta extends EventEmitter {
1374
1505
  const holidayModeActive = deviceData.HolidayMode?.Active ?? false;
1375
1506
 
1376
1507
  //protection
1377
- const frostProtectionEnabled = deviceData.FrostProtection?.Enabled;
1378
- const frostProtectionActive = deviceData.FrostProtection?.Active ?? false;
1379
- const overheatProtectionEnabled = deviceData.OverheatProtection?.Enabled;
1380
- const overheatProtectionActive = deviceData.OverheatProtection?.Active ?? false;
1508
+ const frostProtection = deviceData.FrostProtection ?? {};
1509
+ const overheatProtection = deviceData.OverheatProtection ?? {};
1381
1510
 
1382
1511
  //device control
1383
1512
  const hideVaneControls = deviceData.HideVaneControls ?? false;
@@ -1470,10 +1599,8 @@ class DeviceAta extends EventEmitter {
1470
1599
  temperatureUnit: TemperatureDisplayUnits[this.accountInfo.useFahrenheit ? 1 : 0],
1471
1600
  isConnected: isConnected,
1472
1601
  isInError: isInError,
1473
- frostProtectionEnabled: frostProtectionEnabled,
1474
- frostProtectionActive: frostProtectionActive,
1475
- overheatProtectionEnabled: overheatProtectionEnabled,
1476
- overheatProtectionActive: overheatProtectionActive,
1602
+ frostProtection: frostProtection,
1603
+ overheatProtection: overheatProtection,
1477
1604
  holidayModeEnabled: holidayModeEnabled,
1478
1605
  holidayModeActive: holidayModeActive,
1479
1606
  scheduleEnabled: scheduleEnabled
@@ -1572,42 +1699,34 @@ class DeviceAta extends EventEmitter {
1572
1699
  obj.currentOperationMode = roomTemperature > setTemperature ? 0 : 1;
1573
1700
  obj.targetOperationMode = 1;
1574
1701
  break;
1575
-
1576
1702
  case 2: // DRY
1577
1703
  obj.currentOperationMode = 0;
1578
1704
  obj.targetOperationMode = resolveTargetOperation1(2, obj);
1579
1705
  break;
1580
-
1581
1706
  case 3: // COOL
1582
1707
  obj.currentOperationMode = roomTemperature < setTemperature ? 0 : 2;
1583
1708
  obj.targetOperationMode = 2;
1584
1709
  break;
1585
-
1586
1710
  case 7: // FAN
1587
1711
  obj.currentOperationMode = 0;
1588
1712
  obj.targetOperationMode = resolveTargetOperation1(3, obj);
1589
1713
  break;
1590
-
1591
1714
  case 8: // AUTO
1592
1715
  obj.currentOperationMode = roomTemperature < setTemperature ? 1 : roomTemperature > setTemperature ? 2 : 0;
1593
1716
  obj.targetOperationMode = 3;
1594
1717
  break;
1595
-
1596
1718
  case 9: // ISEE HEAT
1597
1719
  obj.currentOperationMode = roomTemperature > setTemperature ? 0 : 1;
1598
1720
  obj.targetOperationMode = 1;
1599
1721
  break;
1600
-
1601
1722
  case 10: // ISEE DRY
1602
1723
  obj.currentOperationMode = 0;
1603
1724
  obj.targetOperationMode = resolveTargetOperation1(2, obj);
1604
1725
  break;
1605
-
1606
1726
  case 11: // ISEE COOL
1607
1727
  obj.currentOperationMode = roomTemperature < setTemperature ? 0 : 2;
1608
1728
  obj.targetOperationMode = 2;
1609
1729
  break;
1610
-
1611
1730
  default:
1612
1731
  if (this.logWarn) this.emit('warn', `Unknown operating mode: ${operationMode}`);
1613
1732
  break;
@@ -1645,17 +1764,27 @@ class DeviceAta extends EventEmitter {
1645
1764
  this.errorService?.updateCharacteristic(Characteristic.ContactSensorState, isInError);
1646
1765
 
1647
1766
  //frost protection
1648
- if (this.frostProtectionSupport && frostProtectionEnabled !== null) {
1649
- this.frostProtectionControlService?.updateCharacteristic(Characteristic.On, frostProtectionEnabled);
1650
- this.frostProtectionControlSensorService?.updateCharacteristic(Characteristic.ContactSensorState, frostProtectionEnabled);
1651
- this.frostProtectionSensorService?.updateCharacteristic(Characteristic.ContactSensorState, frostProtectionActive);
1767
+ if (this.frostProtectionSupport && frostProtection.Enabled !== null) {
1768
+ this.frostProtectionControlService?.updateCharacteristic(Characteristic.Active, frostProtection.Enabled);
1769
+ this.frostProtectionControlService?.updateCharacteristic(Characteristic.CurrentHeaterCoolerState, frostProtection.Active ? 2 : 1);
1770
+ this.frostProtectionControlService?.updateCharacteristic(Characteristic.TargetHeaterCoolerState, frostProtection.Active ? 2 : 1);
1771
+ this.frostProtectionControlService?.updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature);
1772
+ this.frostProtectionControlService?.updateCharacteristic(Characteristic.CoolingThresholdTemperature, frostProtection.Max);
1773
+ this.frostProtectionControlService?.updateCharacteristic(Characteristic.HeatingThresholdTemperature, frostProtection.Min);
1774
+ this.frostProtectionControlSensorService?.updateCharacteristic(Characteristic.ContactSensorState, frostProtection.Enabled);
1775
+ this.frostProtectionSensorService?.updateCharacteristic(Characteristic.ContactSensorState, frostProtection.Active);
1652
1776
  }
1653
1777
 
1654
1778
  //overheat protection
1655
- if (this.overheatProtectionSupport && overheatProtectionEnabled !== null) {
1656
- this.overheatProtectionControlService?.updateCharacteristic(Characteristic.On, overheatProtectionEnabled);
1657
- this.overheatProtectionControlSensorService?.updateCharacteristic(Characteristic.ContactSensorState, overheatProtectionEnabled);
1658
- this.overheatProtectionSensorService?.updateCharacteristic(Characteristic.ContactSensorState, overheatProtectionActive);
1779
+ if (this.overheatProtectionSupport && overheatProtection.Enabled !== null) {
1780
+ this.overheatProtectionControlService?.updateCharacteristic(Characteristic.Active, overheatProtection.Enabled);
1781
+ this.overheatProtectionControlService?.updateCharacteristic(Characteristic.CurrentHeaterCoolerState, overheatProtection.Active ? 2 : 1);
1782
+ this.overheatProtectionControlService?.updateCharacteristic(Characteristic.TargetHeaterCoolerState, overheatProtection.Active ? 2 : 1);
1783
+ this.overheatProtectionControlService?.updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature);
1784
+ this.overheatProtectionControlService?.updateCharacteristic(Characteristic.CoolingThresholdTemperature, overheatProtection.Max);
1785
+ this.overheatProtectionControlService?.updateCharacteristic(Characteristic.HeatingThresholdTemperature, overheatProtection.Min);
1786
+ this.overheatProtectionControlSensorService?.updateCharacteristic(Characteristic.ContactSensorState, overheatProtection.Enabled);
1787
+ this.overheatProtectionSensorService?.updateCharacteristic(Characteristic.ContactSensorState, overheatProtection.Active);
1659
1788
  }
1660
1789
 
1661
1790
  //holiday mode