-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
config.schema.json
868 lines (868 loc) · 31.8 KB
/
config.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
{
"pluginAlias": "miot",
"pluginType": "platform",
"singular": true,
"customUi": true,
"headerDisplay": "Homebridge plugin for devices using the miot protocol",
"footerDisplay": "For a detailed description, see the [README](https://github.com/merdok/homebridge-miot#platform-configuration-fields)",
"schema": {
"type": "object",
"properties": {
"micloud": {
"title": "Global MiCloud connection",
"type": "object",
"properties": {
"username": {
"title": "Username",
"type": "string"
},
"password": {
"title": "Password",
"type": "string"
},
"country": {
"title": "Country",
"type": "string",
"enum": [
"cn",
"de",
"sg",
"tw",
"us",
"ru",
"in",
"i2"
]
},
"forceMiCloud": {
"title": "Force MiCloud connection",
"description": "Use MiCloud instead of local connection even for devices that do not require it.",
"type": "boolean",
"required": false
},
"timeout": {
"title": "Request timeout",
"description": "Request timeout in milliseconds. Has to be less or equal to the pollingInterval.",
"type": "number",
"required": false
}
},
"required": false,
"dependencies": {
"username": [
"country"
],
"password": [
"country"
]
}
},
"devices": {
"title": "Devices",
"type": "array",
"required": true,
"items": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"description": "The name of the device.",
"type": "string",
"default": "Miot device",
"minLength": 1,
"required": true
},
"ip": {
"title": "Device ip address",
"description": "The ip address of the device.",
"type": "string",
"format": "ipv4",
"required": true
},
"token": {
"title": "Device token",
"description": "The token of the device.",
"type": "string",
"required": true
},
"deviceId": {
"title": "Device id",
"description": "The unique device id of the device. Required for MiCloud devices.",
"type": "string",
"required": false
},
"model": {
"title": "The device model",
"description": "The model of the device. Should only be specified when certain about the device model. If specified then the accessory will be created instantly without the need to first discover and identify the device.",
"type": "string",
"required": false
},
"prefsDir": {
"title": "Prefs directory",
"description": "The location where to store device information. Default is: ~/.homebridge/.xiaomiMiot",
"type": "string",
"required": false
},
"pollingInterval": {
"title": "Background polling interval",
"description": "How often to check the status of the device in seconds.",
"type": "number",
"default": 10,
"required": false
},
"propertyChunkSize": {
"title": "Property sync chunk size",
"description": "Size of a property chunk when syncing properties with the device. A lower value might reduce the load on the device. Range 1-14.",
"type": "number",
"required": false
},
"deepDebugLog": {
"title": "Enable deep debug log",
"description": "Enables additional more detailed debug log. Useful when trying to figure out issues with the plugin.",
"type": "boolean",
"default": false
},
"silentLog": {
"title": "Enable silent log",
"description": "When enabled all log output will only appear in debug mode.",
"type": "boolean",
"default": false
},
"deviceEnabled": {
"title": "Device enabled",
"description": "Disabling the device will not initiate polling. Useful when a device is longer offline and it should not automatically reconnect.",
"type": "boolean",
"default": true
},
"micloud": {
"title": "MiCloud connection",
"type": "object",
"properties": {
"username": {
"title": "Username",
"type": "string"
},
"password": {
"title": "Password",
"type": "string"
},
"country": {
"title": "Country",
"type": "string",
"enum": [
"cn",
"de",
"sg",
"tw",
"us",
"ru",
"in",
"i2"
]
},
"forceMiCloud": {
"title": "Force MiCloud connection",
"description": "Use MiCloud instead of local connection even for devices that do not require it.",
"type": "boolean",
"required": false
},
"timeout": {
"title": "Request timeout",
"description": "Request timeout in milliseconds. Has to be less or equal to the pollingInterval.",
"type": "number",
"required": false
}
},
"required": false,
"dependencies": {
"username": [
"country"
],
"password": [
"country"
]
}
},
"customAccessory": {
"title": "Use custom accessory",
"description": "Creates a custom empty accessory for the device which can be manually populated with services. Requires actionButtons, propertyControl or propertyMonitor to be set.",
"type": "boolean",
"required": false
},
"onlyMainService": {
"title": "Show only the main accessory service",
"description": "Only the main accessory service will be created without any additional services. Useful when wanting to have a clean layout. actionButtons, propertyControl or propertyMonitor can be used to manually add services.",
"type": "boolean",
"required": false
},
"buzzerControl": {
"title": "Buzzer control service",
"description": "Whether to show buzzer control buttons.",
"type": "boolean",
"default": true,
"required": false
},
"ledControl": {
"title": "Led control service",
"description": "Whether to show led control buttons.",
"type": "boolean",
"default": true,
"required": false
},
"childLockControl": {
"title": "Child lock control service",
"description": "Whether the child lock control service is enabled.",
"type": "boolean",
"default": true,
"required": false
},
"modeControl": {
"title": "Mode control service",
"description": "Show mode switches which allow to change the device mode.",
"type": "boolean",
"default": true,
"required": false
},
"suppressAutoServiceCreation": {
"title": "Suppress auto service creation",
"description": "Suppress auto creation of some sensor services.",
"type": "array",
"items": {
"type": "string",
"uniqueItems": true,
"enum": [
"temperature",
"relativeHumidity",
"illumination"
]
},
"required": false
},
"actionButtons": {
"title": "Action buttons",
"type": "array",
"items": {
"type": "object",
"properties": {
"action": {
"title": "action",
"type": "string",
"required": true
},
"name": {
"title": "name",
"type": "string",
"required": false
},
"params": {
"title": "params",
"type": "array",
"items": {
"type": "string"
},
"required": false
}
}
},
"required": false
},
"methodButtons": {
"title": "Method buttons",
"type": "array",
"items": {
"type": "object",
"properties": {
"method": {
"title": "method",
"type": "string",
"required": true
},
"name": {
"title": "name",
"type": "string",
"required": false
},
"params": {
"title": "params",
"type": "array",
"items": {
"type": "string"
},
"required": false
}
}
},
"required": false
},
"propertyControl": {
"title": "Property control",
"type": "array",
"items": {
"type": "object",
"properties": {
"property": {
"title": "property",
"type": "string",
"required": true
},
"name": {
"title": "name",
"type": "string",
"required": false
},
"value": {
"title": "value",
"type": "string",
"required": false
},
"linkedProperty": {
"title": "linked property",
"type": "string",
"required": false
},
"linkedPropertyValue": {
"title": "linked property value",
"type": "string",
"required": false
},
"config": {
"title": "config",
"type": "object",
"required": false
}
}
},
"required": false
},
"propertyMonitor": {
"title": "Property monitor",
"type": "array",
"items": {
"type": "object",
"properties": {
"property": {
"title": "property",
"type": "string",
"required": true
},
"name": {
"title": "name",
"type": "string",
"required": false
},
"value": {
"title": "value",
"type": "string",
"required": false
},
"valueOperator": {
"title": "value operator",
"type": "string",
"enum": [
"equal",
"less",
"greater",
"lessOrEqual",
"greaterOrEqual"
],
"required": false
},
"linkedProperty": {
"title": "linked property",
"type": "string",
"required": false
},
"linkedPropertyValue": {
"title": "linked property value",
"type": "string",
"required": false
}
}
},
"required": false
},
"swingControl": {
"title": "Swing control service",
"description": "Show a switch to quickly enable/disable horizontal and/or vertical swing mode.",
"type": "boolean",
"required": false
},
"moveControl": {
"title": "Move control service",
"description": "Whether to show switches which allows to move the fan left, right, up or down.",
"type": "boolean",
"required": false
},
"fanLevelControl": {
"title": "Fan level service",
"description": "Show fan level switches which allow to change the fan level.",
"type": "boolean",
"required": false
},
"ioniserControl": {
"title": "Ioniser control service",
"description": "Show a switch which allows to quickly enable/disable the ioniser on your fan.",
"type": "boolean",
"required": false
},
"offDelayControl": {
"title": "Off delay control service",
"description": "Show a slider (light bulb) to control the auto shutdown timer.",
"type": "boolean",
"required": false
},
"horizontalAngleButtons": {
"title": "Horizontal angle buttons",
"description": "Allows to create buttons that can switch between horizontal oscillation angles.",
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 360
}
},
"verticalAngleButtons": {
"title": "Vertical angle buttons",
"description": "Allows to create buttons that can switch between vertical oscillation angles.",
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 360
}
},
"heatLevelControl": {
"title": "Heat level service",
"description": "Show heat level switches which allow to change the heat level.",
"type": "boolean",
"required": false
},
"screenControl": {
"title": "Screen control service",
"description": "Whether to show led control buttons.",
"type": "boolean",
"required": false
},
"motorControl": {
"title": "Motor control service",
"description": "Show motor control switches which allow to control the curtains.",
"type": "boolean",
"required": false
},
"heaterControl": {
"title": "Heater control service",
"description": "Show a switch which allows to quickly enable the heater.",
"type": "boolean",
"required": false
},
"pm25Breakpoints": {
"title": "Pm25 breakpoints",
"description": "Define a custom array of pm25 breakpoints. Provide an array with exactly 4 unique numbers.",
"type": "array",
"items": {
"type": "integer",
"minItems": 4,
"maxItems": 4,
"uniqueItems": true
},
"required": false
},
"co2AbnormalThreshold": {
"title": "Carbon Dioxide abnormal threshold",
"description": "Define a custom carbon dioxide sensor abnormal threshold.",
"type": "integer",
"required": false
},
"showTemperature": {
"title": "Show temperature",
"description": "Show temperature if the outlet supports temperature reporting.",
"type": "boolean",
"required": false
},
"foodAmount": {
"title": "Food amount",
"description": "The amount of food to dispense.",
"type": "integer",
"minimum": 1,
"required": false
}
}
}
}
}
},
"layout": [{
"type": "fieldset",
"title": "Global MiCloud Settings",
"description": "Configure global MiCloud connection details used for all devices.",
"expandable": true,
"expanded": false,
"items": [
"micloud.username",
"micloud.password",
"micloud.country",
"micloud.forceMiCloud",
"micloud.timeout"
]
},
{
"key": "devices",
"type": "tabarray",
"title": "{{ value.name || 'new device' }}",
"items": [
"devices[].name",
"devices[].ip",
"devices[].token",
"devices[].deviceId",
{
"key": "devices[]",
"type": "fieldset",
"title": "{{ value.title }}",
"items": [{
"type": "fieldset",
"title": "Advanced Settings",
"description": "Configure advanced plugin settings.",
"expandable": true,
"expanded": false,
"items": [
"devices[].model",
"devices[].prefsDir",
"devices[].pollingInterval",
"devices[].propertyChunkSize",
"devices[].deepDebugLog",
"devices[].silentLog",
"devices[].deviceEnabled"
]
},
{
"type": "fieldset",
"title": "MiCloud Settings",
"description": "Configure MiCloud connection details for this device.",
"expandable": true,
"expanded": false,
"items": [
"devices[].micloud.username",
"devices[].micloud.password",
"devices[].micloud.country",
"devices[].micloud.forceMiCloud",
"devices[].micloud.timeout"
]
},
{
"type": "fieldset",
"title": "General device settings",
"description": "Configure general device settings.",
"expandable": true,
"expanded": false,
"items": [
"devices[].customAccessory",
"devices[].onlyMainService",
"devices[].ledControl",
"devices[].buzzerControl",
"devices[].childLockControl",
"devices[].modeControl",
"devices[].suppressAutoServiceCreation",
{
"key": "devices[].actionButtons",
"description": "Configure action buttons. For details check README.",
"buttonText": "Add action button",
"type": "fieldset",
"expandable": true,
"expanded": false,
"items": [
"devices[].actionButtons[].action",
"devices[].actionButtons[].name",
{
"key": "devices[].actionButtons[].params",
"type": "array",
"buttonText": "Add param",
"items": {
"type": "string"
}
}
]
},
{
"key": "devices[].methodButtons",
"description": "Configure method buttons. For details check README.",
"buttonText": "Add method button",
"type": "fieldset",
"expandable": true,
"expanded": false,
"items": [
"devices[].methodButtons[].method",
"devices[].methodButtons[].name",
{
"key": "devices[].methodButtons[].params",
"type": "array",
"buttonText": "Add param",
"items": {
"type": "string"
}
}
]
},
{
"key": "devices[].propertyControl",
"description": "Configure property control. For details check README.",
"buttonText": "Add property control",
"type": "fieldset",
"expandable": true,
"expanded": false,
"items": [
"devices[].propertyControl[].property",
"devices[].propertyControl[].name",
"devices[].propertyControl[].value",
"devices[].propertyControl[].linkedProperty",
"devices[].propertyControl[].linkedPropertyValue",
"devices[].propertyControl[].config"
]
},
{
"key": "devices[].propertyMonitor",
"description": "Configure property monitor. For details check README.",
"buttonText": "Add property monitor",
"type": "fieldset",
"expandable": true,
"expanded": false,
"items": [
"devices[].propertyMonitor[].property",
"devices[].propertyMonitor[].name",
"devices[].propertyMonitor[].value",
"devices[].propertyMonitor[].valueOperator",
"devices[].propertyMonitor[].linkedProperty",
"devices[].propertyMonitor[].linkedPropertyValue"
]
}
]
},
{
"type": "fieldset",
"title": "Fan specific settings",
"description": "Configure fan specific device settings.",
"expandable": true,
"expanded": false,
"items": [
"devices[].swingControl",
"devices[].moveControl",
"devices[].fanLevelControl",
"devices[].ioniserControl",
"devices[].offDelayControl",
{
"key": "devices[].horizontalAngleButtons",
"type": "array",
"items": {
"title": "Angle",
"type": "integer"
}
},
{
"key": "devices[].verticalAngleButtons",
"type": "array",
"items": {
"title": "Angle",
"type": "integer"
}
}
],
"condition": {
"functionBody": "var device = model.devices[arrayIndices]; return !device.model || device.model.match(/^(zhimi|dmaker|air)\\.fan\\.([^.]+)$/);"
}
},
{
"type": "fieldset",
"title": "Ceiling Fan specific settings",
"description": "Configure ceiling fan specific device settings.",
"expandable": true,
"expanded": false,
"items": [
"devices[].fanLevelControl",
"devices[].offDelayControl"
],
"condition": {
"functionBody": "var device = model.devices[arrayIndices]; return !device.model || device.model.match(/^(opple|yeelink)\\.light\\.(fan|fanlight)([^.]+)$/);"
}
},
{
"type": "fieldset",
"title": "Heater specific settings",
"description": "Configure heater specific device settings.",
"expandable": true,
"expanded": false,
"items": [
"devices[].offDelayControl"
],
"condition": {
"functionBody": "var device = model.devices[arrayIndices]; return !device.model || device.model.match(/^(zhimi|leshow|isleep)\\.(heater|blanket)\\.([^.]+)$/);"
}
},
{
"type": "fieldset",
"title": "Humidifier specific settings",
"description": "Configure humidifier specific device settings.",
"expandable": true,
"expanded": false,
"items": [
"devices[].screenControl",
"devices[].fanLevelControl"
],
"condition": {
"functionBody": "var device = model.devices[arrayIndices]; return !device.model || device.model.match(/^(zhimi|deerma|leshow)\\.humidifier\\.([^.]+)$/);"
}
},
{
"type": "fieldset",
"title": "Dehumidifier specific settings",
"description": "Configure dehumidifier specific device settings.",
"expandable": true,
"expanded": false,
"items": [
"devices[].fanLevelControl"
],
"condition": {
"functionBody": "var device = model.devices[arrayIndices]; return !device.model || device.model.match(/^nwt\\.derh\\.([^.]+)$/);"
}
},
{
"type": "fieldset",
"title": "Air Purifier specific settings",
"description": "Configure air purifier specific device settings.",
"expandable": true,
"expanded": false,
"items": [
"devices[].screenControl",
"devices[].fanLevelControl",
"devices[].ioniserControl",
{
"key": "devices[].pm25Breakpoints",
"type": "array",
"items": {
"type": "integer",
"maxItems": 4,
"uniqueItems": true
}
}
],
"condition": {
"functionBody": "var device = model.devices[arrayIndices]; return !device.model || device.model.match(/^(hanyi|zhimi)\\.(airpurifier|airp)\\.([^.]+)$/);"
}
},
{
"type": "fieldset",
"title": "Curtain specific settings",
"description": "Configure curtain specific device settings.",
"expandable": true,
"expanded": false,
"items": [
"devices[].motorControl"
],
"condition": {
"functionBody": "var device = model.devices[arrayIndices]; return !device.model || device.model.match(/^(dooya|leshi|lumi)\\.curtain\\.([^.]+)$/);"
}
},
{
"type": "fieldset",
"title": "Fresh Air System specific settings",
"description": "Configure fresh air system specific device settings.",
"expandable": true,
"expanded": false,
"items": [
"devices[].fanLevelControl",
"devices[].heaterControl",
"devices[].heatLevelControl",
{
"key": "devices[].pm25Breakpoints",
"type": "array",
"items": {
"type": "integer",
"maxItems": 4,
"uniqueItems": true
}
},
"devices[].co2AbnormalThreshold"
],
"condition": {
"functionBody": "var device = model.devices[arrayIndices]; return !device.model || device.model.match(/^(dmaker|zhimi)\\.airfresh\\.([^.]+)$/);"
}
},
{
"type": "fieldset",
"title": "Outlet specific settings",
"description": "Configure outlet specific device settings.",
"expandable": true,
"expanded": false,
"items": [
"devices[].offDelayControl",
"devices[].showTemperature"
],
"condition": {
"functionBody": "var device = model.devices[arrayIndices]; return !device.model || device.model.match(/^(chuangmi|cuco|zimi|qmi)\\.(plug|powerstrip)\\.([^.]+)$/);"
}
},
{
"type": "fieldset",
"title": "Air Conditioner specific settings",
"description": "Configure air conditioner specific device settings.",
"expandable": true,
"expanded": false,
"items": [
"devices[].swingControl",
"devices[].fanLevelControl"
],
"condition": {
"functionBody": "var device = model.devices[arrayIndices]; return !device.model || device.model.match(/^lumi\\.(acpartner|aircondition)\\.([^.]+)$/);"
}
},
{
"type": "fieldset",
"title": "Airer specific settings",
"description": "Configure airer specific device settings.",
"expandable": true,
"expanded": false,
"items": [
"devices[].motorControl"
],
"condition": {
"functionBody": "var device = model.devices[arrayIndices]; return !device.model || device.model.match(/^hyd\\.airer\\.([^.]+)$/);"
}
},
{
"type": "fieldset",
"title": "Air Monitor specific settings",
"description": "Configure air monitor specific device settings.",
"expandable": true,
"expanded": false,
"items": [{
"key": "devices[].pm25Breakpoints",
"type": "array",
"items": {
"type": "integer",
"maxItems": 4,
"uniqueItems": true
}
},
"devices[].co2AbnormalThreshold"
],
"condition": {
"functionBody": "var device = model.devices[arrayIndices]; return !device.model || device.model.match(/^(cgllc|zhimi)\\.(airm|airmonitor)\\.([^.]+)$/);"
}
},
{
"type": "fieldset",
"title": "Pet Feeder specific settings",
"description": "Configure pet feeder specific device settings.",
"expandable": true,
"expanded": false,
"items": [
"devices[].foodAmount"
],
"condition": {
"functionBody": "var device = model.devices[arrayIndices]; return !device.model || device.model.match(/^([^.]+).feeder.([^.]+)$/);"
}
}
]
}
]
}
]
}