homebridge-melcloud-control 2.3.0-beta.9 → 2.3.1-beta.1
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 +3 -2
- package/README.md +19 -19
- package/config.schema.json +74 -29
- package/index.js +13 -25
- package/package.json +1 -1
- package/src/deviceata.js +221 -139
- package/src/deviceatw.js +120 -120
- package/src/deviceerv.js +109 -58
- package/src/melcloud.js +6 -6
- package/src/melcloudata.js +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -26,8 +26,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
26
26
|
## Changes
|
|
27
27
|
|
|
28
28
|
- removed from config.json `ataDisableAutoMode`, `ataDisableHeatMode`, `ataAutoHeatMode`
|
|
29
|
-
- added to config.json `ataHeatDryFanMode`, `
|
|
30
|
-
- added [#132](https://github.com/grzegorz914/homebridge-melcloud-control/issues/132)
|
|
29
|
+
- added to config.json `ataHeatDryFanMode`, `ataCoolDryFanMode`, `ataAutoDryFanMode`
|
|
30
|
+
- added individual operating mode assingn for `Heat/Cool/Auto`, [#132](https://github.com/grzegorz914/homebridge-melcloud-control/issues/132)
|
|
31
|
+
- unfortunatelly disabled operating mode cannot be hiden in HomeKit app due to HomeKit app limitations
|
|
31
32
|
- cleanup
|
|
32
33
|
- config schema updated
|
|
33
34
|
|
package/README.md
CHANGED
|
@@ -32,8 +32,9 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
32
32
|
* Support temperature display units `Celsius/Fahrenheit`.
|
|
33
33
|
* Support hide device by `DeviceId`.
|
|
34
34
|
* Support control device `Presets`.
|
|
35
|
-
* Support
|
|
36
|
-
* Support
|
|
35
|
+
* Support assing inividual operating mode for `Heat/Cool/Auto`.
|
|
36
|
+
* Support direct device control using extra `Buttons`, applied for all devices of same type in account.
|
|
37
|
+
* Support detect all device states using extra `Sensors`, applied for all devices of same type in account.
|
|
37
38
|
* Support automations, shortcuts and Siri.
|
|
38
39
|
* Support external integrations, [RESTFul](https://github.com/grzegorz914/homebridge-melcloud-control?tab=readme-ov-file#restful-integration), [MQTT](https://github.com/grzegorz914/homebridge-melcloud-control?tab=readme-ov-file#mqtt-integration).
|
|
39
40
|
|
|
@@ -48,7 +49,6 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
48
49
|
* Swing mode `AUTO/SWING`.
|
|
49
50
|
* Physical lock controls `LOCK/UNLOCK`.
|
|
50
51
|
* Temperature display unit `°F/°C`.
|
|
51
|
-
* Assign operating mode for `HEAT/AUTO`.
|
|
52
52
|
* Thermostat:
|
|
53
53
|
* Power `ON/OFF`.
|
|
54
54
|
* Operating mode `POWER OFF/HEAT/COOL/AUTO`.
|
|
@@ -164,7 +164,6 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
164
164
|
* Run this plugin as a [Child Bridge](https://github.com/homebridge/homebridge/wiki/Child-Bridges) (Highly Recommended), this prevent crash Homebridge if plugin crashes.
|
|
165
165
|
* Install and use [Homebridge Config UI X](https://github.com/homebridge/homebridge-config-ui-x/wiki) to configure this plugin (Highly Recommended).
|
|
166
166
|
* The `sample-config.json` can be edited and used as an alternative.
|
|
167
|
-
* Be sure to always make a backup copy of your config.json file before making any changes to it.
|
|
168
167
|
|
|
169
168
|
<p align="center">
|
|
170
169
|
<a href="https://github.com/grzegorz914/homebridge-melcloud-control"><img src="https://raw.githubusercontent.com/grzegorz914/homebridge-melcloud-control/main/graphics/ustawienia.png" width="840"></a>
|
|
@@ -176,11 +175,12 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
176
175
|
| `user` | Here set the MELCloud username. |
|
|
177
176
|
| `passwd` | Here set the MELCloud password. |
|
|
178
177
|
| `language` | Here select the MELCloud language. |
|
|
179
|
-
| `ataDisplayMode` | Here select
|
|
178
|
+
| `ataDisplayMode` | Here select device control mode `Heater/Cooler`, `Thermostat`. |
|
|
179
|
+
| `ataHeatDryFanMode` | Here select the operatiing mode for `Heat`, if this mode is not supported, it will be disabled. |
|
|
180
|
+
| `ataCoolDryFanMode` | Here select the operatiing mode for `Cool`, if this mode is not supported, it will be disabled. |
|
|
181
|
+
| `ataAutoDryFanMode` | Here select the operatiing mode for `Auto`, if this mode is not supported, it will be disabled.. |
|
|
180
182
|
| `ataTemperatureSensor` | This enable extra `Room` temperature sensors to use with automations in HomeKit app. |
|
|
181
183
|
| `ataTemperatureSensorOutdoor` | This enable extra `Outdoor` temperature sensors to use with automations in HomeKit app. |
|
|
182
|
-
| `ataHeatDryFanMode` | Here select operation mode for `Heat`, if selected `Heat` and the mode is not supported by device then will be disabled, in other cases will use selected mode. |
|
|
183
|
-
| `ataAutoDryFanMode` | Here select operation mode for `Auto`, if selected `Auto` and the mode is not supported by device then will be disabled, in other cases will use selected mode. |
|
|
184
184
|
| `ataPresets` | This enable extra buttons for configured presets and display it in HomeKit app. |
|
|
185
185
|
| `ataButtons.name` | Here set `Button Name` which You want expose to the `Homebridge/HomeKit`. |
|
|
186
186
|
| `ataButtons.mode` | Here select button mode, VH - Vane Horizontal, VV - Vane Horizontal. |
|
|
@@ -253,9 +253,9 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
253
253
|
| | `http//ip:port` | `HideVaneControls` | `true`, `false` | boolean | Hide vane controls. |
|
|
254
254
|
| | `http//ip:port` | `HideDryModeControl` | `true`, `false` | boolean | Hide dry mode control. |
|
|
255
255
|
| | `http//ip:port` | `ProhibitSetTemperature` | `true`, `false` | boolean | Lock set temperature. |
|
|
256
|
-
| | `http//ip:port` | `ProhibitOperationMode` | `true`, `false` | boolean | Lock set
|
|
256
|
+
| | `http//ip:port` | `ProhibitOperationMode` | `true`, `false` | boolean | Lock set operating mode. |
|
|
257
257
|
| | `http//ip:port` | `ProhibitPower` | `true`, `false` | boolean | Lock set power. |
|
|
258
|
-
| | `http//ip:port` | `OperationMode` | `1 - Heat`, `2 - Dry`, `3 - Cool`, `7 - Fan`, `8 - Auto` | integer |
|
|
258
|
+
| | `http//ip:port` | `OperationMode` | `1 - Heat`, `2 - Dry`, `3 - Cool`, `7 - Fan`, `8 - Auto` | integer | Operating mode. |
|
|
259
259
|
| | `http//ip:port` | `SetFanSpeed` | `0 - Auto`, `1`, `2`, `3`, `4`, `5`, `6` | integer | Fan speed. |
|
|
260
260
|
| | `http//ip:port` | `VaneHorizontal` | `0`, `1`, `2`, `3`, `4`, `5`, `8 - Split`, `12 - Swing` | integer | Vane H mode. |
|
|
261
261
|
| | `http//ip:port` | `VaneVertical` | `0`, `1`, `2`, `3`, `4`, `5`, `7 - Swing` | integer | Vane V mode. |
|
|
@@ -270,9 +270,9 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
270
270
|
| | `http//ip:port` | `ProhibitZone1` | `true`, `false` | boolean | Lock control zone 1. |
|
|
271
271
|
| | `http//ip:port` | `ProhibitZone2` | `true`, `false` | boolean | Lock control zone 2. |
|
|
272
272
|
| | `http//ip:port` | `ProhibitHotWater` | `true`, `false` | boolean | Lock control hot water. |
|
|
273
|
-
| | `http//ip:port` | `OperationMode` | `0 - Auto`, `1 - Heat`, `2 - Cool` | integer |
|
|
274
|
-
| | `http//ip:port` | `OperationModeZone1` | `0 - Heat Thermostat`, `1 - Heat Flow`, `2 - Heat Curve`, `3 - Cool Thermostat`, `4 - Cool Flow`, `5 - Flor Dry Up` | integer |
|
|
275
|
-
| | `http//ip:port` | `OperationModeZone2` | `0 - Heat Thermostat`, `1 - Heat Flow`, `2 - Heat Curve`, `3 - Cool Thermostat`, `4 - Cool Flow`, `5 - Flor Dry Up` | integer |
|
|
273
|
+
| | `http//ip:port` | `OperationMode` | `0 - Auto`, `1 - Heat`, `2 - Cool` | integer | Operating mode heat pump. |
|
|
274
|
+
| | `http//ip:port` | `OperationModeZone1` | `0 - Heat Thermostat`, `1 - Heat Flow`, `2 - Heat Curve`, `3 - Cool Thermostat`, `4 - Cool Flow`, `5 - Flor Dry Up` | integer | Operating mode zone 1. |
|
|
275
|
+
| | `http//ip:port` | `OperationModeZone2` | `0 - Heat Thermostat`, `1 - Heat Flow`, `2 - Heat Curve`, `3 - Cool Thermostat`, `4 - Cool Flow`, `5 - Flor Dry Up` | integer | Operating mode zone 2. |
|
|
276
276
|
| | `http//ip:port` | `SetTemperatureZone1` | `0.0` | float | Temperature zone 1. |
|
|
277
277
|
| | `http//ip:port` | `SetTemperatureZone2` | `0.0` | float | Temperature zone 2. |
|
|
278
278
|
| | `http//ip:port` | `SetHeatFlowTemperatureZone1` | `0.0` | float | Heat flow temperature zone 1. |
|
|
@@ -286,7 +286,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
286
286
|
| | `http//ip:port` | `HideRoomTemperature` | `true`, `false` | boolean | Hide room temperature. |
|
|
287
287
|
| | `http//ip:port` | `HideSupplyTemperature` | `true`, `false` | boolean | Hide supply temperature. |
|
|
288
288
|
| | `http//ip:port` | `HideOutdoorTemperature` | `true`, `false` | boolean | Hide outdoor temperature. |
|
|
289
|
-
| | `http//ip:port` | `OperationMode` | `1 - Heat`, `3 - Cool`, `7 - Fan`, `8 - Auto` | integer |
|
|
289
|
+
| | `http//ip:port` | `OperationMode` | `1 - Heat`, `3 - Cool`, `7 - Fan`, `8 - Auto` | integer | Operating mode. |
|
|
290
290
|
| | `http//ip:port` | `VentilationMode` | `0 - Lossnay`, `1 - Bypass`, `2 - Auto` | integer | Ventilation mode. |
|
|
291
291
|
| | `http//ip:port` | `SetFanSpeed` | `0 - Auto`, `1`, `2`, `3`, `4` | integer | Fan speed. |
|
|
292
292
|
| | `http//ip:port` | `SetTemperature` | `0.0` | float | Room temperature. |
|
|
@@ -308,9 +308,9 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
308
308
|
| | `Set` | `HideVaneControls` | `true`, `false` | boolean | Hide vane controls. |
|
|
309
309
|
| | `Set` | `HideDryModeControl` | `true`, `false` | boolean | Hide dry mode control. |
|
|
310
310
|
| | `Set` | `ProhibitSetTemperature` | `true`, `false` | boolean | Lock set temperature. |
|
|
311
|
-
| | `Set` | `ProhibitOperationMode` | `true`, `false` | boolean | Lock set
|
|
311
|
+
| | `Set` | `ProhibitOperationMode` | `true`, `false` | boolean | Lock set operating mode. |
|
|
312
312
|
| | `Set` | `ProhibitPower` | `true`, `false` | boolean | Lock set power. |
|
|
313
|
-
| | `Set` | `OperationMode` | `1 - Heat`, `2 - Dry`, `3 - Cool`, `7 - Fan`, `8 - Auto` | integer |
|
|
313
|
+
| | `Set` | `OperationMode` | `1 - Heat`, `2 - Dry`, `3 - Cool`, `7 - Fan`, `8 - Auto` | integer | Operating mode. |
|
|
314
314
|
| | `Set` | `SetFanSpeed` | `0 - Auto`, `1`, `2`, `3`, `4`, `5`, `6` | integer | Fan speed. |
|
|
315
315
|
| | `Set` | `VaneHorizontal` | `0`, `1`, `2`, `3`, `4`, `5`, `8 - Split`, `12 - Swing` | integer | Vane H mode. |
|
|
316
316
|
| | `Set` | `VaneVertical` | `0`, `1`, `2`, `3`, `4`, `5`, `7 - Swing` | integer | Vane V mode. |
|
|
@@ -325,9 +325,9 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
325
325
|
| | `Set` | `ProhibitZone1` | `true`, `false` | boolean | Lock control zone 1. |
|
|
326
326
|
| | `Set` | `ProhibitZone2` | `true`, `false` | boolean | Lock control zone 2. |
|
|
327
327
|
| | `Set` | `ProhibitHotWater` | `true`, `false` | boolean | Lock control hot water. |
|
|
328
|
-
| | `Set` | `OperationMode` | `0 - Auto`, `1 - Heat`, `2 - Cool` | integer |
|
|
329
|
-
| | `Set` | `OperationModeZone1` | `0 - Heat Thermostat`, `1 - Heat Flow`, `2 - Heat Curve`, `3 - Cool Thermostat`, `4 - Cool Flow`, `5 - Flor Dry Up` | integer |
|
|
330
|
-
| | `Set` | `OperationModeZone2` | `0 - Heat Thermostat`, `1 - Heat Flow`, `2 - Heat Curve`, `3 - Cool Thermostat`, `4 - Cool Flow`, `5 - Flor Dry Up` | integer |
|
|
328
|
+
| | `Set` | `OperationMode` | `0 - Auto`, `1 - Heat`, `2 - Cool` | integer | Operating mode heat pump. |
|
|
329
|
+
| | `Set` | `OperationModeZone1` | `0 - Heat Thermostat`, `1 - Heat Flow`, `2 - Heat Curve`, `3 - Cool Thermostat`, `4 - Cool Flow`, `5 - Flor Dry Up` | integer | Operating mode zone 1. |
|
|
330
|
+
| | `Set` | `OperationModeZone2` | `0 - Heat Thermostat`, `1 - Heat Flow`, `2 - Heat Curve`, `3 - Cool Thermostat`, `4 - Cool Flow`, `5 - Flor Dry Up` | integer | Operating mode zone 2. |
|
|
331
331
|
| | `Set` | `SetTemperatureZone1` | `0.0` | float | Temperature zone 1. |
|
|
332
332
|
| | `Set` | `SetTemperatureZone2` | `0.0` | float | Temperature zone 2. |
|
|
333
333
|
| | `Set` | `SetHeatFlowTemperatureZone1` | `0.0` | float | Heat flow temperature zone 1. |
|
|
@@ -341,7 +341,7 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
|
|
|
341
341
|
| | `Set` | `HideRoomTemperature` | `true`, `false` | boolean | Hide room temperature. |
|
|
342
342
|
| | `Set` | `HideSupplyTemperature` | `true`, `false` | boolean | Hide supply temperature. |
|
|
343
343
|
| | `Set` | `HideOutdoorTemperature` | `true`, `false` | boolean | Hide outdoor temperature. |
|
|
344
|
-
| | `Set` | `OperationMode` | `1 - Heat`, `3 - Cool`, `7 - Fan`, `8 - Auto` | integer |
|
|
344
|
+
| | `Set` | `OperationMode` | `1 - Heat`, `3 - Cool`, `7 - Fan`, `8 - Auto` | integer | Operating mode. |
|
|
345
345
|
| | `Set` | `VentilationMode` | `0 - Lossnay`, `1 - Bypass`, `2 - Auto` | integer | Ventilation mode. |
|
|
346
346
|
| | `Set` | `SetFanSpeed` | `0 - Auto`, `1`, `2`, `3`, `4` | integer | Fan speed. |
|
|
347
347
|
| | `Set` | `SetTemperature` | `0.0` | float | Room temperature. |
|
package/config.schema.json
CHANGED
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
"required": true
|
|
206
206
|
},
|
|
207
207
|
"ataDisplayMode": {
|
|
208
|
-
"title": "Control
|
|
208
|
+
"title": "Control",
|
|
209
209
|
"type": "integer",
|
|
210
210
|
"minimum": 0,
|
|
211
211
|
"maximum": 1,
|
|
@@ -224,32 +224,11 @@
|
|
|
224
224
|
]
|
|
225
225
|
}
|
|
226
226
|
],
|
|
227
|
-
"description": "Select
|
|
227
|
+
"description": "Select device control mode displayed in HomeKit app.",
|
|
228
228
|
"required": true
|
|
229
229
|
},
|
|
230
|
-
"ataTemperatureSensor": {
|
|
231
|
-
"title": "Temperature Sensor Room",
|
|
232
|
-
"type": "boolean",
|
|
233
|
-
"default": false,
|
|
234
|
-
"description": "This enable extra room temperature sensor to use with automations in HomeKit app.",
|
|
235
|
-
"required": false
|
|
236
|
-
},
|
|
237
|
-
"ataTemperatureSensorOutdoor": {
|
|
238
|
-
"title": "Temperature Sensor Outdoor",
|
|
239
|
-
"type": "boolean",
|
|
240
|
-
"default": false,
|
|
241
|
-
"description": "This enable extra outdoor temperature sensor to use with automations in HomeKit app.",
|
|
242
|
-
"required": false
|
|
243
|
-
},
|
|
244
|
-
"ataPresets": {
|
|
245
|
-
"title": "Presets",
|
|
246
|
-
"type": "boolean",
|
|
247
|
-
"default": false,
|
|
248
|
-
"description": "This enable extra buttons for configured presets and display it in HomeKit app.",
|
|
249
|
-
"required": false
|
|
250
|
-
},
|
|
251
230
|
"ataHeatDryFanMode": {
|
|
252
|
-
"title": "Heat
|
|
231
|
+
"title": "Heat",
|
|
253
232
|
"type": "integer",
|
|
254
233
|
"minimum": 0,
|
|
255
234
|
"maximum": 3,
|
|
@@ -280,11 +259,46 @@
|
|
|
280
259
|
]
|
|
281
260
|
}
|
|
282
261
|
],
|
|
283
|
-
"description": "
|
|
262
|
+
"description": "Select the operating mode for Heat, if this mode is not supported, it will be disabled.",
|
|
263
|
+
"required": true
|
|
264
|
+
},
|
|
265
|
+
"ataCoolDryFanMode": {
|
|
266
|
+
"title": "Cool",
|
|
267
|
+
"type": "integer",
|
|
268
|
+
"minimum": 0,
|
|
269
|
+
"maximum": 3,
|
|
270
|
+
"default": 1,
|
|
271
|
+
"oneOf": [
|
|
272
|
+
{
|
|
273
|
+
"title": "None/Disabled",
|
|
274
|
+
"enum": [
|
|
275
|
+
0
|
|
276
|
+
]
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"title": "Cool",
|
|
280
|
+
"enum": [
|
|
281
|
+
1
|
|
282
|
+
]
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"title": "Dry",
|
|
286
|
+
"enum": [
|
|
287
|
+
2
|
|
288
|
+
]
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"title": "Fan",
|
|
292
|
+
"enum": [
|
|
293
|
+
3
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
],
|
|
297
|
+
"description": "Select the operating mode for Cool, if this mode is not supported, it will be disabled.",
|
|
284
298
|
"required": true
|
|
285
299
|
},
|
|
286
300
|
"ataAutoDryFanMode": {
|
|
287
|
-
"title": "Auto
|
|
301
|
+
"title": "Auto",
|
|
288
302
|
"type": "integer",
|
|
289
303
|
"minimum": 0,
|
|
290
304
|
"maximum": 3,
|
|
@@ -315,9 +329,30 @@
|
|
|
315
329
|
]
|
|
316
330
|
}
|
|
317
331
|
],
|
|
318
|
-
"description": "
|
|
332
|
+
"description": "Select the operating mode for Auto, if this mode is not supported, it will be disabled.",
|
|
319
333
|
"required": true
|
|
320
334
|
},
|
|
335
|
+
"ataPresets": {
|
|
336
|
+
"title": "Presets",
|
|
337
|
+
"type": "boolean",
|
|
338
|
+
"default": false,
|
|
339
|
+
"description": "This enable extra buttons for configured presets and display it in HomeKit app.",
|
|
340
|
+
"required": false
|
|
341
|
+
},
|
|
342
|
+
"ataTemperatureSensor": {
|
|
343
|
+
"title": "Room",
|
|
344
|
+
"type": "boolean",
|
|
345
|
+
"default": false,
|
|
346
|
+
"description": "This enable extra room temperature sensor to use with automations in HomeKit app.",
|
|
347
|
+
"required": false
|
|
348
|
+
},
|
|
349
|
+
"ataTemperatureSensorOutdoor": {
|
|
350
|
+
"title": "Outdoor",
|
|
351
|
+
"type": "boolean",
|
|
352
|
+
"default": false,
|
|
353
|
+
"description": "This enable extra outdoor temperature sensor to use with automations in HomeKit app.",
|
|
354
|
+
"required": false
|
|
355
|
+
},
|
|
321
356
|
"ataButtons": {
|
|
322
357
|
"title": "Button / Sensor",
|
|
323
358
|
"type": "array",
|
|
@@ -1395,8 +1430,18 @@
|
|
|
1395
1430
|
"items": [
|
|
1396
1431
|
"accounts[].ataDisplayMode",
|
|
1397
1432
|
"accounts[].ataPresets",
|
|
1398
|
-
|
|
1399
|
-
|
|
1433
|
+
{
|
|
1434
|
+
"key": "accounts[]",
|
|
1435
|
+
"type": "section",
|
|
1436
|
+
"title": "Operating Modes",
|
|
1437
|
+
"expandable": true,
|
|
1438
|
+
"expanded": false,
|
|
1439
|
+
"items": [
|
|
1440
|
+
"accounts[].ataHeatDryFanMode",
|
|
1441
|
+
"accounts[].ataCoolDryFanMode",
|
|
1442
|
+
"accounts[].ataAutoDryFanMode"
|
|
1443
|
+
]
|
|
1444
|
+
},
|
|
1400
1445
|
{
|
|
1401
1446
|
"key": "accounts[]",
|
|
1402
1447
|
"type": "section",
|
package/index.js
CHANGED
|
@@ -17,12 +17,6 @@ class MelCloudPlatform {
|
|
|
17
17
|
this.accessories = [];
|
|
18
18
|
const accountsName = [];
|
|
19
19
|
|
|
20
|
-
//check if the directory exists, if not then create it
|
|
21
|
-
const prefDir = path.join(api.user.storagePath(), 'melcloud');
|
|
22
|
-
if (!fs.existsSync(prefDir)) {
|
|
23
|
-
fs.mkdirSync(prefDir);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
20
|
api.on('didFinishLaunching', () => {
|
|
27
21
|
//loop through accounts
|
|
28
22
|
for (const account of config.accounts) {
|
|
@@ -64,9 +58,21 @@ class MelCloudPlatform {
|
|
|
64
58
|
};
|
|
65
59
|
const debug1 = enableDebugMode ? log.info(`Account: ${accountName}, Config: ${JSON.stringify(debugData, null, 2)}`) : false;
|
|
66
60
|
|
|
67
|
-
//
|
|
61
|
+
//define directory and file paths
|
|
62
|
+
const prefDir = path.join(api.user.storagePath(), 'melcloud');
|
|
68
63
|
const accountInfoFile = `${prefDir}/${accountName}_Account`;
|
|
69
64
|
const buildingsFile = `${prefDir}/${accountName}_Buildings`;
|
|
65
|
+
|
|
66
|
+
//create directory if it doesn't exist
|
|
67
|
+
try {
|
|
68
|
+
//create directory if it doesn't exist
|
|
69
|
+
fs.mkdirSync(prefDir, { recursive: true });
|
|
70
|
+
} catch (error) {
|
|
71
|
+
log.error(`Account: ${accountName}, prepare directory error: ${error.message ?? error}`);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
//set refresh interval
|
|
70
76
|
const refreshInterval = account.refreshInterval * 1000 || 120000;
|
|
71
77
|
const deviceRefreshInterval = account.deviceRefreshInterval * 1000 || 5000;
|
|
72
78
|
|
|
@@ -210,23 +216,5 @@ class MelCloudPlatform {
|
|
|
210
216
|
};
|
|
211
217
|
|
|
212
218
|
module.exports = (api) => {
|
|
213
|
-
const { Service, Characteristic, Units, Formats, Perms } = api.hap;
|
|
214
|
-
//custom characteristics
|
|
215
|
-
class CustomTargetHeaterCoolerState extends Characteristic {
|
|
216
|
-
constructor() {
|
|
217
|
-
super('Mode', '00000033-0000-1000-8000-0026BB765291');
|
|
218
|
-
this.setProps({
|
|
219
|
-
format: Formats.UINT8,
|
|
220
|
-
minValue: 0,
|
|
221
|
-
maxValue: 2,
|
|
222
|
-
minStep: 1,
|
|
223
|
-
validValues: [0, 1, 2],
|
|
224
|
-
perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE]
|
|
225
|
-
});
|
|
226
|
-
this.value = this.getDefaultValue();
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
Characteristic.CustomTargetHeaterCoolerState = CustomTargetHeaterCoolerState;
|
|
230
|
-
|
|
231
219
|
api.registerPlatform(CONSTANTS.PluginName, CONSTANTS.PlatformName, MelCloudPlatform, true);
|
|
232
220
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "2.3.
|
|
4
|
+
"version": "2.3.1-beta.1",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|