forked from konnected-io/konnected-esphome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi-alarm-panel.yaml
281 lines (270 loc) · 9.19 KB
/
openapi-alarm-panel.yaml
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
openapi: 3.1.0
info:
title: Alarm Panel REST API
summary: Local REST based API for the Konnected Alarm Panel and Alarm Panel Pro
description: This API is built on ESPHome firmware for Konnected's Alarm Panel products. For more details and API options, see https://esphome.io/web-api/#api-rest.
version: 1.0.0
termsOfService: https://konnected.io/terms
contact:
name: Konnected Support
url: https://support.konnected.io
email: [email protected]
servers:
- url: http://{localIP}
description: Device on local network
variables:
localIp:
default: 192.168.1.100
port:
default: '80'
paths:
/binary_sensor/{zone}:
get:
summary: Zone state
description: |
Reads the state of a binary sensor zone. A *binary sensor* is an input that has two states: open/closed, on/off, detected/not-detected. All door/window sensors, motion sensors, smoke/CO sensors, water/leak sensors and glass-break sensors are binary sensors.
By default, all numbered zones on the Alarm Panel are configured as binary sensors named as follows:
1. `zone_1`
1. `zone_2`
1. `zone_3`
1. `zone_4`
1. `zone_5`
1. `zone_6`
1. `zone_7` *Alarm Panel Pro only*
1. `zone_8` *Alarm Panel Pro only*
1. `zone_9` *Alarm Panel Pro only*
1. `zone_10` *Alarm Panel Pro only*
1. `zone_11` *Alarm Panel Pro only*
1. `zone_12` *Alarm Panel Pro only*
parameters:
- in: path
name: zone
required: True
schema:
type: string
description: The zone ID
responses:
'200':
description: Binary sensor state
content:
application/json:
schema:
$ref: '#/components/schemas/binary_sensor'
/switch/{output}:
get:
summary: Output state
description: |
Reads the state of an Alarm Panel output. By default, the 6-zone alarm panels have an output named `siren` that activates the 12V ALRM output on the Alarm Panel boards and the OUT outputs on the Add-on boards.
The Alarm Panel Pro default firmware has two outputs named `alarm_1` and `alarm_2` corresponding to ALRM1 and ALRM2 switched outputs on the panel. The toggle switch on the panel can be used to control OUT2, a 3.3V trigger output instead of the 12V ALRM2 output.
parameters:
- in: path
name: output
required: True
schema:
type: string
description: The output ID
responses:
'200':
description: Switch
content:
application/json:
schema:
$ref: '#/components/schemas/binary_sensor'
/switch/{output}/turn_on:
post:
summary: Turn on an output
parameters:
- in: path
name: output
required: True
schema:
type: string
description: The output ID
/switch/{output}/turn_off:
post:
summary: Turn off an output
parameters:
- in: path
name: output
required: True
schema:
type: string
description: The output ID
/switch/{output}/toggle:
post:
summary: Toggle an output
parameters:
- in: path
name: output
required: True
schema:
type: string
description: The output ID
/light/warning_beep:
get:
summary: Warning Beep
description: |
The *warning beep* is implemeneted as a light in ESPHome so that built-in strobe effects can be used to make a repeating beep. In reality it's not actually a light. This endpoint simply controls an output that can be attached to a buzzer, sounder or light.
By default, on the 6-zone Alarm Panels, the *warning beep* output is the same as the ALRM or OUT switched output. On the Alarm Panel Pro, OUT1 is used as the *warning beep* output.
responses:
'200':
description: Switch
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: ESPHome object_id
state:
type: string
description: Human readable string representation of the output, `ON` or `OFF`
/light/warning_beep/turn_on:
post:
summary: Turn on the warning beep
description: Turns on the warning beep output with an optional effect or duration.
parameters:
- in: query
name: effect
required: False
schema:
type: string
enum: ['Strobe', 'None']
- in: query
name: flash
required: False
schema:
type: number
responses:
'200':
description: Warning beep was turned on
/light/warning_beep/turn_off:
post:
summary: Turn off the warning beep
responses:
'200':
description: Warning beep was turned off
/sensor/wifi_signal_rssi:
get:
summary: Wi-Fi signal strength RSSI
description: Signal strength of the Wi-Fi connection (RSSI) expressed in dBm
responses:
'200':
description: Wi-Fi signal strength (RSSI)
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: ESPHome object_id
value:
type: number
description: RSSI expressed as a negative integer
state:
type: string
description: Human readable string representation of the RSSI with units
/sensor/wifi_signal__:
get:
summary: Wi-Fi signal strength %
description: Signal strength of the Wi-Fi connection (RSSI) converted to a percentage
responses:
'200':
description: Wi-Fi signal strength (%)
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: ESPHome object_id
value:
type: number
description: Signal strength expressed as a percentage value (0 - 100)
state:
type: string
description: Human readable string representation of the signal strength percentage
/sensor/uptime:
get:
summary: Uptime
description: Time elapsed since last boot of the device, in seconds.
responses:
'200':
description: Uptime
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: ESPHome object_id
value:
type: number
description: Number of seconds since last boot
state:
type: string
description: Human readable string representation of the seconds since boot, with units
/button/restart/press:
post:
summary: Restart/reboot the device
description: Trigger the software to reboot, re-connect to Wi-Fi (or Ethernet), and re-establish a connection
/text_sensor/device_id:
get:
summary: Device ID
description: Unique ID of the device. Also its MAC address.
responses:
'200':
description: Device ID / MAC
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: ESPHome object_id
value:
type: string
description: 12-character Device ID
state:
type: string
description: 12-character Device ID
/text_sensor/ip_address:
get:
summary: IP Address
description: Current IP address of the device
responses:
'200':
description: IP Address
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: ESPHome object_id
value:
type: string
description: IPv4 address
state:
type: string
description: IPv4 address
components:
schemas:
binary_sensor:
type: object
properties:
id:
type: string
description: ESPHome object_id
state:
type: string
description: Binary state of the input (`ON` or `OFF`). ON means open or detected, and OFF means closed or not detected.
value:
type: boolean
description: Boolean representation of the input state (*true* means ON or OPEN)