-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.schema.json
195 lines (195 loc) · 5.72 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
{
"pluginAlias": "SnowSense",
"pluginType": "platform",
"singular": true,
"headerDisplay": "SnowSense creates an Occupancy Detector called \"IsSnowy\" that tells you to turn on your snow melting equipment. That means it's going to snow soon or is snowing now or it stopped snowing recently",
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"required": true,
"default": "SnowSense"
},
"apiKey": {
"title": "OpenWeather API Key (apiKey)",
"type": "string",
"required": true,
"default": "",
"description": "API key from https://openweathermap.org/api (Subscribe to One Call API 3.0)",
"minLength": 32,
"maxLength": 32
},
"apiVersion": {
"title": "API Version (apiVersion)",
"type": "string",
"required": true,
"default": "3.0",
"oneOf": [
{
"title": "2.5",
"enum": [
"2.5"
]
},
{
"title": "3.0",
"enum": [
"3.0"
]
}
]
},
"debugOn": {
"title": "Debug Logging (debugOn)",
"type": "boolean",
"required": true,
"default": false
},
"apiThrottleMinutes": {
"title": "Minutes between weather checks (apiThrottleMinutes)",
"type": "number",
"placeholder": "15",
"description": "How often to check for weather. Don't do it too often or you'll use up your api usage quota.",
"minimum": 5,
"maximum": 1440
},
"units": {
"title": "Temperature Units (units)",
"type": "string",
"required": true,
"default": "imperial",
"description": "Fahrenheit or Celsius",
"oneOf": [
{
"title": "Fahrenheit (imperial)",
"enum": [
"imperial"
]
},
{
"title": "Celsius (metric)",
"enum": [
"metric"
]
}
]
},
"location": {
"title": "Location",
"type": "string",
"required": true,
"default": "New York,NY,US",
"description": "Location is <city>,<state>,<country code> or 5-digit zip code or <latitude>,<longitude>"
},
"onlyWhenCold": {
"title": "Only trigger when it is colder than a threshold (onlyWhenCold)",
"type": "boolean",
"default": false,
"description": "Only trigger when it's cold, even if it's snowing. This is useful since snow might not be sticking to the ground if it's too warm."
},
"coldTemperatureThreshold": {
"title": "Cold Threshold (coldTemperatureThreshold)",
"type": "number",
"default": 32,
"minimum": -20,
"maximum": 50,
"description": "Only relevant when \"Only When Cold\" is turned on. Trigger when it's colder than this temperature. In the given units."
},
"sensors": {
"type": "array",
"items": {
"title": "Sensors",
"type": "object",
"properties": {
"displayName": {
"title": "Name",
"type": "string",
"placeholder": "Enter sensor name...",
"required": true
},
"hoursBeforeSnowIsSnowy": {
"title": "Hours before snow starts to trigger 'snowy' (hoursBeforeSnowIsSnowy)",
"type": "integer",
"default": "3",
"minimum": 0,
"maximum": 6,
"description": "If snow is forecasted within the next x hours, it's considered snowy."
},
"hoursAfterSnowIsSnowy": {
"title": "Hours after snow ends to turn off 'snowy' (hoursAfterSnowIsSnowy)",
"type": "integer",
"default": "3",
"minimum": 0,
"maximum": 6,
"description": "If snow was seen in the past x hours, it's considered snowy."
},
"consecutiveHoursFutureIsSnowy": {
"title": "Consecutive hours of predicted snow is 'snowy' (consecutiveHoursFutureIsSnowy)",
"type": "integer",
"default": "0",
"minimum": 0,
"maximum": 6,
"description": "There must be this many consecutive hours of snow in the forecast to be considered 'snowy'."
}
}
}
}
}
},
"layout": [
{
"type": "fieldset",
"title": "Required Settings",
"description": "There are needed to use SnowSense",
"items": [
"location",
"apiKey"
]
},
{
"key": "sensors",
"type": "array",
"orderable": false,
"buttonText": "Add Sensor",
"items": [
"sensors[].displayName",
"sensors[].hoursBeforeSnowIsSnowy",
"sensors[].hoursAfterSnowIsSnowy",
"sensors[].consecutiveHoursFutureIsSnowy"
]
},
{
"type": "fieldset",
"title": "Time Settings",
"description": "These settings about timing of events.",
"expandable": true,
"items": [
"apiThrottleMinutes"
]
},
{
"type": "fieldset",
"title": "Temperature Settings",
"description": "These settings are about temperatures.",
"expandable": true,
"items": [
"units",
"onlyWhenCold",
"coldTemperatureThreshold"
]
},
{
"type": "fieldset",
"title": "Advanced Settings",
"description": "Less common settings.",
"expandable": true,
"items": [
"apiVersion",
"name",
"debugOn"
]
}
]
}