-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.schema.json
308 lines (308 loc) · 19.7 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
{
"pluginAlias": "GrumpTechHomebridgeTimeTrigger",
"pluginType": "platform",
"singular": true,
"headerDisplay": "This plugin is provided by [GrumpTech](https://github.com/pricemi115/)",
"footerDisplay": "Be kind.....to everyone",
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Plugin Name",
"type": "string",
"default": "GrumpTech Homebridge Time Trigger",
"condition": {
"functionBody": "return false;"
}
},
"settings": {
"title": "Settings",
"type": "object",
"properties": {
"triggers": {
"title": "Time Triggers",
"description": "List of time-based triggers.",
"type": "array",
"items": {
"type": "object",
"properties": {
"trigger_identifier": {
"title": "Identifier",
"description": "Unique identifier for the trigger.</br><small>Controls the mapping of the Homekit accessory to this trigger.</br>and serves as the default name for the accessory and services.</br><i><u>Note</u>: Subsequent triggers with this name will be ignored.</br><u>Warning</u>: Changing the identifier will affect existing Homekit automations using this trigger.</i></small>",
"type": "string",
"minLength": 1,
"default": "Trigger",
"pattern": "(?!^$)([^\\s])",
"required": true
},
"trigger_type": {
"title": "Trigger Type",
"description": "Type of trigger",
"type": "number",
"default": 0,
"oneOf": [
{ "title": "Timed", "enum": [0] },
{ "title": "Scheduled", "enum": [1] }
],
"required": true
},
"timeout": {
"title": "Timeout Window",
"description": "Trigger timeout window",
"type": "object",
"required": true,
"properties": {
"nominal": {
"title": "Trip Interval",
"description": "Nominal trip interval, in milliseconds.",
"type": "number",
"default": 60000,
"minimum": 1,
"required": true
},
"tolerance": {
"title": "Trip Interval Tolerance",
"description": "Tolerance, in milliseconds, for the trip interval.</br><small>Used to randomize the trip event around the specified interval.</small>",
"type": "number",
"default": 0,
"minimum": 0,
"required": true
}
},
"condition": {
"functionBody": "return (model.settings.triggers[arrayIndices] && (model.settings.triggers[arrayIndices].trigger_type === 0));"
}
},
"days": {
"title": "Days",
"description": "Days to trip the trigger",
"type": "number",
"default": 127,
"minimum": 1,
"oneOf": [
{ "title": "Sunday", "enum": [1] },
{ "title": "Monday", "enum": [2] },
{ "title": "Tuesday", "enum": [4] },
{ "title": "Wednesday", "enum": [8] },
{ "title": "Thursday", "enum": [16] },
{ "title": "Friday", "enum": [32] },
{ "title": "Saturday", "enum": [64] },
{ "title": "Weekdays", "enum": [62] },
{ "title": "Weekends", "enum": [65] },
{ "title": "Every day", "enum": [127] }
],
"condition": {
"functionBody": "return (model.settings.triggers[arrayIndices] && (model.settings.triggers[arrayIndices].trigger_type === 1));"
},
"required": true
},
"is_astronomical": {
"title": "Astronomical Trigger",
"description": "Trigger trip time is based on astronomical events",
"type": "boolean",
"default": false,
"required": true,
"condition": {
"functionBody": "return (model.settings.triggers[arrayIndices] && (model.settings.triggers[arrayIndices].trigger_type === 1));"
}
},
"astronomical_type": {
"title": "Astronomical Type",
"description": "Type of astronomical trigger",
"type": "string",
"default": "sunset",
"oneOf": [
{ "title": "Moon Rise", "enum": ["moon_rise"] },
{ "title": "Moon Set", "enum": ["moon_set"] },
{ "title": "Sunrise", "enum": ["sunrise"] },
{ "title": "Sunset", "enum": ["sunset"] },
{ "title": "Twilight End", "enum": ["twilight_end"] },
{ "title": "Twilight Start", "enum": ["twilight_start"] },
{ "title": "Lunar Transit", "enum": ["lunar_transit"] },
{ "title": "Solar Transit", "enum": ["solar_transit"] }
],
"required": true,
"condition": {
"functionBody": "return (model.settings.triggers[arrayIndices] && (model.settings.triggers[arrayIndices].trigger_type === 1) && (model.settings.triggers[arrayIndices].is_astronomical === true));"
}
},
"location": {
"title": "Location",
"description": "Location reference for the astronomical trigger",
"type": "object",
"properties": {
"latitude": {
"title": "Latitude",
"description": "Latitude, expressed in 'north-positive' format",
"type": "number",
"minimum": -90,
"maximum": 90,
"default": 0,
"required": true
},
"longitude": {
"title": "Longitude",
"description": "Longitude, expressed in 'east-positive' format",
"type": "number",
"minimum": -180,
"maximum": 180,
"default": 0,
"required": true
}
},
"condition": {
"functionBody": "return (model.settings.triggers[arrayIndices] && (model.settings.triggers[arrayIndices].trigger_type === 1) && (model.settings.triggers[arrayIndices].is_astronomical === true));"
}
},
"time" : {
"title": "Time settings",
"description": "Time settings for scheduled triggers.",
"type": "object",
"properties": {
"astronomical_offset": {
"title": "Time Offset",
"description": "Offset time for astronomical triggers",
"type": "object",
"properties": {
"type": {
"title": "Offset Type",
"description": "Type of offset",
"type": "string",
"default": "none",
"oneOf": [
{ "title": "After", "enum": ["after"] },
{ "title": "Before", "enum": ["before"] },
{ "title": "None", "enum": ["none"] }
],
"required": true
},
"hour": {
"title": "Hour",
"description": "Hour(s) to offset from the astrological time. (00-05)",
"type": "number",
"minimum": 0,
"maximum": 5,
"default": 0,
"required": true,
"condition": {
"functionBody": "return (model.settings.triggers[arrayIndices] && (model.settings.triggers[arrayIndices].time.astronomical_offset.type !== \"none\"));"
}
},
"minute": {
"title": "Minute",
"description": "Minute(s) to offset from the astrological time. (00-59)",
"type": "number",
"minimum": 0,
"maximum": 59,
"default": 0,
"required": true,
"condition": {
"functionBody": "return (model.settings.triggers[arrayIndices] && (model.settings.triggers[arrayIndices].time.astronomical_offset.type !== \"none\"));"
}
}
},
"condition": {
"functionBody": "return (model.settings.triggers[arrayIndices] && (model.settings.triggers[arrayIndices].trigger_type === 1) && (model.settings.triggers[arrayIndices].is_astronomical === true));"
}
},
"nominal": {
"title": "Trip Time",
"description": "Nominal time of day to trip the trigger. (Default time if this is an astronomical trigger)",
"type": "object",
"properties": {
"hour": {
"title": "Hour",
"description": "Hour to trip the trigger. (00-23)",
"type": "number",
"minimum": 0,
"maximum": 23,
"default": 12,
"required": true
},
"minute": {
"title": "Minute",
"description": "Minute to trip the trigger. (00-59)",
"type": "number",
"minimum": 0,
"maximum": 59,
"default": 0,
"required": true
}
},
"condition": {
"functionBody": "return (model.settings.triggers[arrayIndices] && (model.settings.triggers[arrayIndices].trigger_type === 1));"
}
},
"tolerance": {
"title": "Trip Tolerance",
"description": "Tolerance around the trip time.</br><small>Used to randomize the trip event around the specified trip time.</small>",
"type": "object",
"properties": {
"hour": {
"title": "Hour",
"description": "Hour tolerance around the nominal trip time. (00-23)",
"type": "number",
"minimum": 0,
"maximum": 23,
"default": 0,
"required": true
},
"minute": {
"title": "Minute",
"description": "Minute tolerance around the trip time. (00-59)",
"type": "number",
"minimum": 0,
"maximum": 59,
"default": 0,
"required": true
}
}
}
},
"condition": {
"functionBody": "return (model.settings.triggers[arrayIndices] && (model.settings.triggers[arrayIndices].trigger_type === 1));"
}
},
"duration": {
"title": "Duration Window",
"description": "Trigger trip duration window",
"type": "object",
"required": true,
"properties": {
"nominal": {
"title": "Trip Duration",
"description": "Nominal trip duration, in milliseconds.",
"type": "number",
"default": 250,
"minimum": 10,
"required": true
},
"tolerance": {
"title": "Trip Duration Tolerance",
"description": "Tolerance, in milliseconds, for the trip duration.</br><small>Used to randomize the trip event around the specified interval.</small>",
"type": "number",
"default": 0,
"minimum": 0,
"required": true
}
}
},
"trip_limit": {
"title": "Trip Limit",
"description": "Limit the number of times the trigger will trip. (0=Do not limit)",
"type": "number",
"minimum": 0,
"default": 0,
"required": true
}
}
},
"required": true
}
}
}
}
},
"form": null,
"display": null
}