homebridge-melcloud-control 3.1.0-beta.9 → 3.1.0

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
@@ -15,6 +15,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
15
  - v3 After update to v3 from previous versions the plugin need to be configured using Config UI X.
16
16
  - do not configure it manually, always using Config UI X
17
17
 
18
+ ## [3.1.0] - (31.08.2024)
19
+
20
+ ## Changes
21
+
22
+ - improvements in plugin config UI
23
+ - added possibility indyvidual presets control
24
+ - config schema update
25
+ - bump dependencies
26
+ - cleanup
27
+
18
28
  ## [3.0.7] - (30.08.2024)
19
29
 
20
30
  ## Changes
@@ -29,7 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
29
39
 
30
40
  - added homebridge UI server
31
41
  - whole new concept get all devices from melcloud usin config UI X
32
- - added indyvidual configuration of every device
42
+ - added individual configuration of every device
33
43
  - config schema updated
34
44
  - cleanup
35
45
 
package/README.md CHANGED
@@ -185,7 +185,10 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
185
185
  | `ataDevices.autoDryFanMode` | Here select the operatiing mode for `Auto`, if this mode is not supported, it will be disabled.. |
186
186
  | `ataDevices.temperatureSensor` | This enable extra `Room` temperature sensors to use with automations in HomeKit app. |
187
187
  | `ataDevices.temperatureSensorOutdoor` | This enable extra `Outdoor` temperature sensors to use with automations in HomeKit app. |
188
- | `ataDevices.presets` | This enable extra buttons for configured presets and display it in HomeKit app. |
188
+ | `ataDevices.presets` | Array of ATA device Presets created automatically after login to MELCloud from plugin config UI. |
189
+ | `ataDevices.presets.id` | Read only data, do not change it. |
190
+ | `ataDevices.presets.name` | Here You can schange the `Preset Name` which is exposed to the `Homebridge/HomeKit`. |
191
+ | `ataDevices.presets.displayType` | Here select display type in HomeKit, `0 - None/Disabled`, `1 - Outlet`, `2 - Switch`, `3 - Motion Sensor`, `4 - Occupancy Sensor`, `5 - Contact Sensor`. |
189
192
  | `buttonsSensors` | Array of buttons sensors. |
190
193
  | `buttonsSensors.name` | Here set `Button Name` which You want expose to the `Homebridge/HomeKit`. |
191
194
  | `buttonsSensors.mode` | Here select button mode, VH - Vane Horizontal, VV - Vane Horizontal. |
@@ -206,7 +209,10 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
206
209
  | `atwDevices.temperatureSensorReturnWaterTank` | This enable extra `Return Water Tank` temperature sensors to use with automations in HomeKit app. |
207
210
  | `atwDevices.temperatureSensorFlowZone2` | This enable extra `Flow Zone 2` temperature sensors to use with automations in HomeKit app. |
208
211
  | `atwDevices.temperatureSensorReturnZone2` | This enable extra `Return Zone 2` temperature sensors to use with automations in HomeKit app. |
209
- | `atwDevices.presets` | This enable extra buttons for configured presets and display it in HomeKit app. |
212
+ | `atwDevices.presets` | Array of ATA device Presets created automatically after login to MELCloud from plugin config UI. |
213
+ | `atwDevices.presets.id` | Read only data, do not change it. |
214
+ | `atwDevices.presets.name` | Here You can schange the `Preset Name` which is exposed to the `Homebridge/HomeKit`. |
215
+ | `atwDevices.presets.displayType` | Here select display type in HomeKit, `0 - None/Disabled`, `1 - Outlet`, `2 - Switch`, `3 - Motion Sensor`, `4 - Occupancy Sensor`, `5 - Contact Sensor`. |
210
216
  | `buttonsSensors` | Array of buttons sensors. |
211
217
  | `buttonsSensors.name` | Here set `Button Name` which You want expose to the `Homebridge/HomeKit`. |
212
218
  | `buttonsSensors.mode` | Here select button mode. |
@@ -221,7 +227,10 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
221
227
  | `ervDevices.temperatureSensor` | This enable extra `Room` temperature sensors to use with automations in HomeKit app. |
222
228
  | `ervDevices.temperatureSensorOutdoor` | This enable extra `Outdoor` temperature sensors to use with automations in HomeKit app. |
223
229
  | `ervDevices.temperatureSensorSupply` | This enable extra `Supply` temperature sensors to use with automations in HomeKit app. |
224
- | `ervDevices.presets` | This enable extra buttons for configured presets and display it in HomeKit app. |
230
+ | `ervDevices.presets` | Array of ATA device Presets created automatically after login to MELCloud from plugin config UI. |
231
+ | `ervDevices.presets.id` | Read only data, do not change it. |
232
+ | `ervDevices.presets.name` | Here You can schange the `Preset Name` which is exposed to the `Homebridge/HomeKit`. |
233
+ | `ervDevices.presets.displayType` | Here select display type in HomeKit, `0 - None/Disabled`, `1 - Outlet`, `2 - Switch`, `3 - Motion Sensor`, `4 - Occupancy Sensor`, `5 - Contact Sensor`. |
225
234
  | `buttonsSensors` | Array of buttons sensors. |
226
235
  | `buttonsSensors.name` | Here set `Button Name` which You want expose to the `Homebridge/HomeKit`. |
227
236
  | `buttonsSensors.mode` | Here select button mode. |
@@ -213,22 +213,25 @@
213
213
  "id": {
214
214
  "title": "ID",
215
215
  "type": "integer",
216
- "required": false
216
+ "required": true,
217
+ "readonly": true
217
218
  },
218
219
  "type": {
219
220
  "title": "Type",
220
221
  "type": "integer",
221
- "required": false
222
+ "required": true,
223
+ "readonly": true
222
224
  },
223
225
  "typeString": {
224
226
  "title": "Type",
225
227
  "type": "string",
226
- "required": false
228
+ "required": true,
229
+ "readonly": true
227
230
  },
228
231
  "name": {
229
232
  "title": "Name",
230
233
  "type": "string",
231
- "required": false
234
+ "required": true
232
235
  },
233
236
  "displayMode": {
234
237
  "title": "Control",
@@ -386,7 +389,7 @@
386
389
  "id": {
387
390
  "title": "ID",
388
391
  "type": "integer",
389
- "required": false
392
+ "required": true
390
393
  },
391
394
  "name": {
392
395
  "title": "Name",
@@ -450,9 +453,6 @@
450
453
  "required": false
451
454
  }
452
455
  }
453
- },
454
- "condition": {
455
- "functionBody": "const presets = model.accounts[arrayIndices]?.devicesAta[arrayIndices]?.presets || []; const hasValidPresets = presets.length > 0 && presets.every(preset => preset.name != null && preset.name !== ''); return hasValidPresets;"
456
456
  }
457
457
  },
458
458
  "buttonsSensors": {
@@ -743,15 +743,12 @@
743
743
  "required": false
744
744
  }
745
745
  }
746
- },
747
- "condition": {
748
- "functionBody": "const buttons = model.accounts[arrayIndices]?.devicesAta[arrayIndices]?.buttons || []; const hasValidButtons = buttons.length > 0 && buttons.every(button => button.name != null && button.name !== ''); return hasValidButtons;"
749
746
  }
750
747
  }
751
748
  }
752
749
  },
753
750
  "condition": {
754
- "functionBody": "const devices = model.accounts[arrayIndices]?.ataDevices || []; return devices.length > 0 && devices.every(device => device.id != null && device.id !== '');"
751
+ "functionBody": "const devices = model.accounts[arrayIndices]?.ataDevices || []; return devices.length > 0 && devices.every(device => device.id != null);"
755
752
  }
756
753
  },
757
754
  "atwDevices": {
@@ -763,22 +760,25 @@
763
760
  "id": {
764
761
  "title": "Mode",
765
762
  "type": "integer",
766
- "required": false
763
+ "required": true,
764
+ "readonly": true
767
765
  },
768
766
  "type": {
769
767
  "title": "Type",
770
768
  "type": "integer",
771
- "required": false
769
+ "required": true,
770
+ "readonly": true
772
771
  },
773
772
  "typeString": {
774
773
  "title": "Type",
775
774
  "type": "string",
776
- "required": false
775
+ "required": true,
776
+ "readonly": true
777
777
  },
778
778
  "name": {
779
779
  "title": "Name",
780
780
  "type": "string",
781
- "required": false
781
+ "required": true
782
782
  },
783
783
  "displayMode": {
784
784
  "title": "Control",
@@ -881,7 +881,7 @@
881
881
  "id": {
882
882
  "title": "ID",
883
883
  "type": "integer",
884
- "required": false
884
+ "required": true
885
885
  },
886
886
  "name": {
887
887
  "title": "Name",
@@ -945,9 +945,6 @@
945
945
  "required": false
946
946
  }
947
947
  }
948
- },
949
- "condition": {
950
- "functionBody": "const presets = model.accounts[arrayIndices]?.devicesAtw[arrayIndices]?.presets || []; const hasValidPresets = presets.length > 0 && presets.every(preset => preset.name != null && preset.name !== ''); return hasValidPresets;"
951
948
  }
952
949
  },
953
950
  "buttonsSensors": {
@@ -1160,15 +1157,12 @@
1160
1157
  "required": false
1161
1158
  }
1162
1159
  }
1163
- },
1164
- "condition": {
1165
- "functionBody": "const buttons = model.accounts[arrayIndices]?.devicesAtw[arrayIndices]?.buttons || []; const hasValidButtons = buttons.length > 0 && buttons.every(button => button.name != null && button.name !== ''); return hasValidButtons;"
1166
1160
  }
1167
1161
  }
1168
1162
  }
1169
1163
  },
1170
1164
  "condition": {
1171
- "functionBody": "const devices = model.accounts[arrayIndices]?.atwDevices || []; return devices.length > 0 && devices.every(device => device.id != null && device.id !== '');"
1165
+ "functionBody": "const devices = model.accounts[arrayIndices]?.atwDevices || []; return devices.length > 0 && devices.every(device => device.id != null);"
1172
1166
  }
1173
1167
  },
1174
1168
  "ervDevices": {
@@ -1180,22 +1174,25 @@
1180
1174
  "id": {
1181
1175
  "title": "Mode",
1182
1176
  "type": "integer",
1183
- "required": false
1177
+ "required": true,
1178
+ "readonly": true
1184
1179
  },
1185
1180
  "type": {
1186
1181
  "title": "Type",
1187
1182
  "type": "integer",
1188
- "required": false
1183
+ "required": true,
1184
+ "readonly": true
1189
1185
  },
1190
1186
  "typeString": {
1191
1187
  "title": "Type",
1192
1188
  "type": "string",
1193
- "required": false
1189
+ "required": true,
1190
+ "readonly": true
1194
1191
  },
1195
1192
  "name": {
1196
1193
  "title": "Name",
1197
1194
  "type": "string",
1198
- "required": false
1195
+ "required": true
1199
1196
  },
1200
1197
  "displayMode": {
1201
1198
  "title": "Control",
@@ -1256,7 +1253,8 @@
1256
1253
  "id": {
1257
1254
  "title": "ID",
1258
1255
  "type": "integer",
1259
- "required": false
1256
+ "required": true,
1257
+ "readonly": true
1260
1258
  },
1261
1259
  "name": {
1262
1260
  "title": "Name",
@@ -1320,9 +1318,6 @@
1320
1318
  "required": false
1321
1319
  }
1322
1320
  }
1323
- },
1324
- "condition": {
1325
- "functionBody": "const presets = model.accounts[arrayIndices]?.devicesErv[arrayIndices]?.presets || []; const hasValidPresets = presets.length > 0 && presets.every(preset => preset.name != null && preset.name !== ''); return hasValidPresets;"
1326
1321
  }
1327
1322
  },
1328
1323
  "buttonsSensors": {
@@ -1487,15 +1482,12 @@
1487
1482
  "required": false
1488
1483
  }
1489
1484
  }
1490
- },
1491
- "condition": {
1492
- "functionBody": "const buttons = model.accounts[arrayIndices]?.devicesErv[arrayIndices]?.buttons || []; const hasValidButtons = buttons.length > 0 && buttons.every(button => button.name != null && button.name !== ''); return hasValidButtons;"
1493
1485
  }
1494
1486
  }
1495
1487
  }
1496
1488
  },
1497
1489
  "condition": {
1498
- "functionBody": "const devices = model.accounts[arrayIndices]?.ervDevices || []; return devices.length > 0 && devices.every(device => device.id != null && device.id !== '');"
1490
+ "functionBody": "const devices = model.accounts[arrayIndices]?.ervDevices || []; return devices.length > 0 && devices.every(device => device.id != null);"
1499
1491
  }
1500
1492
  },
1501
1493
  "refreshInterval": {
@@ -1706,7 +1698,7 @@
1706
1698
  {
1707
1699
  "key": "accounts[].ataDevices[]",
1708
1700
  "type": "section",
1709
- "title": "Configuration",
1701
+ "title": "Settings",
1710
1702
  "expandable": true,
1711
1703
  "expanded": false,
1712
1704
  "items": [
@@ -1714,19 +1706,7 @@
1714
1706
  "accounts[].ataDevices[].displayMode",
1715
1707
  "accounts[].ataDevices[].heatDryFanMode",
1716
1708
  "accounts[].ataDevices[].coolDryFanMode",
1717
- "accounts[].ataDevices[].autoDryFanMode",
1718
- "accounts[].ataDevices[].presets"
1719
- ]
1720
- },
1721
- {
1722
- "key": "accounts[].ataDevices[]",
1723
- "type": "section",
1724
- "title": "Temperature Sensors",
1725
- "expandable": true,
1726
- "expanded": false,
1727
- "items": [
1728
- "accounts[].ataDevices[].temperatureSensor",
1729
- "accounts[].ataDevices[].temperatureSensorOutdoor"
1709
+ "accounts[].ataDevices[].autoDryFanMode"
1730
1710
  ]
1731
1711
  },
1732
1712
  {
@@ -1752,6 +1732,17 @@
1752
1732
  }
1753
1733
  ]
1754
1734
  },
1735
+ {
1736
+ "key": "accounts[].ataDevices[]",
1737
+ "type": "section",
1738
+ "title": "Temperature Sensors",
1739
+ "expandable": true,
1740
+ "expanded": false,
1741
+ "items": [
1742
+ "accounts[].ataDevices[].temperatureSensor",
1743
+ "accounts[].ataDevices[].temperatureSensorOutdoor"
1744
+ ]
1745
+ },
1755
1746
  {
1756
1747
  "key": "accounts[].ataDevices[]",
1757
1748
  "type": "section",
@@ -1796,31 +1787,12 @@
1796
1787
  {
1797
1788
  "key": "accounts[].atwDevices[]",
1798
1789
  "type": "section",
1799
- "title": "Configuration",
1790
+ "title": "Settings",
1800
1791
  "expandable": true,
1801
1792
  "expanded": false,
1802
1793
  "items": [
1803
1794
  "accounts[].atwDevices[].name",
1804
- "accounts[].atwDevices[].displayMode",
1805
- "accounts[].atwDevices[].presets"
1806
- ]
1807
- },
1808
- {
1809
- "key": "accounts[].atwDevices[]",
1810
- "type": "section",
1811
- "title": "Temperature Sensors",
1812
- "expandable": true,
1813
- "expanded": false,
1814
- "items": [
1815
- "accounts[].atwDevices[].temperatureSensor",
1816
- "accounts[].atwDevices[].temperatureSensorFlow",
1817
- "accounts[].atwDevices[].temperatureSensorReturn",
1818
- "accounts[].atwDevices[].temperatureSensorFlowZone1",
1819
- "accounts[].atwDevices[].temperatureSensorReturnZone1",
1820
- "accounts[].atwDevices[].temperatureSensorFlowWaterTank",
1821
- "accounts[].atwDevices[].temperatureSensorReturnWaterTank",
1822
- "accounts[].atwDevices[].temperatureSensorFlowZone2",
1823
- "accounts[].atwDevices[].temperatureSensorReturnZone2"
1795
+ "accounts[].atwDevices[].displayMode"
1824
1796
  ]
1825
1797
  },
1826
1798
  {
@@ -1846,6 +1818,24 @@
1846
1818
  }
1847
1819
  ]
1848
1820
  },
1821
+ {
1822
+ "key": "accounts[].atwDevices[]",
1823
+ "type": "section",
1824
+ "title": "Temperature Sensors",
1825
+ "expandable": true,
1826
+ "expanded": false,
1827
+ "items": [
1828
+ "accounts[].atwDevices[].temperatureSensor",
1829
+ "accounts[].atwDevices[].temperatureSensorFlow",
1830
+ "accounts[].atwDevices[].temperatureSensorReturn",
1831
+ "accounts[].atwDevices[].temperatureSensorFlowZone1",
1832
+ "accounts[].atwDevices[].temperatureSensorReturnZone1",
1833
+ "accounts[].atwDevices[].temperatureSensorFlowWaterTank",
1834
+ "accounts[].atwDevices[].temperatureSensorReturnWaterTank",
1835
+ "accounts[].atwDevices[].temperatureSensorFlowZone2",
1836
+ "accounts[].atwDevices[].temperatureSensorReturnZone2"
1837
+ ]
1838
+ },
1849
1839
  {
1850
1840
  "key": "accounts[].atwDevices[]",
1851
1841
  "type": "section",
@@ -1890,25 +1880,12 @@
1890
1880
  {
1891
1881
  "key": "accounts[].ervDevices[]",
1892
1882
  "type": "section",
1893
- "title": "Configuration",
1883
+ "title": "Settings",
1894
1884
  "expandable": true,
1895
1885
  "expanded": false,
1896
1886
  "items": [
1897
1887
  "accounts[].ervDevices[].name",
1898
- "accounts[].ervDevices[].displayMode",
1899
- "accounts[].ervDevices[].presets"
1900
- ]
1901
- },
1902
- {
1903
- "key": "accounts[].ervDevices[]",
1904
- "type": "section",
1905
- "title": "Temperature Sensors",
1906
- "expandable": true,
1907
- "expanded": false,
1908
- "items": [
1909
- "accounts[].ervDevices[].temperatureSensor",
1910
- "accounts[].ervDevices[].temperatureSensorOutdoor",
1911
- "accounts[].ervDevices[].temperatureSensorSupply"
1888
+ "accounts[].ervDevices[].displayMode"
1912
1889
  ]
1913
1890
  },
1914
1891
  {
@@ -1934,6 +1911,18 @@
1934
1911
  }
1935
1912
  ]
1936
1913
  },
1914
+ {
1915
+ "key": "accounts[].ervDevices[]",
1916
+ "type": "section",
1917
+ "title": "Temperature Sensors",
1918
+ "expandable": true,
1919
+ "expanded": false,
1920
+ "items": [
1921
+ "accounts[].ervDevices[].temperatureSensor",
1922
+ "accounts[].ervDevices[].temperatureSensorOutdoor",
1923
+ "accounts[].ervDevices[].temperatureSensorSupply"
1924
+ ]
1925
+ },
1937
1926
  {
1938
1927
  "key": "accounts[].ervDevices[]",
1939
1928
  "type": "section",
@@ -9,6 +9,7 @@
9
9
  <label id="accountName" style="font-size: 23px">Account</label><br>
10
10
  <label id="info" style="text-align: center; font-size: 17px;"></label><br>
11
11
  <label id="info1" style="text-align: center; font-size: 15px;"></label><br>
12
+ <label id="info2" style="text-align: center; font-size: 15px;"></label><br>
12
13
  </div>
13
14
  <div class="form-group">
14
15
  <label for="name">Name</label>
@@ -131,11 +132,10 @@
131
132
  //watch for click on the login button
132
133
  document.getElementById('logIn').addEventListener('click', async () => {
133
134
  homebridge.showSpinner();
135
+ document.getElementById('info').innerHTML = 'Connecting...';
136
+ await homebridge.updatePluginConfig(pluginConfig)
134
137
 
135
138
  try {
136
- await homebridge.updatePluginConfig(pluginConfig)
137
- document.getElementById('info').innerHTML = 'Connecting...';
138
-
139
139
  const accountName = pluginConfig[0].accounts[this.deviceIndex].name;
140
140
  const user = pluginConfig[0].accounts[this.deviceIndex].user;
141
141
  const passwd = pluginConfig[0].accounts[this.deviceIndex].passwd;
@@ -169,11 +169,11 @@
169
169
 
170
170
  //info text
171
171
  let textAta = 'ATA: 0';
172
- let textAtaPresets = 'Presets: 0';
172
+ let textAtaPresets = 'ATA Presets: 0';
173
173
  let textAtw = 'ATW: 0';
174
- let textAtwPresets = 'Presets: 0';
174
+ let textAtwPresets = 'ATW Presets: 0';
175
175
  let textErv = 'ERV: 0';
176
- let textErvPresets = 'Presets: 0';
176
+ let textErvPresets = 'ERV Presets: 0';
177
177
 
178
178
  //response status
179
179
  switch (status) {
@@ -230,7 +230,7 @@
230
230
 
231
231
  const ataPresetsExist = pluginConfig[0].accounts[this.deviceIndex].ataDevices[index].presets ?? false;
232
232
  const ataPresets = ataPresetsExist ? pluginConfig[0].accounts[this.deviceIndex].ataDevices[index].presets : pluginConfig[0].accounts[this.deviceIndex].ataDevices[index].presets = [];
233
- const ataPresetIdExist = ataPresets.some(preset => preset.ID === presetId);
233
+ const ataPresetIdExist = ataPresets.some(preset => preset.id === presetId);
234
234
  const pushPresetAta = ataPresetIdExist ? false : ataPresets.push(preset);
235
235
  const pushNewPreset = ataPresetIdExist ? false : newDevices.ataPresets.push(preset);
236
236
  const presetsCount = newDevices.ataPresets.length;
@@ -287,7 +287,7 @@
287
287
 
288
288
  const atwPresetsExist = pluginConfig[0].accounts[this.deviceIndex].atwDevices[index].presets ?? false;
289
289
  const atwPresets = atwPresetsExist ? pluginConfig[0].accounts[this.deviceIndex].atwDevices[index].presets : pluginConfig[0].accounts[this.deviceIndex].atwDevices[index].presets = [];
290
- const atwPresetIdExist = atwPresets.some(preset => preset.ID === presetId);
290
+ const atwPresetIdExist = atwPresets.some(preset => preset.id === presetId);
291
291
  const pushPresetAtw = atwPresetIdExist ? false : atwPresets.push(preset);
292
292
  const pushNewPreset = atwPresetIdExist ? false : newDevices.atwPresets.push(preset);
293
293
  const presetsCount = newDevices.atwPresets.length;
@@ -338,7 +338,7 @@
338
338
 
339
339
  const ervPresetsExist = pluginConfig[0].accounts[this.deviceIndex].ervDevices[index].presets ?? false;
340
340
  const ervPresets = ervPresetsExist ? pluginConfig[0].accounts[this.deviceIndex].ervDevices[index].presets : pluginConfig[0].accounts[this.deviceIndex].ervDevices[index].presets = [];
341
- const ervPresetIdExist = ervPresets.some(preset => preset.ID === presetId);
341
+ const ervPresetIdExist = ervPresets.some(preset => preset.id === presetId);
342
342
  const pushPresetErv = ervPresetIdExist ? false : ervPresets.push(preset);
343
343
  const pushNewPreset = ervPresetIdExist ? false : newDevices.ervPresets.push(preset);
344
344
  const presetsCount = newDevices.ervPresets.length;
@@ -346,12 +346,35 @@
346
346
  };
347
347
  });
348
348
 
349
- const newDevicesCount = newDevices.ata.length + newDevices.atw.length + newDevices.erv.length;
350
- const newPresetsCount = newDevices.ataPresets.length + newDevices.atwPresets.length + newDevices.ervPresets.length;
351
- document.getElementById('info').innerHTML = `${newDevicesCount === 0 ? 'No new devices found.' : `Found, ${textAta}, ${textAtw}, ${textErv}. ${newDevicesCount === 0 ? '' : 'Now You can start to configure it.'}`}`;
352
- document.getElementById('info').style.color = newDevicesCount === 0 ? 'yellow' : 'green';
353
- document.getElementById('info1').innerHTML = `${newPresetsCount === 0 ? 'No new presets found.' : `Found, ${textAtaPresets}, ${textAtwPresets}, ${textErvPresets}. ${newPresetsCount === 0 ? '' : 'Now You can start to configure it.'}`}`;
354
- document.getElementById('info1').style.color = newPresetsCount === 0 ? 'yellow' : 'green';
349
+ const newDevicesCount = newDevices.ata.length + newDevices.atw.length + newDevices.erv.length ?? 0;
350
+ const newPresetsCount = newDevices.ataPresets.length + newDevices.atwPresets.length + newDevices.ervPresets.length ?? 0;
351
+ if (newDevicesCount === 0 && newPresetsCount === 0) {
352
+ document.getElementById('info').innerHTML = 'No new devices found.';
353
+ document.getElementById('info').style.color = 'white';
354
+ };
355
+
356
+ if (newDevicesCount > 0 && newPresetsCount > 0) {
357
+ document.getElementById('info').innerHTML = `Found, ${textAta}, ${textAtw}, ${textErv}.`;
358
+ document.getElementById('info').style.color = 'green';
359
+ document.getElementById('info1').innerHTML = `${textAtaPresets}, ${textAtwPresets}, ${textErvPresets}.`;
360
+ document.getElementById('info1').style.color = 'green';
361
+ document.getElementById('info2').innerHTML = 'Now You can configure it.';
362
+ document.getElementById('info2').style.color = 'green';
363
+ };
364
+
365
+ if (newDevicesCount > 0 && newPresetsCount === 0) {
366
+ document.getElementById('info').innerHTML = `Found, ${textAta}, ${textAtw}, ${textErv}.`;
367
+ document.getElementById('info').style.color = 'green';
368
+ document.getElementById('info1').innerHTML = 'Now You can configure it.';
369
+ document.getElementById('info1').style.color = 'green';
370
+ };
371
+
372
+ if (newDevicesCount === 0 && newPresetsCount > 0) {
373
+ document.getElementById('info').innerHTML = `Found, ${textAtaPresets}, ${textAtwPresets}, ${textErvPresets}.`;
374
+ document.getElementById('info').style.color = 'green';
375
+ document.getElementById('info1').innerHTML = 'Now You can configure it.';
376
+ document.getElementById('info1').style.color = 'green';
377
+ }
355
378
 
356
379
  await homebridge.updatePluginConfig(pluginConfig);
357
380
  await homebridge.savePluginConfig(pluginConfig);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "3.1.0-beta.9",
4
+ "version": "3.1.0",
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
@@ -1092,10 +1092,13 @@ class DeviceAta extends EventEmitter {
1092
1092
  const index = presetsOnServer.findIndex(p => p.ID === preset.Id);
1093
1093
  const presetData = presetsOnServer[index];
1094
1094
 
1095
- //get button name
1095
+ //get preset name
1096
1096
  const presetName = preset.name;
1097
1097
 
1098
- //get button name prefix
1098
+ //get preset display type
1099
+ const displayType = button.displayType;
1100
+
1101
+ //get preset name prefix
1099
1102
  const presetNamePrefix = preset.namePrefix;
1100
1103
 
1101
1104
  const serviceName = presetNamePrefix ? `${accessoryName} ${presetName}` : presetName;
@@ -1110,6 +1113,10 @@ class DeviceAta extends EventEmitter {
1110
1113
  return state;
1111
1114
  })
1112
1115
  .onSet(async (state) => {
1116
+ if (displayType > 2) {
1117
+ return;
1118
+ };
1119
+
1113
1120
  try {
1114
1121
  switch (state) {
1115
1122
  case true:
package/src/deviceatw.js CHANGED
@@ -581,18 +581,18 @@ class DeviceAtw extends EventEmitter {
581
581
  const index = presetsOnServer.findIndex(p => p.ID === preset.Id);
582
582
  const presetData = presetsOnServer[index];
583
583
 
584
- preset.state = presetData ? (preset.Power === power
585
- && preset.EcoHotWater === ecoHotWater
586
- && preset.OperationModeZone1 === operationModeZone1
587
- && preset.OperationModeZone2 === operationModeZone2
588
- && preset.SetTankWaterTemperature === setTankWaterTemperature
589
- && preset.SetTemperatureZone1 === setTemperatureZone1
590
- && preset.SetTemperatureZone2 === setTemperatureZone2
591
- && preset.ForcedHotWaterMode === forcedHotWaterMode
592
- && preset.SetHeatFlowTemperatureZone1 === setHeatFlowTemperatureZone1
593
- && preset.SetHeatFlowTemperatureZone2 === setHeatFlowTemperatureZone2
594
- && preset.SetCoolFlowTemperatureZone1 === setCoolFlowTemperatureZone1
595
- && preset.SetCoolFlowTemperatureZone2 === setCoolFlowTemperatureZone2) : false;
584
+ preset.state = presetData ? (presetData.Power === power
585
+ && presetData.EcoHotWater === ecoHotWater
586
+ && presetData.OperationModeZone1 === operationModeZone1
587
+ && presetData.OperationModeZone2 === operationModeZone2
588
+ && presetData.SetTankWaterTemperature === setTankWaterTemperature
589
+ && presetData.SetTemperatureZone1 === setTemperatureZone1
590
+ && presetData.SetTemperatureZone2 === setTemperatureZone2
591
+ && presetData.ForcedHotWaterMode === forcedHotWaterMode
592
+ && presetData.SetHeatFlowTemperatureZone1 === setHeatFlowTemperatureZone1
593
+ && presetData.SetHeatFlowTemperatureZone2 === setHeatFlowTemperatureZone2
594
+ && presetData.SetCoolFlowTemperatureZone1 === setCoolFlowTemperatureZone1
595
+ && presetData.SetCoolFlowTemperatureZone2 === setCoolFlowTemperatureZone2) : false;
596
596
 
597
597
  if (this.presetsServices) {
598
598
  const characteristicType = preset.characteristicType;
@@ -1540,10 +1540,13 @@ class DeviceAtw extends EventEmitter {
1540
1540
  const index = presetsOnServer.findIndex(p => p.ID === preset.Id);
1541
1541
  const presetData = presetsOnServer[index];
1542
1542
 
1543
- //get button name
1543
+ //get preset name
1544
1544
  const presetName = preset.name;
1545
1545
 
1546
- //get button name prefix
1546
+ //get preset display type
1547
+ const displayType = button.displayType;
1548
+
1549
+ //get preset name prefix
1547
1550
  const presetNamePrefix = preset.namePrefix;
1548
1551
 
1549
1552
  const serviceName = presetNamePrefix ? `${accessoryName} ${presetName}` : presetName;
@@ -1558,6 +1561,10 @@ class DeviceAtw extends EventEmitter {
1558
1561
  return state;
1559
1562
  })
1560
1563
  .onSet(async (state) => {
1564
+ if (displayType > 2) {
1565
+ return;
1566
+ };
1567
+
1561
1568
  try {
1562
1569
  switch (state) {
1563
1570
  case true:
package/src/deviceerv.js CHANGED
@@ -445,11 +445,11 @@ class DeviceErv extends EventEmitter {
445
445
  const index = presetsOnServer.findIndex(p => p.ID === preset.Id);
446
446
  const presetData = presetsOnServer[index];
447
447
 
448
- preset.state = presetData ? (preset.Power === power
449
- && preset.SetTemperature === targetTemperature
450
- && preset.OperationMode === operationMode
451
- && preset.VentilationMode === ventilationMode
452
- && preset.FanSpeed === setFanSpeed) : false;
448
+ preset.state = presetData ? (presetData.Power === power
449
+ && presetData.SetTemperature === targetTemperature
450
+ && presetData.OperationMode === operationMode
451
+ && presetData.VentilationMode === ventilationMode
452
+ && presetData.FanSpeed === setFanSpeed) : false;
453
453
 
454
454
  if (this.presetsServices) {
455
455
  const characteristicType = preset.characteristicType;
@@ -1089,10 +1089,13 @@ class DeviceErv extends EventEmitter {
1089
1089
  const index = presetsOnServer.findIndex(p => p.ID === preset.Id);
1090
1090
  const presetData = presetsOnServer[index]
1091
1091
 
1092
- //get button name
1092
+ //get preset name
1093
1093
  const presetName = preset.name;
1094
1094
 
1095
- //get button name prefix
1095
+ //get preset display type
1096
+ const displayType = button.displayType;
1097
+
1098
+ //get preset name prefix
1096
1099
  const presetNamePrefix = preset.namePrefix;
1097
1100
 
1098
1101
  const serviceName = presetNamePrefix ? `${accessoryName} ${presetName}` : presetName;
@@ -1107,6 +1110,10 @@ class DeviceErv extends EventEmitter {
1107
1110
  return state;
1108
1111
  })
1109
1112
  .onSet(async (state) => {
1113
+ if (displayType > 2) {
1114
+ return;
1115
+ };
1116
+
1110
1117
  try {
1111
1118
  switch (state) {
1112
1119
  case true: