forked from basdelfos/homebridge-tuya-web
-
Notifications
You must be signed in to change notification settings - Fork 97
/
config.schema.json
418 lines (418 loc) · 13.5 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
{
"pluginAlias": "TuyaWebPlatform",
"pluginType": "platform",
"singular": true,
"headerDisplay": "Homebridge plugin for devices using the Tuya Web API.",
"footerDisplay": "If you have any suggestions, please open an issue on [GitHub](https://github.com/milo526/homebridge-tuya-web/issues).",
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"required": true,
"default": "TuyaWebPlatform",
"description": "You shouldn't need to change this."
},
"options": {
"title": "",
"type": "object",
"required": true,
"properties": {
"username": {
"title": "Username",
"type": "string",
"required": true
},
"password": {
"title": "Password",
"type": "string",
"required": true
},
"countryCode": {
"title": "Country Code",
"type": "string",
"description": "Your account country code, e.g. 1 for USA, 86 for China, 44 for UK.",
"required": true
},
"platform": {
"title": "Platform",
"type": "string",
"default": "form",
"oneOf": [
{
"title": "Tuya Smart",
"enum": ["tuya"]
},
{
"title": "Smart Life",
"enum": ["smart_life"]
},
{
"title": "Jinvoo Smart",
"enum": ["jinvoo_smart"]
}
],
"required": true
},
"pollingInterval": {
"title": "Polling Interval",
"type": "number",
"description": "The frequency in seconds that the plugin polls the cloud to get device updates. Can be left empty to only fetch on request. Must be 600 or larger",
"required": false,
"minimum": 600
}
}
},
"defaults": {
"title": "Device Settings",
"description": "Here you can configure settings for each of your devices.",
"type": "array",
"items": {
"title": "Overwrite",
"type": "object",
"properties": {
"id": {
"title": "Device name or id",
"type": "string",
"description": "Can be found in your platform app (device info -> virtual ID) and is exposed during plugin boot (use the Tuya ID)",
"required": true
},
"device_type": {
"title": "Device type",
"type": "string",
"default": "form",
"description": "The type that you want the device to be exposed as",
"oneOf": [
{
"title": "Dimmer",
"enum": ["dimmer"]
},
{
"title": "Fan",
"enum": ["fan"]
},
{
"title": "Garage Door",
"enum": ["garage"]
},
{
"title": "Light",
"enum": ["light"]
},
{
"title": "Outlet",
"enum": ["outlet"]
},
{
"title": "Scene",
"enum": ["scene"]
},
{
"title": "Switch",
"enum": ["switch"]
},
{
"title": "Temperature Sensor",
"enum": ["temperature_sensor"]
},
{
"title": "Thermostat",
"enum": ["climate"]
},
{
"title": "Window Cover",
"enum": ["cover"]
},
{
"title": "Window",
"enum": ["window"]
}
],
"required": true
},
"min_temper": {
"title": "Minimal Temperature",
"type": "string",
"pattern": "^-?\\d+(?:\\.[05])?$",
"description": "The minimal temperature that you want to be able to set in HomeKit, this must be in half degree celsius intervals.",
"placeholder": "0.0",
"required": false
},
"max_temper": {
"title": "Maximal Temperature",
"type": "string",
"pattern": "^-?\\d+(?:\\.[05])?$",
"description": "The maximal temperature that you want to be able to set in HomeKit, this must be in half degree celsius intervals.",
"placeholder": "35.0",
"required": false
},
"min_brightness": {
"title": "Minimal Brightness",
"type": "string",
"pattern": "^-?\\d+$",
"description": "The brightness value that Tuya returns when your light is off.",
"required": false
},
"max_brightness": {
"title": "Maximal Brightness",
"type": "string",
"pattern": "^-?\\d+$",
"description": "The brightness value that Tuya returns when your light is at its brightest.",
"required": false
},
"min_kelvin": {
"title": "Minimal Kelvin",
"type": "string",
"pattern": "^-?\\d+$",
"description": "The kelvin value that Tuya returns when your light is at its warmest (most red).",
"required": false
},
"max_kelvin": {
"title": "Maximal Kelvin",
"type": "string",
"pattern": "^-?\\d+$",
"description": "The kelvin value that Tuya returns when your light is at its coolest (most blue).",
"required": false
},
"current_temperature_factor": {
"title": "Temperature Factor",
"type": "string",
"pattern": "^\\d+(?:\\.\\d+)?$",
"description": "Alters the reported temperatures in HomeKit. I.e. if HomeKit reports 250 while the temperature is 250, enter `0.1` here to report the correct temperature. Defaults to 1, no change.",
"placeholder": "I.e. 0.1",
"required": false
},
"target_temperature_factor": {
"title": "Target Temperature Factor",
"type": "string",
"pattern": "^\\d+(?:\\.\\d+)?$",
"description": "Alters the reported target temperatures in HomeKit. Defaults to 1, no change.",
"placeholder": "I.e. 0.1",
"required": false
},
"cover_characteristics": {
"title": "Features",
"type": "array",
"uniqueItems": true,
"items": {
"title": "Feature",
"type": "string",
"enum": ["Stop"]
}
},
"dimmer_characteristics": {
"title": "Features",
"type": "array",
"uniqueItems": true,
"items": {
"title": "Feature",
"type": "string",
"enum": ["Brightness"]
}
},
"fan_characteristics": {
"title": "Features",
"type": "array",
"uniqueItems": true,
"items": {
"title": "Feature",
"type": "string",
"enum": ["Speed"]
}
},
"light_characteristics": {
"title": "Features",
"type": "array",
"uniqueItems": true,
"items": {
"title": "Feature",
"type": "string",
"enum": ["Brightness", "Color", "Color Temperature"]
}
}
}
}
},
"scenes": {
"title": "Expose Tuya scenes to Homekit",
"type": "boolean",
"required": true,
"default": false
},
"scenesWhitelist": {
"title": "Tuya scenes to expose to Homekit",
"type": "array",
"required": false,
"items": {
"title": "Scene name or id",
"type": "string",
"required": true
}
},
"hiddenAccessories": {
"title": "Accessories to hide from Homekit",
"type": "array",
"required": false,
"items": {
"title": "Accessory name or id",
"type": "string",
"required": true
}
}
}
},
"layout": [
{
"type": "flex",
"flex-flow": "row wrap",
"items": [
"options.username",
{
"key": "options.password",
"type": "password"
}
]
},
"options.countryCode",
"options.platform",
{
"type": "fieldset",
"title": "Device Settings",
"expandable": true,
"expanded": false,
"items": [
{
"type": "array",
"items": [
{
"key": "defaults[].id"
},
{
"key": "defaults[].device_type"
},
{
"key": "defaults[].cover_characteristics",
"condition": {
"functionBody": "return (['cover', 'window'].includes(model.defaults[arrayIndices].device_type))"
}
},
{
"key": "defaults[].dimmer_characteristics",
"condition": {
"functionBody": "return (model.defaults[arrayIndices].device_type == 'dimmer')"
}
},
{
"key": "defaults[].fan_characteristics",
"condition": {
"functionBody": "return (model.defaults[arrayIndices].device_type == 'fan')"
}
},
{
"key": "defaults[].light_characteristics",
"condition": {
"functionBody": "return (model.defaults[arrayIndices].device_type == 'light')"
}
},
{
"key": "defaults[].min_temper",
"condition": {
"functionBody": "return (model.defaults[arrayIndices].device_type == 'climate')"
}
},
{
"key": "defaults[].max_temper",
"condition": {
"functionBody": "return (model.defaults[arrayIndices].device_type == 'climate')"
}
},
{
"key": "defaults[].min_brightness",
"condition": {
"functionBody": "return (model.defaults[arrayIndices].light_characteristics?.includes('Brightness') || model.defaults[arrayIndices].dimmer_characteristics?.includes('Brightness'))"
}
},
{
"key": "defaults[].max_brightness",
"condition": {
"functionBody": "return (model.defaults[arrayIndices].light_characteristics?.includes('Brightness') || model.defaults[arrayIndices].dimmer_characteristics?.includes('Brightness'))"
}
},
{
"key": "defaults[].min_kelvin",
"condition": {
"functionBody": "return (model.defaults[arrayIndices].light_characteristics?.includes('Color Temperature'))"
}
},
{
"key": "defaults[].max_kelvin",
"condition": {
"functionBody": "return (model.defaults[arrayIndices].light_characteristics?.includes('Color Temperature'))"
}
},
{
"key": "defaults[].current_temperature_factor",
"condition": {
"functionBody": "return (['climate', 'temperature_sensor'].includes(model.defaults[arrayIndices].device_type))"
}
},
{
"key": "defaults[].target_temperature_factor",
"condition": {
"functionBody": "return (model.defaults[arrayIndices].device_type == 'climate')"
}
}
]
}
]
},
{
"type": "fieldset",
"title": "Optional Settings",
"expandable": true,
"expanded": false,
"items": ["options.pollingInterval"]
},
{
"type": "fieldset",
"title": "Advanced",
"expandable": true,
"expanded": false,
"items": [
{
"title": "Hidden accessories",
"type": "array",
"description": "Enter the identifiers of accessories that you wish not to expose to HomeKit.",
"items": [
{
"key": "hiddenAccessories[]",
"required": true
}
]
},
{
"type": "fieldset",
"title": "Scenes",
"items": [
"scenes",
{
"title": "Whitelisted scene",
"type": "array",
"description": "Enter the scenes that you wish to expose to Homekit, when left empty <b>all</b> scenes will be exposed.",
"condition": {
"functionBody": "return (model.scenes)"
},
"items": [
{
"key": "scenesWhitelist[]",
"required": true
}
]
}
]
}
]
}
]
}