-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.schema.json
250 lines (250 loc) · 10.3 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
{
"pluginAlias": "Awair2",
"pluginType": "platform",
"singular": true,
"headerDisplay": "Awair plug-in for [Homebridge](https://github.com/nfarina/homebridge) using the native Awair Cloud and Local APIs.",
"footerDisplay": "Reference [Installation Instructions](https://github.com/DMBlakeley/homebridge-awair2#readme) for details on determining 'Developer Token'.",
"schema": {
"type": "object",
"properties": {
"token": {
"title": "Developer Token (REQUIRED)",
"type": "string",
"placeholder": "AAA.AAA.AAA",
"required": true,
"description": "Reference Installation Instructions - link provided in footer."
},
"userType": {
"title": "The type of User Account",
"type": "string",
"default": "users/self",
"description": "The type of User Account. Default = 'users/self', Options: 'users/self' or 'orgs/###', where ### is the Awair Organization 'orgId'."
},
"apiMethod": {
"title": "API used for data sampling",
"type": "string",
"default": "cloudAPI",
"enum": ["cloudAPI", "localAPI"],
"description": "The type of API used. Default = 'cloudAPI', Option: 'localAPI'."
},
"localPollingInterval": {
"title": "Sampling interval used for local data sampling",
"type": "integer",
"default": "30",
"description": "Sampling interval in seconds when 'localAPI' selected. 10 seconds minimum, 30 seconds recommended.",
"condition": {
"functionBody": "return model.apiMethod === 'localAPI';"
}
},
"airQualityMethod": {
"title": "Air quality calculation method",
"type": "string",
"default": "awair-score",
"enum": ["awair-aqi", "awair-pm", "awair-score", "nowcast-aqi"],
"description": "Air quality calculation method used to define the Air Quality Chracteristic. Default = 'awair-score', Options: 'awair-aqi', 'awair-pm', 'awair-score' and 'nowcast-aqi'. <br>- The 'awair-score' method maps the Awair Score to an Air Quality value. <br>- When 'awair-pm' is selected, the HomeKit Air Quality tile only reflects the particulates value, which is useful for automating air purifiers. <br>- When 'nowcast-api' is selected, 'endpoint' defaults to '15-min-avg' and 'data points returned' to '48'.<br>- <B>NOTE: 'nowcast-aqi' not supported on localAPI.</B>"
},
"endpoint": {
"title": "The 'air-data' endpoint",
"type": "string",
"default": "15-min-avg",
"enum": ["15-min-avg", "5-min-avg", "raw", "latest"],
"description": "The 'air-data' endpoint to use. Default = '15-min-avg', Options: '15-min-avg', '5-min-avg', 'raw', or 'latest'.",
"condition": {
"functionBody": "return model.airQualityMethod !== 'nowcast-aqi' && model.apiMethod === 'cloudAPI';"
}
},
"limit": {
"title": "Number of Data Points Returned",
"type": "integer",
"default": 1,
"description": "Number of consecutive data points returned per request. Used for custom averaging of sensor values from 'raw' Endpoint. Endpoint of 'latest' defaults to '1'. Default = '1'.",
"condition": {
"functionBody": "return model.airQualityMethod !== 'nowcast-aqi' && model.apiMethod === 'cloudAPI' && model.endpoint === 'raw';"
}
},
"carbonDioxideThreshold": {
"title": "Carbon Dioxide Threshold - On",
"type": "integer",
"placeholder": 1000,
"description": "The CO2 level in ppm at which HomeKit will turn ON the trigger alert for the CO2. Default = '1000'."
},
"carbonDioxideThresholdOff": {
"title": "Carbon Dioxide Threshold - Off",
"type": "integer",
"placeholder": 800,
"description": "The CO2 level in ppm at which HomeKit will turn OFF the trigger alert for the CO2 to ensure that it doesn't trigger on/off too frequently. Must be a number lower than 'carbonDioxideThreshold'. Default = '800'."
},
"enableTvocPm25": {
"title": "Total VOC and PM2.5 - Whether to enable binary limit switches.",
"type": "boolean",
"default": false
},
"tvocThreshold": {
"title": "Total VOC Threshold - On",
"type": "integer",
"placeholder": 1000,
"description": "Total VOC level in µg/m³ at which HomeKit will turn ON the trigger alert for Total VOC. Default = '1000'.",
"condition": {
"functionBody": "return model.enableTvocPm25 === true;"
}
},
"tvocThresholdOff": {
"title": "Total VOC Threshold - Off",
"type": "integer",
"placeholder": 800,
"description": "Total VOC level in µg/m³ at which HomeKit will turn OFF the trigger alert for the Total VOC to ensure that it doesn't trigger on/off too frequently. Must be a number lower than 'tvocThreshold'. Default = '800'.",
"condition": {
"functionBody": "return model.enableTvocPm25 === true;"
}
},
"pm25Threshold": {
"title": "PM2.5 Threshold - On",
"type": "integer",
"placeholder": 35,
"description": "The PM2.5 level in µg/m³ at which HomeKit will turn ON the trigger alert for the PM2.5. Default = '35'.",
"condition": {
"functionBody": "return model.enableTvocPm25 === true;"
}
},
"pm25ThresholdOff": {
"title": "PM2.5 Threshold - Off",
"type": "integer",
"placeholder": 20,
"description": "The PM2.5 level in µg/m³ at which HomeKit will turn OFF the trigger alert for the PM2.5 to ensure that it doesn't trigger on/off too frequently. Must be a number lower than 'pm25Threshold'. Default = '20'.",
"condition": {
"functionBody": "return model.enableTvocPm25 === true;"
}
},
"vocMw": {
"title": "Reference Gas Molecular Weight",
"type": "number",
"placeholder": 72.66578273019740,
"description": "The Molecular Weight (g/mol) of a reference gas or mixture that you use to convert from ppb to µg/m³."
},
"occupancyDetection": {
"title": "Omni Occupancy Detection - Whether to enable Occupancy detection based on minimum sound level.",
"type": "boolean",
"default": false,
"description": "Omni only - enables occupancy detection based on detected background sound level + occupancyOffset value."
},
"occupancyOffset": {
"title": "Omni Occupancy decibels Offset - used when occupancyDetection enabled.",
"type": "number",
"placeholder": 2.0,
"multipleOf": 0.5,
"description": "Omni only - used when `occupancy detection` enabled. Offset value in dBA above detected background sound level to set upper level for `not occupied`. The lower level for `occupied` is an additional 0.5dBA higher. See Wiki for further explanation. Default = '2'.",
"condition": {
"functionBody": "return model.occupancyDetection === true;"
}
},
"occupancyRestart": {
"title": "Omni Reset Occupancy Status - reinitialize Occupancy detection measurement on Homebridge reboot.",
"type": "boolean",
"default": false,
"description": "Omni only - reinitialize Occupancy detection measurement to determine unoccupied sound level on Homebridge boot or restart.",
"condition": {
"functionBody": "return model.occupancyDetection === true;"
}
},
"logging": {
"title": "Logging - Whether to output logs to the Homebridge logs.",
"type": "boolean",
"default": false
},
"verbose": {
"title": "Verbose Logging - Whether to include API data call results when logging is enabled.",
"type": "boolean",
"default": false,
"condition": {
"functionBody": "return model.logging === true;"
}
},
"enableModes": {
"title": "Display Mode Switches - Whether to enable Display Mode and LED Mode Accessories for Awair-Omni, Awair-R2 and Awair-Element.",
"type": "boolean",
"default": false
},
"modeTemp": {
"title": "Select to display 'F' for Display Mode temperature (Default = 'C')",
"type": "boolean",
"default": false,
"condition": {
"functionBody": "return model.enableModes === true;"
}
},
"modeTime": {
"title": "Select to display '24hr' for Display Mode time (Default = '12hr')",
"type": "boolean",
"default": false,
"condition": {
"functionBody": "return model.enableModes === true;"
}
},
"development": {
"title": "Development Mode - Whether to enable Development mode to allow use of 'test' Awair devices lacking production/Awair OUI formatted Serial numbers.",
"type": "boolean",
"default": false
},
"ignoredDevices": {
"title": "Ignored Devices",
"description": "Awair account devices you wish to hide in Homekit.",
"type": "array",
"maxItems": 0,
"items": {
"title": "macAddress from back or bottom of Awair device:",
"type": "string",
"minLength": 12,
"maxLength": 12,
"placeholder": "70886Bxxxxxx (Example)"
}
}
}
},
"layout": [
{
"type": "flex",
"flex-flow": "row wrap",
"items": ["token"]
},
{
"type": "fieldset",
"title": "Optional Configuration Settings",
"expandable": true,
"expanded": false,
"items": [
"userType",
"apiMethod",
"localPollingInterval",
"airQualityMethod",
"endpoint",
"limit",
"carbonDioxideThreshold",
"carbonDioxideThresholdOff",
"enableTvocPm25",
"tvocThreshold",
"tvocThresholdOff",
"pm25Threshold",
"pm25ThresholdOff",
"vocMw",
"occupancyDetection",
"occupancyOffset",
"occupancyRestart",
"logging",
"verbose",
"enableModes",
"modeTemp",
"modeTime",
"development"
]
},
{
"type": "array",
"title": "Ignored Devices",
"expandable": true,
"expanded": false,
"items": [
"ignoredDevices[]"
]
}
]
}