Open cgmckeever opened 1 year ago
I think the error starts here
def CustomMode(self, device, mode, schedules=[]):
""" device can be any object that has parentId == deviceId. i.e., not a camera """
parentId = device.get('parentId', None)
if device.get('deviceType') == 'arlobridge':
return self.request.post(f'https://{self.BASE_URL}/hmsweb/users/devices/automation/active', {'activeAutomations':[{'deviceId':device.get('deviceId'),'timestamp':self.to_timestamp(datetime.now()),'activeModes':[mode],'activeSchedules':schedules}]})
elif not parentId or device.get('deviceId') == parentId:
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:
raise Exception('Only parent device modes and schedules can be modified.')
where my device type is 'deviceType': 'basestation'
and if I INSPECT the web-ui call it is in-fact making a call to /users/devices/automation/active
(as opposed to using the self.NotifyAndGetResponse
path)
however, short circuiting the device check and using self.request.post
also brings up new errors ... looking
self.NotifyAndGetResponse
(from above) Just appears to sit on
DEBUG:urllib3.connectionpool:https://myapi.arlo.com:443 "POST /hmsweb/users/devices/notify/4R058A7NB5F33 HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:https://myapi.arlo.com:443 "POST /hmsweb/users/devices/notify/4R058A7NB5F33 HTTP/1.1" 200 None
Hello, thank you for your PR! I made a branch to test out your changes and made some modifications to your proposed solution. Would you mind pulling down this branch and seeing if it works for you? https://github.com/jeffreydwalter/arlo/tree/fix-custom-mode
My basestation died so, I don't actually have any working Arlo cameras anymore. :(
I will test shorty, but .. just looking at it, earlier I could not get it to work till I added the schema line .. but maybe you have another change in there accomplishing similar ...
and Ive said in the past -- I would totally send you a basestation ;)
I get this
{"error": 401 Client Error: Unauthorized for url: https://myapi.arlo.com/hmsweb/users/devices}
even for something that had worked prior to the hotfix/PR I made
https://github.com/cgmckeever/smartthings/blob/master/arlo-util/www/cgi-bin/checkup.py
@jeffreydwalter any thoughts on this?
Hello, thank you for your PR! I made a branch to test out your changes and made some modifications to your proposed solution. Would you mind pulling down this branch and seeing if it works for you? https://github.com/jeffreydwalter/arlo/tree/fix-custom-mode
I had tried that and I got
{"error": 401 Client Error: Unauthorized for url: https://myapi.arlo.com/hmsweb/users/devices}
My earlier PR seems to work, but probably is not the clean way to do it ;)
Was using 1.2.58, mode changing seemed to stop in the last week. Noticed that 1.2.61 came out, thought it might resolve an issue .. same issue continued
Web login for the user allows all these functions described.
Code appear to be able to:
arlo.GetDevices
orarlo.GetDevice
Code fails (more code below as well)
What version of Python are you using (
python -V
)?Python 3.8.12
What operating system and processor architecture are you using (
python -c 'import platform; print(platform.uname());'
)?Dockerized Python Slim https://github.com/cgmckeever/smartthings/blob/master/arlo-util/Dockerfile ** update for
1.2.61
Which Python packages do you have installed (run the
pip freeze
orpip3 freeze
command and paste output)?Which version of ffmpeg are you using (
ffmpeg -version
)?Which Arlo hardware do you have (camera types - [Arlo, Pro, Q, etc.], basestation model, etc.)?
VMB4000-siren
Pro2What did you do?
If possible, provide the steps you took to reproduce the issue. A complete runnable program is good. (don't include your user/password or any sensitive info)
pip install -I arlo==1.2.61
What did you expect to see?
Change the mode
What did you see instead?
Hangs
Does this issue reproduce with the latest release?