generated from homebridge/homebridge-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.schema.json
260 lines (259 loc) · 10.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
{
"pluginAlias": "HomebridgeVirtualSwitches",
"pluginType": "platform",
"singular": true,
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"required": true,
"default": "HomebridgeVirtualSwitches",
"description": "This name is shown in as child bridge name and in logs."
},
"platform": {
"type": "string",
"title": "Platform Name",
"default": "HomebridgeVirtualSwitches",
"description": "Do not change Platform name!"
},
"devices": {
"type": "array",
"title": "Virtual Switches",
"items": {
"type": "object",
"title": "Switch Configuration",
"properties": {
"Name": {
"type": "string",
"title": "Switch Name",
"required": true
},
"NormallyClosed": {
"type": "boolean",
"title": "Normally Closed switch",
"default": false,
"description": "Sets switch is ON (closed) by default and OFF (open) when triggered."
},
"SwitchStayOn": {
"type": "boolean",
"title": "Stateful",
"default": false,
"description": "When selected the switch will remain in triggered state until switched off manually or by automation (i.e., it is not be controlled by a timer)."
},
"Time": {
"type": "integer",
"title": "Timer (in ms)",
"default": 0,
"description": "Time (in milliseconds) the switch stays triggered.",
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].SwitchStayOn === false && model.devices[arrayIndices[0]].UseCustomTime === false;"
}
},
"UseCustomTime": {
"type": "boolean",
"title": "Set timer time in days/hours/minutes/seconds instead of milliseconds.",
"default": false,
"description": "Total time cannot exceed ~47 days (46 days + 24 hours + 60 minutes + 60 seconds",
"condition": { "functionBody": "return model.devices[arrayIndices[0]].SwitchStayOn === false;" }
},
"TimeDays": {
"type": "integer",
"title": "Days",
"default": 0,
"minimum": 0,
"maximum": 47,
"condition": { "functionBody": "return model.devices[arrayIndices[0]].SwitchStayOn === false && model.devices[arrayIndices[0]].UseCustomTime === true;" }
},
"TimeHours": {
"type": "integer",
"title": "Hours",
"default": 0,
"minimum": 0,
"maximum": 24,
"condition": { "functionBody": "return model.devices[arrayIndices[0]].SwitchStayOn === false && model.devices[arrayIndices[0]].UseCustomTime === true;" }
},
"TimeMinutes": {
"type": "integer",
"title": "Minutes",
"default": 0,
"minimum": 0,
"maximum": 60,
"condition": { "functionBody": "return model.devices[arrayIndices[0]].SwitchStayOn === false && model.devices[arrayIndices[0]].UseCustomTime === true;" }
},
"TimeSeconds": {
"type": "integer",
"title": "Seconds",
"default": 0,
"minimum": 0,
"maximum": 60,
"condition": { "functionBody": "return model.devices[arrayIndices[0]].SwitchStayOn === false && model.devices[arrayIndices[0]].UseCustomTime === true;" }
},
"TimerPersistent": {
"type": "boolean",
"title": "Persistent Timer",
"default": false,
"description": "Keeps timer active through Homebridge restarts.",
"condition": { "functionBody": "return model.devices[arrayIndices[0]].SwitchStayOn === false;" }
},
"OneShotTimer": {
"title": "One Shot Timer",
"type": "boolean",
"required": false,
"default": false,
"description": "Prevent timer from restarting when the switch is triggered while the timer is still running",
"condition": { "functionBody": "return model.devices[arrayIndices[0]].SwitchStayOn === false;" }
},
"UseLogFile": {
"type": "boolean",
"title": "Trigger switch by keywords appearing in the Homebridge Log File",
"default": false,
"description": "Trigger switch based on keywords / keyphrases in the Homebridge log."
},
"LogFilePath": {
"type": "string",
"title": "Log File Path",
"default": "/var/lib/homebridge/homebridge.log",
"description": "Full path to the log file.",
"condition": { "functionBody": "return model.devices[arrayIndices[0]].UseLogFile === true;" }
},
"Keywords": {
"type": "array",
"title": "Keywords",
"description": "Keywords / Keyphrases that will trigger the switch when they appear in the log file (case insensitive).",
"condition": { "functionBody": "return model.devices && model.devices[arrayIndices[0]] && model.devices[arrayIndices[0]].UseLogFile === true;" },
"items": {
"type": "string",
"title": "Keyword"
},
"default": [""],
"uniqueItems": true
},
"EnableStartupDelay": {
"type": "boolean",
"title": "Delay switch start",
"default": false,
"description": "Delay switch activation after Homebridge restarts.For log monitoring switches only!"
},
"UseCustomStartupDelay": {
"type": "boolean",
"title": "Set the switch start up delay in days, hours, minutes and seconds instead of milliseconds.",
"default": false,
"description": "Total time cannot exceed ~47 days (46 days + 24 hours + 60 minutes + 60 seconds).",
"condition": { "functionBody": "return model.devices[arrayIndices[0]].EnableStartupDelay === true;" }
},
"StartupDelay": {
"type": "integer",
"title": "Startup Delay (in ms)",
"description": "Startup delay in milliseconds.",
"condition": {
"functionBody": "return model.devices[arrayIndices[0]].EnableStartupDelay === true && model.devices[arrayIndices[0]].UseCustomStartupDelay === false;"
}
},
"StartupDelayDays": {
"type": "integer",
"title": "Startup Delay Days",
"default": 0,
"minimum": 0,
"maximum": 46,
"condition": { "functionBody": "return model.devices[arrayIndices[0]].EnableStartupDelay === true && model.devices[arrayIndices[0]].UseCustomStartupDelay === true;" }
},
"StartupDelayHours": {
"type": "integer",
"title": "Startup Delay Hours",
"default": 0,
"minimum": 0,
"maximum": 24,
"condition": { "functionBody": "return model.devices[arrayIndices[0]].EnableStartupDelay === true && model.devices[arrayIndices[0]].UseCustomStartupDelay === true;" }
},
"StartupDelayMinutes": {
"type": "integer",
"title": "Startup Delay Minutes",
"default": 0,
"minimum": 0,
"maximum": 60,
"condition": { "functionBody": "return model.devices[arrayIndices[0]].EnableStartupDelay === true && model.devices[arrayIndices[0]].UseCustomStartupDelay === true;" }
},
"StartupDelaySeconds": {
"type": "integer",
"title": "Startup Delay Seconds",
"default": 0,
"minimum": 0,
"maximum": 60,
"condition": { "functionBody": "return model.devices[arrayIndices[0]].EnableStartupDelay === true && model.devices[arrayIndices[0]].UseCustomStartupDelay === true;" }
},
"RememberState": {
"type": "boolean",
"title": "Restart the switch in its last known state",
"default": false,
"description": "Retain last state after restart (non-log-monitoring stateful switches only).",
"condition": { "functionBody": "return model.devices[arrayIndices[0]].SwitchStayOn === true && model.devices[arrayIndices[0]].UseLogFile === false;" }
}
},
"required": ["Name"]
}
}
},
"required": ["name", "platform", "devices"]
},
"layout": [
{
"type": "array",
"key": "devices",
"title": "Devices",
"buttonText": "Add Another Switch",
"expandable": true,
"expanded": true,
"items": [
{
"type": "fieldset",
"items": [
"devices[].Name",
"devices[].SwitchStayOn",
"devices[].NormallyClosed",
"devices[].Time",
"devices[].UseCustomTime",
"devices[].TimeDays",
"devices[].TimeHours",
"devices[].TimeMinutes",
"devices[].TimeSeconds",
"devices[].OneShotTimer",
"devices[].TimerPersistent",
"devices[].UseLogFile",
"devices[].LogFilePath",
{
"key": "devices[].Keywords",
"type": "array",
"title": "Keywords",
"buttonText": "Add Keyword",
"startEmpty": false,
"items": [
{
"key": "devices[].Keywords[]",
"title": "Keyword",
"type": "string"
}
]
},
"devices[].EnableStartupDelay",
"devices[].UseCustomStartupDelay",
"devices[].StartupDelay",
"devices[].StartupDelayDays",
"devices[].StartupDelayHours",
"devices[].StartupDelayMinutes",
"devices[].StartupDelaySeconds",
"devices[].RememberState"
]
}
]
},
{
"type": "fieldset",
"title": "Plugin config",
"expandable": true,
"expanded": false,
"items": ["name"]
}
]
}