forked from jeffreydwalter/arlo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
arlo.py
1531 lines (1316 loc) · 78.1 KB
/
arlo.py
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
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
Copyright 2016 Jeffrey D. Walter
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS ISBASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
# 14 Sep 2016, Len Shustek: Added Logout()
# 17 Jul 2017, Andreas Jakl: Port to Python 3 (https://www.andreasjakl.com/using-netgear-arlo-security-cameras-for-periodic-recording/)
# Import helper classes that are part of this library.
from request import Request
from eventstream import EventStream
# Import all of the other stuff.
from six import string_types, text_type
from datetime import datetime
import calendar
import json
#import logging
import math
import os
import random
import requests
import signal
import time
import sys
if sys.version[0] == '2':
import Queue as queue
else:
import queue as queue
#logging.basicConfig(level=logging.DEBUG,format='[%(levelname)s] (%(threadName)-10s) %(message)s',)
class Arlo(object):
TRANSID_PREFIX = 'web'
def __init__(self, username, password):
# signals only work in main thread
try:
signal.signal(signal.SIGINT, self.interrupt_handler)
except:
pass
self.event_streams = {}
self.request = None
self.Login(username, password)
def interrupt_handler(self, signum, frame):
print("Caught Ctrl-C, exiting.")
os._exit(1)
def to_timestamp(self, dt):
if sys.version[0] == '2':
epoch = datetime.utcfromtimestamp(0)
return int((dt - epoch).total_seconds() * 1e3)
else:
return int(dt.timestamp() * 1e3)
def genTransId(self, trans_type=TRANSID_PREFIX):
def float2hex(f):
MAXHEXADECIMALS = 15
w = f // 1
d = f % 1
# Do the whole:
if w == 0: result = '0'
else: result = ''
while w:
w, r = divmod(w, 16)
r = int(r)
if r > 9: r = chr(r+55)
else: r = str(r)
result = r + result
# And now the part:
if d == 0: return result
result += '.'
count = 0
while d:
d = d * 16
w, d = divmod(d, 1)
w = int(w)
if w > 9: w = chr(w+55)
else: w = str(w)
result += w
count += 1
if count > MAXHEXADECIMALS: break
return result
now = datetime.today()
return trans_type+"!" + float2hex(random.random() * math.pow(2, 32)).lower() + "!" + str(int((time.mktime(now.timetuple())*1e3 + now.microsecond/1e3)))
def Login(self, username, password):
"""
This call returns the following:
{
"userId":"XXX-XXXXXXX",
"email":"[email protected]",
"token":"2_5HicFJMXXXXX-S_7IuK2EqOUHXXXXXXXXXXX1CXKWTThgU18Va_XXXXXX5S00hUafv3PV_if_Bl_rhiFsDHYwhxI3CxlVnR5f3q2XXXXXX-Wnt9F7D82uN1f4cXXXXX-FMUsWF_6tMBqwn6DpzOaIB7ciJrnr2QJyKewbQouGM6",
"paymentId":"XXXXXXXX",
"authenticated":1472961381,
"accountStatus":"registered",
"serialNumber":"XXXXXXXXXXXXX",
"countryCode":"US",
"tocUpdate":false,
"policyUpdate":false,
"validEmail":true
}
"""
self.username = username
self.password = password
self.request = Request()
body = self.request.post('https://my.arlo.com/hmsweb/login/v2', {'email': self.username, 'password': self.password})
headers = {
'DNT': '1',
'schemaVersion': '1',
'Host': 'my.arlo.com',
'Content-Type': 'application/json; charset=utf-8;',
'Referer': 'https://my.arlo.com/',
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_2 like Mac OS X) AppleWebKit/604.3.5 (KHTML, like Gecko) Mobile/15B202 NETGEAR/v1 (iOS Vuezone)',
'Authorization': body['token']
}
self.request.session.headers.update(headers)
self.user_id = body['userId']
return body
def Logout(self):
event_streams = self.event_streams.copy()
for basestation_id in event_streams.keys():
self.Unsubscribe(basestation_id)
return self.request.put('https://my.arlo.com/hmsweb/logout')
def Subscribe(self, basestation):
"""
Arlo uses the EventStream interface in the browser to do pub/sub style messaging.
Unfortunately, this appears to be the only way Arlo communicates these messages.
This function makes the initial GET request to /subscribe, which returns the EventStream socket.
Once we have that socket, the API requires a POST request to /notify with the "subscriptionsresource.
This call "registersthe device (which should be the basestation) so that events will be sent to the EventStream
when subsequent calls to /notify are made.
Since this interface is asynchronous, and this is a quick and dirty hack to get this working, I'm using a thread
to listen to the EventStream. This thread puts events into a queue. Some polling is required (see NotifyAndGetResponse()) because
the event messages aren't guaranteed to be delivered in any specific order, but I wanted to maintain a synchronous style API.
You generally shouldn't need to call Subscribe() directly, although I'm leaving it "publicfor now.
"""
basestation_id = basestation.get('deviceId')
def Register(self):
if basestation_id in self.event_streams and self.event_streams[basestation_id].connected:
self.Notify(basestation, {"action":"set","resource":"subscriptions/"+self.user_id+"_web","publishResponse":False,"properties":{"devices":[basestation_id]}})
event = self.event_streams[basestation_id].Get()
if event is None or self.event_streams[basestation_id].event_stream_stop_event.is_set():
return None
elif event:
self.event_streams[basestation_id].Register()
return event
def QueueEvents(self, event_stream, stop_event):
for event in event_stream:
if event is None or stop_event.is_set():
return None
response = json.loads(event.data)
if basestation_id in self.event_streams:
if self.event_streams[basestation_id].connected:
if response.get('action') == 'logout':
self.event_streams[basestation_id].Disconnect()
return None
else:
self.event_streams[basestation_id].queue.put(response)
elif response.get('status') == 'connected':
self.event_streams[basestation_id].Connect()
def Heartbeat(self, stop_event):
while not stop_event.wait(30.0):
try:
self.Ping(basestation)
except:
pass
if basestation_id not in self.event_streams or not self.event_streams[basestation_id].connected:
self.event_streams[basestation_id] = EventStream(QueueEvents, Heartbeat, args=(self, ))
self.event_streams[basestation_id].Start()
while not self.event_streams[basestation_id].connected and not self.event_streams[basestation_id].event_stream_stop_event.is_set():
time.sleep(0.5)
if not self.event_streams[basestation_id].registered:
Register(self)
def Unsubscribe(self, basestation):
""" This method stops the EventStream subscription and removes it from the event_stream collection. """
if isinstance(basestation, (text_type, string_types)):
basestation_id = basestation
else:
basestation_id = basestation.get('deviceId')
if basestation_id in self.event_streams:
if self.event_streams[basestation_id].connected:
self.request.get('https://my.arlo.com/hmsweb/client/unsubscribe')
self.event_streams[basestation_id].Disconnect()
del self.event_streams[basestation_id]
def Notify(self, basestation, body):
"""
The following are examples of the json you would need to pass in the body of the Notify() call to interact with Arlo:
##############################################################################################################################
##############################################################################################################################
NOTE: While you can call Notify() directly, responses from these notify calls are sent to the EventStream (see Subscribe()),
and so it's better to use the Get/Set methods that are implemented using the NotifyAndGetResponse() method.
##############################################################################################################################
##############################################################################################################################
Set System Mode (Armed, Disarmed) - {"from":"XXX-XXXXXXX_web","to":"XXXXXXXXXXXXX","action":"set","resource":"modes","transId":"web!XXXXXXXX.XXXXXXXXXXXXXXXXXXXX","publishResponse":true,"properties":{"active":"mode0"}}
Set System Mode (Calendar) - {"from":"XXX-XXXXXXX_web","to":"XXXXXXXXXXXXX","action":"set","resource":"schedule","transId":"web!XXXXXXXX.XXXXXXXXXXXXXXXXXXXX","publishResponse":true,"properties":{"active":true}}
Configure The Schedule (Calendar) - {"from":"XXX-XXXXXXX_web","to":"XXXXXXXXXXXXX","action":"set","resource":"schedule","transId":"web!XXXXXXXX.XXXXXXXXXXXXXXXXXXXX","publishResponse":true,"properties":{"schedule":[{"modeId":"mode0","startTime":0},{"modeId":"mode2","startTime":28800000},{"modeId":"mode0","startTime":64800000},{"modeId":"mode0","startTime":86400000},{"modeId":"mode2","startTime":115200000},{"modeId":"mode0","startTime":151200000},{"modeId":"mode0","startTime":172800000},{"modeId":"mode2","startTime":201600000},{"modeId":"mode0","startTime":237600000},{"modeId":"mode0","startTime":259200000},{"modeId":"mode2","startTime":288000000},{"modeId":"mode0","startTime":324000000},{"modeId":"mode0","startTime":345600000},{"modeId":"mode2","startTime":374400000},{"modeId":"mode0","startTime":410400000},{"modeId":"mode0","startTime":432000000},{"modeId":"mode0","startTime":518400000}]}
Create Mode -
{"from":"XXX-XXXXXXX_web","to":"XXXXXXXXXXXXX","action":"add","resource":"rules","transId":"web!XXXXXXXX.XXXXXXXXXXXXXXXXXXXX","publishResponse":true,"properties":{"name":"Record video on Camera 1 if Camera 1 detects motion","id":"ruleNew","triggers":[{"type":"pirMotionActive","deviceId":"XXXXXXXXXXXXX","sensitivity":80}],"actions":[{"deviceId":"XXXXXXXXXXXXX","type":"recordVideo","stopCondition":{"type":"timeout","timeout":15}},{"type":"sendEmailAlert","recipients":["__OWNER_EMAIL__"]},{"type":"pushNotification"}]}}
{"from":"XXX-XXXXXXX_web","to":"XXXXXXXXXXXXX","action":"add","resource":"modes","transId":"web!XXXXXXXX.XXXXXXXXXXXXXXXXXXXX","publishResponse":true,"properties":{"name":"Test","rules":["rule3"]}}
Delete Mode - {"from":"XXX-XXXXXXX_web","to":"XXXXXXXXXXXXX","action":"delete","resource":"modes/mode3","transId":"web!XXXXXXXX.XXXXXXXXXXXXXXXXXXXX","publishResponse":true}
Camera Off - {"from":"XXX-XXXXXXX_web","to":"XXXXXXXXXXXXX","action":"set","resource":"cameras/XXXXXXXXXXXXX","transId":"web!XXXXXXXX.XXXXXXXXXXXXXXXXXXXX","publishResponse":true,"properties":{"privacyActive":false}}
Night Vision On - {"from":"XXX-XXXXXXX_web","to":"XXXXXXXXXXXXX","action":"set","resource":"cameras/XXXXXXXXXXXXX","transId":"web!XXXXXXXX.XXXXXXXXXXXXXXXXXXXX","publishResponse":true,"properties":{"zoom":{"topleftx":0,"toplefty":0,"bottomrightx":1280,"bottomrighty":720},"mirror":true,"flip":true,"nightVisionMode":1,"powerSaveMode":2}}
Motion Detection Test - {"from":"XXX-XXXXXXX_web","to":"XXXXXXXXXXXXX","action":"set","resource":"cameras/XXXXXXXXXXXXX","transId":"web!XXXXXXXX.XXXXXXXXXXXXXXXXXXXX","publishResponse":true,"properties":{"motionSetupModeEnabled":true,"motionSetupModeSensitivity":80}}
device_id = locations.data.uniqueIds
System Properties: ("resource":"modes")
active (string) - Mode Selection (mode2 = All Motion On, mode1 = Armed, mode0 = Disarmed, etc.)
System Properties: ("resource":"schedule")
active (bool) - Mode Selection (true = Calendar)
Camera Properties: ("resource":"cameras/{id}")
privacyActive (bool) - Camera On/Off
zoom (topleftx (int), toplefty (int), bottomrightx (int), bottomrighty (int)) - Camera Zoom Level
mirror (bool) - Mirror Image (left-to-right or right-to-left)
flip (bool) - Flip Image Vertically
nightVisionMode (int) - Night Mode Enabled/Disabled (1, 0)
powerSaveMode (int) - PowerSaver Mode (3 = Best Video, 2 = Optimized, 1 = Best Battery Life)
motionSetupModeEnabled (bool) - Motion Detection Setup Enabled/Disabled
motionSetupModeSensitivity (int 0-100) - Motion Detection Sensitivity
"""
basestation_id = basestation.get('deviceId')
body['transId'] = self.genTransId()
body['from'] = self.user_id+'_web'
body['to'] = basestation_id
self.request.post('https://my.arlo.com/hmsweb/users/devices/notify/'+body['to'], body, headers={"xcloudId":basestation.get('xCloudId')})
return body.get('transId')
def NotifyAndGetResponse(self, basestation, body, timeout=120):
basestation_id = basestation.get('deviceId')
self.Subscribe(basestation)
if basestation_id in self.event_streams and self.event_streams[basestation_id].connected and self.event_streams[basestation_id].registered:
transId = self.Notify(basestation, body)
event = self.event_streams[basestation_id].Get(timeout=timeout)
if event is None or self.event_streams[basestation_id].event_stream_stop_event.is_set():
return None
while basestation_id in self.event_streams and self.event_streams[basestation_id].connected and self.event_streams[basestation_id].registered:
tid = event.get('transId', '')
if tid != transId:
if tid.startswith(self.TRANSID_PREFIX):
self.event_streams[basestation_id].queue.put(event)
event = self.event_streams[basestation_id].Get(timeout=timeout)
if event is None or self.event_streams[basestation_id].event_stream_stop_event.is_set():
return None
else: break
return event
def Ping(self, basestation):
basestation_id = basestation.get('deviceId')
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"subscriptions/"+self.user_id+"_web","publishResponse":False,"properties":{"devices":[basestation_id]}})
def SubscribeToMotionEvents(self, basestation, callback, timeout=120):
"""
Use this method to subscribe to motion events. You must provide a callback function which will get called once per motion event.
The callback function should have the following signature:
def callback(self, event)
This is an example of handling a specific event, in reality, you'd probably want to write a callback for HandleEvents()
that has a big switch statement in it to handle all the various events Arlo produces.
"""
def callbackwrapper(self, event):
if event.get('properties', {}).get('motionDetected'):
callback(self, event)
self.HandleEvents(basestation, callbackwrapper, timeout)
def HandleEvents(self, basestation, callback, timeout=120):
"""
Use this method to subscribe to the event stream and provide a callback that will be called for event event received.
This function will allow you to potentially write a callback that can handle all of the events received from the event stream.
"""
if not callable(callback):
raise Exception('The callback(self, event) should be a callable function.')
basestation_id = basestation.get('deviceId')
self.Subscribe(basestation)
if basestation_id in self.event_streams and self.event_streams[basestation_id].connected and self.event_streams[basestation_id].registered:
while basestation_id in self.event_streams and self.event_streams[basestation_id].connected:
event = self.event_streams[basestation_id].Get(timeout=timeout)
if event is None or self.event_streams[basestation_id].event_stream_stop_event.is_set():
return None
# If this event has is of resource type "subscriptions", then it's a ping reply event.
# For now, these types of events will be requeued, since they are generated in response to and expected as a reply by the Ping() method.
# HACK: Take a quick nap here to give the Ping() method's thread a chance to get the queued event.
if event.get('resource', '').startswith('subscriptions'):
self.event_streams[basestation_id].queue.put(event)
time.sleep(0.05)
else:
response = callback(self, event)
# NOTE: Not ideal, but this allows you to look for a specific event and break if you want to return it.
if response is not None:
return response
def TriggerAndHandleEvent(self, basestation, trigger, callback, timeout=120):
"""
Use this method to subscribe to the event stream and provide a callback that will be called for event event received.
This function will allow you to potentially write a callback that can handle all of the events received from the event stream.
NOTE: Use this function if you need to run some code after subscribing to the eventstream, but before your callback to handle the events runs.
"""
if not callable(trigger):
raise Exception('The trigger(self, camera) should be a callable function.')
if not callable(callback):
raise Exception('The callback(self, event) should be a callable function.')
self.Subscribe(basestation)
trigger(self)
# NOTE: Calling HandleEvents() calls Subscribe() again, which basically turns into a no-op. Hackie I know, but it cleans up the code a bit.
return self.HandleEvents(basestation, callback, timeout)
def GetBaseStationState(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"get","resource":"basestation","publishResponse":False})
def GetCameraState(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"get","resource":"cameras","publishResponse":False})
def GetRules(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"get","resource":"rules","publishResponse":False})
def GetSmartFeatures(self):
return self.request.get('https://my.arlo.com/hmsweb/users/subscription/smart/features')
def GetSmartAlerts(self, camera):
return self.request.get('https://my.arlo.com/hmsweb/users/devices/'+camera.get('uniqueId')+'/smartalerts')
def GetAutomationActivityZones(self, camera):
return self.request.get('https://my.arlo.com/hmsweb/users/devices/'+camera.get('uniqueId')+'/activityzones')
def RestartBasestation(self, basestation):
return self.request.post('https://my.arlo.com/hmsweb/users/devices/restart', {"deviceId":basestation.get('deviceId')})
def SetAutomationActivityZones(self, camera, zone, coords, color):
"""
An activity zone is the area you draw in your video in the UI to tell Arlo what part of the scene to "watch".
This method takes 4 arguments.
camera: the camera you want to set an activity zone for.
name: "Zone 1" - the name of your activity zone.
coords: [{"x":0.37946943483275664,"y":0.3790983606557377},{"x":0.8685121107266436,"y":0.3790983606557377},{"x":0.8685121107266436,"y":1},{"x":0.37946943483275664,"y":1}] - these coordinates are the bonding box for the activity zone.
color: 45136 - the color for your bounding box.
"""
return self.request.post('https://my.arlo.com/hmsweb/users/devices/'+camera.get('uniqueId')+'/activityzones', {"name": zone,"coords": coords, "color": color})
def GetAutomationDefinitions(self):
return self.request.get('https://my.arlo.com/hmsweb/users/automation/definitions', {'uniqueIds':'all'})
def GetCalendar(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"get","resource":"schedule","publishResponse":False})
def DeleteMode(self, device, mode):
""" device can be any object that has parentId == deviceId. i.e., not a camera """
parentId = device.get('parentId', None)
if device['deviceType'] == 'arlobridge':
return self.request.delete('https://my.arlo.com/hmsweb/users/locations/'+device.get('uniqueId')+'/modes/'+mode)
elif not parentId or device.get('deviceId') == parentId:
return self.NotifyAndGetResponse(basestation, {"action":"delete","resource":"modes/"+mode,"publishResponse":True})
else:
raise Exception('Only parent device modes and schedules can be deleted.');
def GetModes(self, basestation):
""" DEPRECATED: This is the older API for getting the "mode". It still works, but GetModesV2 is the way the Arlo software does it these days. """
return self.NotifyAndGetResponse(basestation, {"action":"get","resource":"modes","publishResponse":False})
def GetModesV2(self):
"""
This is the newer API for getting the "mode". This method also returns the schedules.
Set a non-schedule mode to be active: {"activeAutomations":[{"deviceId":"XXXXXXXXXXXXX","timestamp":1532015622105,"activeModes":["mode1"],"activeSchedules":[]}]}
Set a schedule to be active: {"activeAutomations":[{"deviceId":"XXXXXXXXXXXXX","timestamp":1532015790139,"activeModes":[],"activeSchedules":["schedule.1"]}]}
"""
return self.request.get('https://my.arlo.com/hmsweb/users/devices/automation/active')
def CustomMode(self, device, mode, schedules=[]):
""" device can be any object that has parentId == deviceId. i.e., not a camera """
if(device["deviceType"].startswith("arloq")):
return self.NotifyAndGetResponse(device, {"from":self.user_id+"_web", "to": device.get("parentId"), "action":"set","resource":"modes", "transId": self.genTransId(),"publishResponse":True,"properties":{"active":mode}})
else:
return self.request.post('https://my.arlo.com/hmsweb/users/devices/automation/active', {'activeAutomations':[{'deviceId':device.get('deviceId'),'timestamp':self.to_timestamp(datetime.now()),'activeModes':[mode],'activeSchedules':schedules}]})
def Arm(self, device):
return self.CustomMode(device, "mode1")
def Disarm(self, device):
return self.CustomMode(device, "mode0")
def Calendar(self, basestation, active=True):
"""
DEPRECATED: This API appears to still do stuff, but I don't see it called in the web UI anymore when switching the mode to a schedule.
NOTE: The Arlo API seems to disable calendar mode when switching to other modes, if it's enabled.
You should probably do the same, although, the UI reflects the switch from calendar mode to say armed mode without explicitly setting calendar mode to inactive.
"""
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"schedule","publishResponse":True,"properties":{"active":active}})
def SetSchedule(self, basestation, schedule):
"""
The following json is what was sent to the API when I edited my schedule. It contains all of the data necessary to configure a whole week. It's a little convoluted, but you can just play around with the scheduler in Chrome and watch the schema that gets sent.
{
"schedule": [
{
"duration": 600,
"startActions": {
"disableModes": [
"mode0"
],
"enableModes": [
"mode1"
]
},
"days": [
"Mo",
"Tu",
"We",
"Th",
"Fr",
"Sa",
"Su"
],
"startTime": 0,
"type": "weeklyAction",
"endActions": {
"disableModes": [
"mode1"
],
"enableModes": [
"mode0"
]
}
},
{
"duration": 360,
"startActions": {
"disableModes": [
"mode0"
],
"enableModes": [
"mode2"
]
},
"days": [
"Mo",
"Tu",
"We",
"Th",
"Fr",
"Sa",
"Su"
],
"startTime": 1080,
"type": "weeklyAction",
"endActions": {
"disableModes": [
"mode2"
],
"enableModes": [
"mode0"
]
}
},
{
"duration": 480,
"startActions": {
"disableModes": [
"mode0"
],
"enableModes": [
"mode3"
]
},
"days": [
"Tu"
],
"startTime": 600,
"type": "weeklyAction",
"endActions": {
"disableModes": [
"mode3"
],
"enableModes": [
"mode0"
]
}
}
],
"name": "",
"id": "schedule.1",
"enabled": true
}
"""
return self.request.post('https://my.arlo.com/hmsweb/users/locations/'+basestation.get('uniqueId')+'/schedules', )
def AdjustBrightness(self, basestation, camera, brightness=0):
"""
NOTE: Brightness is between -2 and 2 in increments of 1 (-2, -1, 0, 1, 2).
Setting it to an invalid value has no effect.
Returns:
{
"action": "is",
"from": "XXXXXXXXXXXXX",
"properties": {
"brightness": -2
},
"resource": "cameras/XXXXXXXXXXXXX",
"to": "336-XXXXXXX_web",
"transId": "web!XXXXXXXX.389518!1514956240683"
}
"""
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+camera.get('deviceId'),"publishResponse":True,"properties":{"brightness":brightness}})
def ToggleCamera(self, basestation, camera, active=True):
"""
active: True - Camera is off.
active: False - Camera is on.
"""
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+camera.get('deviceId'),"publishResponse":True,"properties":{"privacyActive":active}})
def PushToTalk(self, camera):
return self.request.get('https://my.arlo.com/hmsweb/users/devices/'+camera.get('uniqueId')+'/pushtotalk')
""" General alert toggles """
def SetMotionAlertsOn(self, basestation, sensitivity=5):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId'),"publishResponse":True,"properties":{"motionDetection":{"armed":True,"sensitivity":sensitivity,"zones":[]}}})
def SetMotionAlertsOff(self, basestation, sensitivity=5):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId'),"publishResponse":True,"properties":{"motionDetection":{"armed":False,"sensitivity":sensitivity,"zones":[]}}})
def SetAudioAlertsOn(self, basestation, sensitivity=3):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId'),"publishResponse":True,"properties":{"audioDetection":{"armed":True,"sensitivity":sensitivity}}})
def SetAudioAlertsOff(self, basestation, sensitivity=3):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId'),"publishResponse":True,"properties":{"audioDetection":{"armed":False,"sensitivity":sensitivity}}})
def AlertNotificationMethods(self, basestation, action="disabled", email=False, push=False):
""" action : disabled OR recordSnapshot OR recordVideo """
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId'),"publishResponse":True,"properties":{"eventAction":{"actionType":action,"stopType":"timeout","timeout":15,"emailNotification":{"enabled":email,"emailList":["__OWNER_EMAIL__"]},"pushNotification":push}}})
""" Arlo Baby Audio Control """
def GetAudioPlayback(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"get","resource":"audioPlayback","publishResponse":False})
def PlayTrack(self, basestation, track_id="2391d620-e491-4412-99f6-e9a40d6046ed", position=0):
""" Defaulting to 'hugh little baby', which is a supplied track. I hope the ID is the same for all. """
return self.Notify(basestation, {"action":"playTrack","resource":"audioPlayback/player","properties":{"trackId":track_id,"position":position}})
def PauseTrack(self, basestation):
return self.Notify(basestation, {"action":"pause","resource":"audioPlayback/player"})
def UnPauseTrack(self, basestation):
return self.Notify(basestation, {"action":"play","resource":"audioPlayback/player"})
def SkipTrack(self, basestation):
return self.Notify(basestation, {"action":"nextTrack","resource":"audioPlayback/player"})
def SetSleepTimerOn(self, basestation, time=calendar.timegm(time.gmtime()) + 300, timediff=0):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"audioPlayback/config","publishResponse":True,"properties":{"config":{"sleepTime":time,"sleepTimeRel":timediff}}})
def SetSleepTimerOff(self, basestation, time=0, timediff=300):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"audioPlayback/config","publishResponse":True,"properties":{"config":{"sleepTime": time,"sleepTimeRel":timediff}}})
def SetLoopBackModeContinuous(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"audioPlayback/config","publishResponse":True,"properties":{"config":{"loopbackMode":"continuous"}}})
def SetLoopBackModeSingleTrack(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"audioPlayback/config","publishResponse":True,"properties":{"config":{"loopbackMode":"singleTrack"}}})
def SetShuffleOn(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"audioPlayback/config","publishResponse":True,"properties":{"config":{"shuffleActive":True}}})
def SetShuffleOff(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"audioPlayback/config","publishResponse":True,"properties":{"config":{"shuffleActive":False}}})
def SetVolume(self, basestation, mute=False, volume=50):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId'),"publishResponse":True,"properties":{"speaker":{"mute":mute,"volume":volume}}})
""" Baby Arlo Nightlight, (current state is in the arlo.GetCameraState(cameras[0]["properties"][0]["nightLight"]) """
def SetNightLightOn(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId'),"publishResponse":True,"properties":{"nightLight":{"enabled":True}}})
def SetNightLightOff(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId'),"publishResponse":True,"properties":{"nightLight":{"enabled":False}}})
def SetNightLightBrightness(self, basestation, level=200):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId'),"publishResponse":True,"properties":{"nightLight":{"brightness":level}}})
def SetNightLightMode(self, basestation, mode="rainbow"):
""" mode: rainbow or rgb. """
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId'),"publishResponse":True,"properties":{"nightLight":{"mode":mode}}})
def SetNightLightColor(self, basestation, red=255, green=255, blue=255):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId'),"publishResponse":True,"properties":{"nightLight":{"rgb":{"blue":blue,"green":green,"red":red}}}})
def SetNightLightTimerOn(self, basestation, time=calendar.timegm(time.gmtime()) + 300, timediff=0):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId'),"publishResponse":True,"properties":{"nightLight":{"sleepTime":time,"sleepTimeRel":timediff}}})
def SetNightLightTimerOff(self, basestation, time=0, timediff=300):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId'),"publishResponse":True,"properties":{"nightLight":{"sleepTime":time,"sleepTimeRel":timediff}}})
""" Baby Arlo Sensors """
def GetCameraTempReading(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"get","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/history","publishResponse":False})
def GetSensorConfig(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"get","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":False})
def SetAirQualityAlertOn(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"airQuality":{"alertsEnabled":True}}})
def SetAirQualityAlertOff(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"airQuality":{"alertsEnabled":False}}})
def SetAirQualityAlertThresholdMin(self, basestation, number=400):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"airQuality":{"minThreshold":number}}})
def SetAirQualityAlertThresholdMax(self, basestation, number=700):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"airQuality":{"maxThreshold":number}}})
def SetAirQualityRecordingOn(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"airQuality":{"recordingEnabled":True}}})
def SetAirQualityRecordingOff(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"airQuality":{"recordingEnabled":False}}})
def SetHumidityAlertOn(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"humidity":{"alertsEnabled":True}}})
def SetHumidityAlertOff(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"humidity":{"alertsEnabled":False}}})
def SetHumidityAlertThresholdMin(self, basestation, number=400):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"humidity":{"minThreshold":number}}})
def SetHumidityAlertThresholdMax(self, basestation, number=800):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"humidity":{"maxThreshold":number}}})
def SetHumidityRecordingOn(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"humidity":{"recordingEnabled":True}}})
def SetHumidityRecordingOff(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"humidity":{"recordingEnabled":False}}})
def SetTempAlertOn(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"temperature":{"alertsEnabled":True}}})
def SetTempAlertOff(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"temperature":{"alertsEnabled":False}}})
def SetTempAlertThresholdMin(self, basestation, number=200):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"temperature":{"minThreshold":number}}})
def SetTempAlertThresholdMax(self, basestation, number=240):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"temperature":{"maxThreshold":number}}})
def SetTempRecordingOn(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"temperature":{"recordingEnabled":True}}})
def SetTempRecordingOff(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"cameras/"+basestation.get('deviceId')+"/ambientSensors/config","publishResponse":True,"properties":{"temperature":{"recordingEnabled":False}}})
def SetTempUnit(self, uniqueId, unit="C"):
return self.request.post('https://my.arlo.com/hmsweb/users/devices/'+uniqueId+'/tempUnit', {"tempUnit":unit})
def SirenOn(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"siren","publishResponse":True,"properties":{"sirenState":"on","duration":300,"volume":8,"pattern":"alarm"}})
def SirenOff(self, basestation):
return self.NotifyAndGetResponse(basestation, {"action":"set","resource":"siren","publishResponse":True,"properties":{"sirenState":"off","duration":300,"volume":8,"pattern":"alarm"}})
def Reset(self):
return self.request.get('https://my.arlo.com/hmsweb/users/library/reset')
def GetServiceLevelSettings(self):
return self.request.get('https://my.arlo.com/hmsweb/users/serviceLevel/settings')
def GetServiceLevel(self):
return self.request.get('https://my.arlo.com/hmsweb/users/serviceLevel')
def GetServiceLevelV2(self):
""" DEPRECATED: This API still works, but I don't see it being called in the web UI anymore. """
return self.request.get('https://my.arlo.com/hmsweb/users/serviceLevel/v2')
def GetServiceLevelV3(self):
""" DEPRECATED: This API still works, but I don't see it being called in the web UI anymore. """
return self.request.get('https://my.arlo.com/hmsweb/users/serviceLevel/v3')
def GetServiceLevelV4(self):
return self.request.get('https://my.arlo.com/hmsweb/users/serviceLevel/v4')
def GetUpdateFeatures(self):
return self.request.get('https://my.arlo.com/hmsweb/users/devices/updateFeatures/feature')
def GetPaymentBilling(self):
return self.request.get('https://my.arlo.com/hmsweb/users/payment/billing/'+self.user_id)
def GetPaymentOffers(self):
""" DEPRECATED: This API still works, but I don't see it being called in the web UI anymore. """
return self.request.get('https://my.arlo.com/hmsweb/users/payment/offers')
def GetPaymentOffersV2(self):
""" DEPRECATED: This API still works, but I don't see it being called in the web UI anymore. """
return self.request.get('https://my.arlo.com/hmsweb/users/payment/offers/v2')
def GetPaymentOffersV3(self):
""" DEPRECATED: This API still works, but I don't see it being called in the web UI anymore. """
return self.request.get('https://my.arlo.com/hmsweb/users/payment/offers/v3')
def GetPaymentOffersV4(self):
return self.request.get('https://my.arlo.com/hmsweb/users/payment/offers/v4')
def SetOCProfile(self, firstName, lastName, country='United States', language='en', spam_me=0):
return self.request.post('https://my.arlo.com/hmsweb/users/ocprofile', {"firstName":"Jeffrey","lastName":"Walter","country":country,"language":language,"mailProgram":spam_me})
def GetOCProfile(self):
return self.request.get('https://my.arlo.com/hmsweb/users/ocprofile')
def GetProfile(self):
return self.request.get('https://my.arlo.com/hmsweb/users/profile')
def GetSession(self):
"""
Returns something like the following:
{
"userId": "XXX-XXXXXXX",
"email": "[email protected]",
"token": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"paymentId": "XXXXXXXX",
"accountStatus": "registered",
"serialNumber": "XXXXXXXXXXXXXX",
"countryCode": "US",
"tocUpdate": false,
"policyUpdate": false,
"validEmail": true,
"arlo": true,
"dateCreated": 1463975008658
}
"""
return self.request.get('https://my.arlo.com/hmsweb/users/session')
def GetFriends(self):
return self.request.get('https://my.arlo.com/hmsweb/users/friends')
def GetLocations(self):
"""
This call returns the following:
{
"id":"XXX-XXXXXXX_20160823042047",
"name":"Home",
"ownerId":"XXX-XXXXXXX",
"longitude":X.XXXXXXXXXXXXXXXX,
"latitude":X.XXXXXXXXXXXXXXXX,
"address":"123 Middle Of Nowhere Bumbfuck, EG, 12345",
"homeMode":"schedule",
"awayMode":"mode1",
"geoEnabled":false,
"geoRadius":150.0,
"uniqueIds":[
"XXX-XXXXXXX_XXXXXXXXXXXXX"
],
"smartDevices":[
"XXXXXXXXXX",
"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
],
"pushNotifyDevices":[
"XXXXXXXXXX"
]
}
"""
return self.request.get('https://my.arlo.com/hmsweb/users/locations')
def GetEmergencyLocations(self):
return self.request.get('https://my.arlo.com/hmsweb/users/emergency/locations')
def Geofencing(self, location_id, active=True):
"""
Get location_id is the id field from the return of GetLocations()
NOTE: The Arlo API seems to disable geofencing mode when switching to other modes, if it's enabled.
You should probably do the same, although, the UI reflects the switch from calendar mode to say armed mode without explicitly setting calendar mode to inactive.
"""
return self.request.put('https://my.arlo.com/hmsweb/users/locations/'+location_id, {'geoEnabled':active})
def GetDevices(self, device_type=None, filter_provisioned=None):
"""
This method returns an array that contains the basestation, cameras, etc. and their metadata.
If you pass in a valid device type, as a string or a list, this method will return an array of just those devices that match that type. An example would be ['basestation', 'camera']
To filter provisioned or unprovisioned devices pass in a True/False value for filter_provisioned. By default both types are returned.
"""
devices = self.request.get('https://my.arlo.com/hmsweb/users/devices')
if device_type:
devices = [ device for device in devices if device['deviceType'] in device_type]
if filter_provisioned is not None:
if filter_provisioned:
devices = [ device for device in devices if device.get("state") == 'provisioned']
else:
devices = [ device for device in devices if device.get("state") != 'provisioned']
return devices
def GetDeviceSupport(self):
"""
DEPRECATED: This API still works, but I don't see it being called in the web UI anymore.
This API looks like it's mainly used by the website, but I'm including it for completeness sake.
It returns something like the following:
{
"devices": [
{
"deviceType": "arloq",
"urls": {
"troubleshoot": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/pc_troubleshoot.html",
"plugin": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/pc_plugin.html",
"connection": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/pc_connection.html",
"connectionFailed": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/pc_connection_fail.html",
"press_sync": "https://vzs3-prod-common.s3. amazonaws.com/static/html/en/pc_press_sync.html",
"resetDevice": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/reset_arloq.html",
"qr_how_to": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/pc_qr_how_to.html"
}
},
{
"deviceType": "basestation",
"urls": {
"troubleshoot": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/bs_troubleshoot.html",
"connection": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/bs_connection.html",
"sync": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/bs_sync_camera.html"
}
},
{
"deviceType": "arloqs",
"urls": {
"ethernetSetup": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/arloqs/ethernet_setup.html",
"plugin": "https:// vzs3-prod-common.s3.amazonaws.com/static/html/en/arloqs/aqp_plugin.html",
"connectionWiFi": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/arloqs/connection_in_progress_wifi.html",
"poeSetup": "https://vzs3-prod-common.s3. amazonaws.com/static/html/en/arloqs/poe_setup.html",
"connection": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/arloqs/connection_in_progress.html",
"connectionFailed": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/arloqs/connection_fail.html",
"press_sync": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/arloqs/press_sync.html",
"connectionType": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/arloqs/connection_type.html",
"resetDevice": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/arloqs/reset_device.html",
"qr_how_to": "https://vzs3-prod-common.s3.amazonaws.com/static/html/en/arloqs/qr_how_to.html"
}
}
]
}
"""
return self.request.get('https://my.arlo.com/hmsweb/devicesupport')
def GetDeviceSupportv2(self):
"""
DEPRECATED: This API still works, but I don't see it being called in the web UI anymore.
It returns something like the following:
{
"devices": [
{
"deviceType": "arloq",
"modelId": [
"VMC3040"
],
"urls": {
"troubleshoot": "arloq/troubleshoot.html",
"plugin": "arloq/plugin.html",
"qrHowTo": "arloq/qrHowTo.html",
"connection": "arloq/connection.html",
"connectionInProgress": "arloq/connectionInProgress.html",
"connectionFailed": "arloq/connectionFailed.html",
"pressSync": "arloq/pressSync.html",
"resetDevice": "arloq/resetDevice.html"
}
},
{
"deviceType": "basestation",
"modelId": [
"VMB3010",
"VMB3010r2",
"VMB3500",
"VMB4000",
"VMB4500",
"VZB3010"
],
"urls": {
"troubleshoot": "basestation/troubleshoot.html",
"plugin": "basestation/plugin.html",
"sync3": "basestation/sync3.html",
"troubleshootBS": "basestation/troubleshootBS.html",
"connection": "basestation/connection.html",
"connectionInProgress": "basestation/connectionInProgress.html",
"sync2": "basestation/sync2.html",
"connectionFailed": "basestation/connectionFailed.html",
"sync1": "basestation/sync1.html",
"resetDevice": "basestation/resetDevice.html",
"syncComplete": "basestation/syncComplete.html"
}
},
{
"deviceType": "arlobaby",
"modelId": [
"ABC1000"
],
"urls": {
"bleSetupError": "arlobaby/bleSetupError.html",
"troubleshoot": "arlobaby/troubleshoot.html",
"homekitCodeInstruction": "arlobaby/homekitCodeInstruction.html",
"connectionInProgress": "arlobaby/connectionInProgress.html",
"connectionFailed": "arlobaby/connectionFailed.html",
"resetDevice": "arlobaby/resetDevice.html",
"plugin": "arlobaby/plugin.html",
"qrHowTo": "arlobaby/qrHowTo.html",
"warning": "arlobaby/warning.html",
"connection": "arlobaby/connection.html",
"pressSync": "arlobaby/pressSync.html",
"bleInactive": "arlobaby/bleInactive.html",
"pluginIOS": "arlobaby/pluginIOS.html",
"homekitSetup": "arlobaby/homekitSetup.html"
}
},
{
"deviceType": "lteCamera",
"modelId": [
"VML4030"
],
"urls": {
"troubleshoot": "lteCamera/troubleshoot.html",
"resetHowTo": "lteCamera/resetHowTo.html",
"plugin": "lteCamera/plugin.html",
"qrHowTo": "lteCamera/qrHowTo.html",
"connectionInProgress": "lteCamera/connectionInProgress.html",
"connectionFailed": "lteCamera/connectionFailed.html",
"resetDevice": "lteCamera/resetHowTo.html",
"resetComplete": "lteCamera/resetComplete.html",
"syncComplete": "lteCamera/syncComplete.html"
}
},
{
"deviceType": "arloqs",
"modelId": [
"VMC3040S"
],
"urls": {
"ethernetSetup": "arloqs/ethernetSetup.html",
"troubleshoot": "arloqs/troubleshoot.html",
"plugin": "arloqs/plugin.html",
"poeSetup": "arloqs/poeSetup.html",
"connectionInProgressWiFi": "arloqs/connectionInProgressWifi.html",
"qrHowTo": "arloqs/qrHowTo.html",
"connectionInProgress": "arloqs/connectionInProgress.html",
"connectionFailed": "arloqs/connectionFailed.html",
"pressSync": "arloqs/pressSync.html",