generated from homebridge/homebridge-plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.schema.json
More file actions
264 lines (264 loc) · 9.62 KB
/
config.schema.json
File metadata and controls
264 lines (264 loc) · 9.62 KB
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
{
"pluginAlias": "BTHomePlatform",
"pluginType": "platform",
"singular": true,
"strictValidation": true,
"schema": {
"type": "object",
"definitions": {
"AirQualityBreakpoints": {
"type": "object",
"expandable": true,
"properties": {
"excellent": {
"title": "Excellent",
"description": "Value below which the air quality is considered excellent (µg/m³)",
"type": "number"
},
"good": {
"title": "Good",
"description": "Value below which the air quality is considered good (µg/m³)",
"type": "number"
},
"fair": {
"title": "Fair",
"description": "Value below which the air quality is considered fair (µg/m³)",
"type": "number"
},
"inferior": {
"title": "Inferior",
"description": "Value below which the air quality is considered inferior (µg/m³)",
"type": "number"
}
}
}
},
"properties": {
"name": {
"title": "Platform Name",
"type": "string",
"required": true,
"default": "BTHomePlatform",
"description": "How this plugin will appear in logs (usually doesn't need to be changed)"
},
"devices": {
"title": "Devices",
"description": "List of devices to connect to and monitor",
"type": "array",
"expandable": true,
"expanded": true,
"items": {
"type": "object",
"properties": {
"name": {
"title": "Device Name",
"description": "Friendly name for this device (will appear in the Home app)",
"type": "string",
"minLength": 1,
"maxLength": 64,
"pattern": "^[a-zA-Z0-9\\s']+$"
},
"mac": {
"title": "MAC Address",
"description": "Bluetooth MAC address of the device (format: XX:XX:XX:XX:XX:XX)",
"type": "string",
"pattern": "^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$",
"required": true
},
"encryptionKey": {
"title": "Encryption Key",
"description": "32-character hex key used to encrypt the advertisement data.<br/>(leave empty if device doesn't use encryption or it's disabled)",
"type": "string",
"pattern": "^$|^[0-9A-Fa-f]{32}$",
"required": false
},
"services": {
"type": "object",
"title": "Capabilities",
"properties": {
"autoDiscovery": {
"title": "Auto-Discovery",
"description": "Automatically detects the supported capabilities of this device based on the data it reports.",
"type": "boolean",
"default": true,
"required": false
},
"enabled": {
"title": "Enabled Services",
"description": "Select how many services of any supported type to create for this device when auto-discovery is disabled.",
"type": "object",
"properties": {
"airQuality": {
"title": "Air Quality Sensors",
"type": "integer",
"minimum": 0,
"placeholder": 0,
"widget": "updown"
},
"battery": {
"title": "Battery Indicators",
"type": "integer",
"minimum": 0,
"placeholder": 0,
"widget": "updown"
},
"button": {
"title": "Stateless Switches",
"type": "integer",
"minimum": 0,
"placeholder": 0,
"widget": "updown"
},
"carbonDioxide": {
"title": "Carbon Dioxide Sensors",
"type": "integer",
"minimum": 0,
"placeholder": 0,
"widget": "updown"
},
"carbonMonoxide": {
"title": "Carbon Monoxide Sensors",
"type": "integer",
"minimum": 0,
"placeholder": 0,
"widget": "updown"
},
"contact": {
"title": "Contact Sensors",
"type": "integer",
"minimum": 0,
"placeholder": 0,
"widget": "updown"
},
"humidity": {
"title": "Humidity Sensors",
"type": "integer",
"minimum": 0,
"placeholder": 0,
"widget": "updown"
},
"illuminance": {
"title": "Light Sensors",
"type": "integer",
"minimum": 0,
"placeholder": 0,
"widget": "updown"
},
"motion": {
"title": "Motion Sensors",
"type": "integer",
"minimum": 0,
"placeholder": 0,
"widget": "updown"
},
"occupancy": {
"title": "Occupancy Sensors",
"type": "integer",
"minimum": 0,
"placeholder": 0,
"widget": "updown"
},
"smoke": {
"title": "Smoke Sensors",
"type": "integer",
"minimum": 0,
"placeholder": 0,
"widget": "updown"
},
"temperature": {
"title": "Temperature Sensors",
"type": "integer",
"minimum": 0,
"placeholder": 0,
"widget": "updown"
}
},
"condition": {
"functionBody": "return model.devices && model.devices[arrayIndices] && model.devices[arrayIndices].services && model.devices[arrayIndices].services.autoDiscovery === false;"
}
}
}
}
}
}
},
"options": {
"type": "object",
"title": "Service Options",
"expandable": true,
"properties": {
"airQuality": {
"type": "object",
"title": "Air Quality",
"properties": {
"pm25Breakpoints": {
"$ref": "#/definitions/AirQualityBreakpoints",
"title": "PM2.5 Breakpoints",
"description": "Thresholds for PM2.5 levels to determine air quality categories (µg/m³)"
},
"pm10Breakpoints": {
"$ref": "#/definitions/AirQualityBreakpoints",
"title": "PM10 Breakpoints",
"description": "Thresholds for PM10 levels to determine air quality categories (µg/m³)"
},
"vocBreakpoints": {
"$ref": "#/definitions/AirQualityBreakpoints",
"title": "VOC Breakpoints",
"description": "Thresholds for VOC levels to determine air quality categories (µg/m³)"
}
}
},
"battery": {
"type": "object",
"title": "Battery",
"properties": {
"lowBatteryThreshold": {
"title": "Low Battery Threshold",
"description": "Battery level below which the device shows as 'Low Battery' (%).<br/>This overrides any 'Low Battery' reports from the device itself.",
"type": "integer",
"minimum": 1,
"maximum": 100,
"widget": "updown"
}
}
},
"carbonDioxide": {
"type": "object",
"title": "Carbon Dioxide",
"properties": {
"threshold": {
"title": "Detection Threshold",
"description": "CO2 level at which the sensor triggers detection (ppm)",
"type": "integer",
"minimum": 0,
"maximum": 100000,
"widget": "updown"
}
}
}
}
},
"bluetooth": {
"type": "object",
"title": "Bluetooth Configuration",
"expandable": true,
"properties": {
"powerOnTimeout": {
"title": "Bluetooth Power-On Timeout",
"description": "How long to wait for the Bluetooth adapter to power on in milliseconds",
"type": "integer",
"minimum": 1000,
"default": 10000,
"required": true
},
"discoveryTimeout": {
"title": "Bluetooth Discovery Timeout",
"description": "How long to wait after last discovery before restarting the Bluetooth scanner in milliseconds (0 = off).<br />Useful with some adapters where the plugin stops working silently over time.",
"type": "integer",
"default": 0
}
}
}
}
}
}