-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
509 lines (489 loc) · 12.9 KB
/
openapi.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
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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
openapi: 3.0.2
info:
title: sense.com API
description: |
This is an unofficial, unsupported specification for api.sense.com based on
watching the network traffic. This is not created or sponsored by Sense,
and may change or break at any time.
version: 0.0.1
servers:
- url: https://api.sense.com/apiservice/api/v1
# paramters
# schemas
# responses
# operations
components:
schemas:
error:
type: object
properties:
status:
type: string
error_reason:
type: string
# user
hello:
type: object
properties:
authorized:
type: boolean
account_id:
type: integer
access_token:
type: string
format: password
monitors:
type: array
items:
$ref: '#/components/schemas/monitor'
refresh_token:
type: string
format: password
settings:
$ref: '#/components/schemas/user_settings'
user_id:
type: integer
bridge_server:
type: string
date_created:
type: string
format: date-time
totp_enabled:
type: boolean
ab_cohort:
type: string
notification_settings:
type: object
properties:
new_named_device_push:
type: boolean
new_named_device_email:
type: boolean
monitor_offline_push:
type: boolean
monitor_offline_email:
type: boolean
monitor_monthly_email:
type: boolean
always_on_change_push:
type: boolean
comparison_change_push:
type: boolean
new_peak_push:
type: boolean
new_peak_email:
type: boolean
monthly_change_push:
type: boolean
weekly_change_push:
type: boolean
daily_change_push:
type: boolean
generator_on_push:
type: boolean
generator_off_push:
type: boolean
time_of_use:
type: boolean
grid_outage_push:
type: boolean
grid_restored_push:
type: boolean
relay_update_available_push:
type: boolean
relay_update_installed_push:
type: boolean
user_settings:
type: object
properties:
version:
type: integer
user_id:
type: integer
settings:
type: object
properties:
notifications:
type: object
additionalProperties:
$ref: "#/components/schemas/notification_settings"
labs_enabled:
type: boolean
# device
device:
type: object
properties:
id:
type: string
name:
type: string
make:
type: string
model:
type: string
location:
type: string
icon:
type: string
tags:
$ref: '#/components/schemas/device_tags'
# device_peer_name:
# type: object
# properties:
# Name:
# type: string
# UserDeviceType:
# type: string
# Percent:
# type: number
# format: float
# Icon:
# type: string
# UserDeviceTypeDisplayString:
# type: string
device_tags:
type: object
additionalProperties: {}
# properties:
# Alertable:
# type: boolean
# AlwaysOn:
# type: boolean
# DateCreated:
# type: string
# format: date-time
# DateFirstUsage:
# type: string
# format: date
# DefaultUserDeviceType:
# type: string
# DeployToMonitor:
# type: boolean
# DeviceListAllowed:
# type: boolean
# Make:
# type: string
# MergeId:
# type: string
# ModelCreatedVersion:
# type: string
# ModelUpdatedVersion:
# type: string
# name_useredit:
# type: boolean
# OriginalName:
# type: string
# PreselectionIndex:
# type: integer
# PeerNames:
# type: array
# items:
# $ref: "#/components/schemas/device_peer_name"
# Pending:
# type: boolean
# PreselectionIndex:
# type: integer
# Revoked:
# type: boolean
# TimelineAllowed:
# type: boolean
# TimelineDefault:
# type: boolean
# Type:
# type: string
# UserDeletable:
# type: boolean
# UserDeviceType:
# type: string
# UserDeviceTypeDisplayString:
# type: string
# UserEditable:
# type: boolean
# UserEditableMeta:
# type: boolean
# UserMergeable:
# type: boolean
# UserShowBubble:
# type: boolean
# UserShowInDeviceList:
# type: boolean
monitor_attributes:
type: object
properties:
id:
type: integer
name: {}
state: {}
cost:
type: number
format: float
sell_back_rate:
type: number
format: float
user_set_cost:
type: boolean
cycle_start: {}
basement_type:
type: string
home_size_type:
type: string
home_type:
type: string
number_of_occupants:
type: string
occupancy_type:
type: string
year_built_type:
type: string
basement_type_key: {}
home_size_type_key: {}
home_type_key: {}
occupancy_type_key: {}
year_built_type_key: {}
postal_code:
type: string
electricity_cost: {}
show_cost:
type: boolean
tou_enabled:
type: boolean
solar_tou_enabled:
type: boolean
power_region:
type: string
to_grid_threshold: {}
panel: {}
user_set_sell_back_rate:
type: boolean
monitor:
type: object
properties:
id:
type: integer
serial_number:
type: string
time_zone:
type: string
solar_connected:
type: boolean
solar_configured:
type: boolean
online:
type: boolean
attributes:
$ref: "#/components/schemas/monitor_attributes"
signal_check_completed_time:
type: string
format: date-time
data_sharing:
type: array
items: {}
ethernet_supported:
type: boolean
aux_ignore:
type: boolean
aux_port:
type: string
hardware_type:
type: string
zigbee_supported:
type: boolean
paths:
# public
/public/monitors/environments:
#$ref: 'schemas/public.yaml#/components/paths/environments'
get:
operationId: GetEnvironments
description: 'Get sense.com server environments'
parameters: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
type: object
properties:
environment:
type: string
client_bridgelink_url:
type: string
api_url:
type: string
display_name:
type: string
default:
description: presumed error
content:
application/json:
schema:
$ref: "#/components/schemas/error"
# user
/authenticate:
#$ref: 'schemas/user.yaml#/components/paths/authenticate'
post:
operationId: Authenticate
description: 'Authenticate the user'
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
email:
type: string
password:
type: string
format: password
totp:
type: string
mfa_token:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/hello'
'401':
description: Authentication Needed
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/error"
- type: object
properties:
mfa_token:
type: string
default:
description: presumed error
content:
application/json:
schema:
$ref: "#/components/schemas/error"
/renew:
post:
operationId: RenewAuthToken
description: Renew authentication token
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
user_id:
type: integer
refresh_token:
type: string
format: password
is_access_token:
type: boolean
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
access_token:
type: string
refresh_token:
type: string
format: password
expires:
type: string
format: date-time
default:
description: presumed error
content:
application/json:
schema:
$ref: "#/components/schemas/error"
# /users/{user_id}:
# $ref: 'schemas/user.yaml#/operations/user'
# /users/{user_id}/notifications:
# $ref: 'schemas/user.yaml#/operations/notifications'
# /users/{user_id}/settings:
# $ref: 'schemas/user.yaml#/operations/settings'
# /users/{user_id}/timeline:
# $ref: 'schemas/user.yaml#/operations/timeline'
#
# # monitor
# /app/monitors/{monitor_id}/attributes:
# $ref: 'schemas/monitor.yaml#/operations/attributes'
# /app/monitors/{monitor_id}/integrations:
# $ref: 'schemas/monitor.yaml#/operations/integrations'
# /app/monitors/{monitor_id}/overview:
# $ref: 'schemas/monitor.yaml#/operations/overview'
# /app/monitors/{monitor_id}/data_sharing:
# $ref: 'schemas/monitor.yaml#/operations/data_sharing'
# /app/monitors/{monitor_id}/device_inventory:
# $ref: 'schemas/monitor.yaml#/operations/device_inventory'
# /app/monitors/{monitor_id}/labs_content:
# $ref: 'schemas/labs.yaml#/operations/labs_content'
# /app/monitors/{monitor_id}/rate_zones:
# $ref: 'schemas/monitor.yaml#/operations/rates_zones'
# /app/monitors/{monitor_id}/solar_specs:
# $ref: 'schemas/monitor.yaml#/operations/solar_specs'
# /app/monitors/{monitor_id}/status:
# $ref: 'schemas/monitor.yaml#/operations/status'
# /app/monitors/attributes/options:
# $ref: 'schemas/monitor.yaml#/operations/attributes_options'
#
# # devices
# /app/monitors/{monitor_id}/devices/always_on:
# $ref: 'schemas/devices.yaml#/operations/always_on'
# /app/monitors/{monitor_id}/devices/battery:
# $ref: 'schemas/devices.yaml#/operations/battery'
# /app/monitors/{monitor_id}/devices/inverter:
# $ref: 'schemas/devices.yaml#/operations/inverter'
/app/monitors/{monitor_id}/devices/overview:
#$ref: 'schemas/devices.yaml#/components/paths/overview'
parameters:
- name: monitor_id
in: path
required: true
schema:
type: integer
get:
operationId: GetDevices
description: 'Get all devices'
parameters:
- name: include_merged
in: query
schema:
type: boolean
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
devices:
type: array
items:
$ref: '#/components/schemas/device'
device_data_checksum:
type: string
# /app/monitors/devicetypes:
# $ref: 'schemas/devices.yaml#/operations/devicetypes'
#
# # history
# /app/history/trends:
# $ref: 'schemas/history.yaml#/operations/trends'
# /app/history/cumulative:
# $ref: 'schemas/history.yaml#/operations/cumulative'
# /app/history/comparisons:
# $ref: 'schemas/history.yaml#/operations/comparisons'
#
# # app
# /app/electricty_cost:
# $ref: 'schemas/app.yaml#/electricity_cost'
#