Closed TaZZaT closed 3 years ago
Quick note:
if I change things around in arlo.py for the CustomMode function this works -->
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}})
This cause the error above -->
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}]})
I'm thinking arlo's site is now looking for additional parameters or the "if"statement is not determining my system correctly (aka --> if(device["deviceType"].startswith("arloq")):).
@TaZZaT I'll take a look at this soon,. Feel free to submit a PR to fix it.
Fixed ✌️
@neilferreira Thank you!
This should be fixed with the latest release (1.2.50).
Looks like Im having a similar issue @TaZZaT . When I swap out the CustomMode with your snippet it works (for a basestation)
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}})
however, I didnt see a change to that line https://github.com/jeffreydwalter/arlo/blame/master/arlo.py#L551
@neilferreira what was the fix?
@cgmckeever the fix was to set the schemaVersion header. I do that when you successfully authenticate. https://github.com/jeffreydwalter/arlo/blob/edbd17fb8ab60b1d5d36354c52f4ddb0966a9514/arlo.py#L186
odd, Im having the exact issue and I think I pulled the latest
Requirement already satisfied: arlo in /usr/local/lib/python3.9/site-packages (1.2.57)
Using the suggested snippet seems to resolve it.
self.NotifyAndGetResponse
Please answer these questions before submitting your issue. Thanks!
What version of Python are you using (
python -V
)?Python 2.7.16
What operating system and processor architecture are you using (
python -c 'import platform; print(platform.uname());'
)?('Linux', 'raspberrypi', '5.10.11-v7+', '#1399 SMP Thu Jan 28 12:06:05 GMT 2021', 'armv7l', '')
Which Python packages do you have installed (run the
pip freeze
orpip3 freeze
command and paste output)?Paste your output here built with gcc 8 (Raspbian 8.3.0-6+rpi1) configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --libdir=/usr/lib/arm-linux-gnueabihf --cpu=arm1176jzf-s --arch=arm libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100
Which Arlo hardware do you have (camera types - [Arlo, Pro, Q, etc.], basestation model, etc.)?
Pro
What did you do?
When I call arlo.CustomMode(basestations[0], mode) I've created a small web server that sends mode changes to Arlo using Arlo.py examples...
Send a GET request::
If possible, provide the steps you took to reproduce the issue. curl http://localhost:8888/mode3
A complete runnable program is good. (don't include your user/password or any sensitive info)
Paste your ouptut here Exception happened during processing of request from ('127.0.0.1', 33690) Traceback (most recent call last): File "/usr/lib/python2.7/SocketServer.py", line 293, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request self.finish_request(request, client_address) File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib/python2.7/SocketServer.py", line 655, in init self.handle() File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle self.handle_one_request() File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request method() File "/home/pi/arlo/arlo_mode_2.py", line 72, in do_GET arlo.CustomMode(basestations[0], mode) File "/usr/local/lib/python2.7/dist-packages/arlo.py", line 435, in CustomMode 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}]}) File "/usr/local/lib/python2.7/dist-packages/request.py", line 61, in post return self._request(url, 'POST', params, headers, raw) File "/usr/local/lib/python2.7/dist-packages/request.py", line 52, in _request raise HTTPError('Request ({0} {1}) failed: {2}'.format(method, url, r.json()), response=r) HTTPError: Request (POST https://my.arlo.com/hmsweb/users/devices/automation/active) failed: {u'data': {u'message': u'Failed to update Automation Definitions', u'reason': u'Unable to upload active automation. Please try again', u'error': u'AUTO-5050'}, u'success': False}
What did you expect to see?
Paste your ouptut here Should return the mode I selected e.g. mode3
What did you see instead?