jeffreydwalter / arlo

Python module for interacting with Netgear's Arlo camera system.
Apache License 2.0
517 stars 124 forks source link

Arm/Disarm Throws an error - Validated Auth/MFA was successful #183

Closed cgmckeever closed 2 years ago

cgmckeever commented 2 years ago

Which Arlo hardware do you have (camera types - [Arlo, Pro, Q, etc.], basestation model, etc.)?

Arlo Pro

What did you do?

Trying to use the Arm/Disarm example with the following code.

    arlo = Arlo(USERNAME, PASSWORD, "gmail.credentials")
    # At this point you're logged into Arlo.

    # Get the list of devices and filter on device type to only get the basestation.
    # This will return an array which includes all of the basestation's associated metadata.
    basestations = arlo.GetDevices('basestation')
    print(basestations)

    # Arm Arlo.
    arlo.Arm(basestations[0])

What did you expect to see?

Proper mode change

What did you see instead?

Verified that the basestations = arlo.GetDevices('basestation') does return a device object that has the proper device

Request (POST https://myapi.arlo.com/hmsweb/users/devices/automation/active) failed: {'data': {'error': 'AUTO-5050', 'message': 'Failed to update Automation Definitions', 'reason': 'Unable to upload active automation. Please try again'}, 'success': False}

Does this issue reproduce with the latest release?

I believe so

Requirement already satisfied: arlo in /usr/local/lib/python3.9/site-packages (1.2.57)
cgmckeever commented 2 years ago

Looks like it may be the same issue as https://github.com/jeffreydwalter/arlo/issues/168 Which gets fixes with changing that call (as describe in the issue), but I dont see that change reflected in the mainline branch

jeffreydwalter commented 2 years ago

@cgmckeever if you want help, please fill out the entire set of questions in the template. Also, run this script https://github.com/jeffreydwalter/arlo/wiki/Arlo-Hardware-Schemas#overview and paste the output in your description.

cgmckeever commented 2 years ago

still broken, but the fix from the other issue resolved it. Closing

jeffreydwalter commented 2 years ago

@cgmckeever glad to hear it's working and thank you for the ๐Ÿบs! Is there a code change that needs to be made to the library? What was your fix?

cgmckeever commented 2 years ago

I had to revert the CustomMode call to use

            #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}]})
            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}})
jeffreydwalter commented 2 years ago

Would you mind running that little script from my wiki (https://github.com/jeffreydwalter/arlo/wiki/Arlo-Hardware-Schemas#overview) and pasting the output here so I can figure out why that function is choosing the wrong method to call? It just prints out your device metadata, with all the sensitive info obfuscated. I would greatly appreciate it!

cgmckeever commented 2 years ago

Yep -- will do now .. FWIW .. this is my environment, which is a pretty vanilla docker

FROM python:3.8-slim-buster

RUN pip install arlo

The rest is just my a (semi) more cleaned up version of the arm code above.

Will post that output shortly

cgmckeever commented 2 years ago
[
{
"cvrEnabled": false,
"dateCreated": 1639253036429,
"deviceId": "XXXXXXXXXXXXX",
"deviceName": "",
"deviceType": "siren",
"displayOrder": 1,
"lastModified": 1641263607202,
"mediaObjectCount": 0,
"modelId": "VMB4000-siren",
"owner": {
"firstName": "",
"lastName": "",
"ownerId": "XXXX-XXX-XXXXXXXX"
},
"parentId": "XXXXXXXXXXXXX",
"presignedFullFrameSnapshotUrl": "",
"presignedLastImageUrl": "",
"presignedSnapshotUrl": "",
"properties": {
"modelId": "VMB4000-siren",
"olsonTimeZone": "America/Chicago"
},
"state": "provisioned",
"timeZone": "America/Chicago",
"uniqueId": "XXXX-XXX-XXXXXXXX_XXXXXXXXXXXXX#X",
"userId": "XXXX-XXX-XXXXXXXX",
"userRole": "ADMIN",
"xCloudId": "XXXXXX-XXXX-XXX-XXXXXXXXX"
},
{
"arloMobilePlan": false,
"cvrEnabled": false,
"dateCreated": 1554578316831,
"deviceId": "XXXXXXXXXXXXX",
"deviceName": "",
"deviceType": "camera",
"displayOrder": 2,
"interfaceSchemaVer": "1",
"interfaceVersion": "i009",
"lastImageUploaded": "true",
"lastModified": 1641263607202,
"mediaObjectCount": 9,
"modelId": "VMC4030P",
"owner": {
"firstName": "",
"lastName": "",
"ownerId": "XXXX-XXX-XXXXXXXX"
},
"parentId": "XXXXXXXXXXXXX",
"presignedFullFrameSnapshotUrl": "",
"presignedLastImageUrl": "",
"presignedSnapshotUrl": "",
"properties": {
"hwVersion": "H4",
"modelId": "VMC4030P",
"olsonTimeZone": null
},
"state": "provisioned",
"uniqueId": "XXXX-XXX-XXXXXXXX_XXXXXXXXXXXXX",
"userId": "XXXX-XXX-XXXXXXXX",
"userRole": "ADMIN",
"xCloudId": "XXXXXX-XXXX-XXX-XXXXXXXXX"
},
{
"arloMobilePlan": false,
"cvrEnabled": false,
"dateCreated": 1553994780030,
"deviceId": "XXXXXXXXXXXXX",
"deviceName": "",
"deviceType": "camera",
"displayOrder": 3,
"interfaceSchemaVer": "1",
"interfaceVersion": "i009",
"lastImageUploaded": "true",
"lastModified": 1641263607202,
"mediaObjectCount": 8,
"modelId": "VMC4030P",
"owner": {
"firstName": "",
"lastName": "",
"ownerId": "XXXX-XXX-XXXXXXXX"
},
"parentId": "XXXXXXXXXXXXX",
"presignedFullFrameSnapshotUrl": "",
"presignedLastImageUrl": "",
"presignedSnapshotUrl": "",
"properties": {
"hwVersion": "H3",
"modelId": "VMC4030P",
"olsonTimeZone": "America/Chicago"
},
"state": "provisioned",
"timeZone": "America/Chicago",
"uniqueId": "XXXX-XXX-XXXXXXXX_XXXXXXXXXXXXX",
"userId": "XXXX-XXX-XXXXXXXX",
"userRole": "ADMIN",
"xCloudId": "XXXXXX-XXXX-XXX-XXXXXXXXX"
},
{
"arloMobilePlan": false,
"cvrEnabled": false,
"dateCreated": 1553989199154,
"deviceId": "XXXXXXXXXXXXX",
"deviceName": "",
"deviceType": "camera",
"displayOrder": 4,
"interfaceSchemaVer": "1",
"interfaceVersion": "i009",
"lastImageUploaded": "true",
"lastModified": 1641263607202,
"mediaObjectCount": 13,
"modelId": "VMC4030P",
"owner": {
"firstName": "",
"lastName": "",
"ownerId": "XXXX-XXX-XXXXXXXX"
},
"parentId": "XXXXXXXXXXXXX",
"presignedFullFrameSnapshotUrl": "",
"presignedLastImageUrl": "",
"presignedSnapshotUrl": "",
"properties": {
"hwVersion": "H3",
"modelId": "VMC4030P",
"olsonTimeZone": "America/Chicago"
},
"state": "provisioned",
"timeZone": "America/Chicago",
"uniqueId": "XXXX-XXX-XXXXXXXX_XXXXXXXXXXXXX",
"userId": "XXXX-XXX-XXXXXXXX",
"userRole": "ADMIN",
"xCloudId": "XXXXXX-XXXX-XXX-XXXXXXXXX"
},
{
"arloMobilePlan": false,
"cvrEnabled": false,
"dateCreated": 1553989282360,
"deviceId": "XXXXXXXXXXXXX",
"deviceName": "",
"deviceType": "camera",
"displayOrder": 5,
"interfaceSchemaVer": "1",
"interfaceVersion": "i009",
"lastImageUploaded": "true",
"lastModified": 1641263607202,
"mediaObjectCount": 9,
"modelId": "VMC4030P",
"owner": {
"firstName": "",
"lastName": "",
"ownerId": "XXXX-XXX-XXXXXXXX"
},
"parentId": "XXXXXXXXXXXXX",
"presignedFullFrameSnapshotUrl": "",
"presignedLastImageUrl": "",
"presignedSnapshotUrl": "",
"properties": {
"hwVersion": "H3",
"modelId": "VMC4030P",
"olsonTimeZone": null
},
"state": "provisioned",
"uniqueId": "XXXX-XXX-XXXXXXXX_XXXXXXXXXXXXX",
"userId": "XXXX-XXX-XXXXXXXX",
"userRole": "ADMIN",
"xCloudId": "XXXXXX-XXXX-XXX-XXXXXXXXX"
},
{
"automationRevision": 20,
"certAvailable": true,
"connectivity": {
"connected": true,
"mepStatus": "unknown",
"type": "ethernet"
},
"cvrEnabled": false,
"dateCreated": 1553988384655,
"deviceId": "XXXXXXXXXXXXX",
"deviceName": "",
"deviceType": "basestation",
"displayOrder": 2,
"firmwareVersion": "1.17.0.0_3953_6ba79e5",
"interfaceSchemaVer": "17",
"interfaceVersion": "i028",
"lastModified": 1641263607230,
"mediaObjectCount": 0,
"migrateActivityZone": false,
"modelId": "VMB4000",
"owner": {
"firstName": "",
"lastName": "",
"ownerId": "XXXX-XXX-XXXXXXXX"
},
"presignedFullFrameSnapshotUrl": "",
"presignedLastImageUrl": "",
"presignedSnapshotUrl": "",
"properties": {
"hwVersion": "VMB4000r3",
"modelId": "VMB4000",
"olsonTimeZone": "America/Chicago"
},
"state": "provisioned",
"timeZone": "America/Chicago",
"uniqueId": "XXXX-XXX-XXXXXXXX_XXXXXXXXXXXXX",
"userId": "XXXX-XXX-XXXXXXXX",
"userRole": "ADMIN",
"xCloudId": "XXXXXX-XXXX-XXX-XXXXXXXXX"
}
]
jeffreydwalter commented 2 years ago

Awesome, thank you! Will you please try the release I just published (1.2.58) and let me know if it works for you? Thanks again!

cgmckeever commented 2 years ago

Grabbing

cgmckeever commented 2 years ago

pip is still finding 1.2.57 do you know a way to force it to grab something newer?

cgmckeever commented 2 years ago

got it

Requirement already satisfied: arlo in /usr/local/lib/python3.8/site-packages (1.2.58)
jeffreydwalter commented 2 years ago

Awesome, guess it takes a minute to show up after I publish. ๐Ÿคท๐Ÿป

cgmckeever commented 2 years ago

That appears to have solved it ...

jeffreydwalter commented 2 years ago

Awesome! Thank you for confirming! ๐Ÿ’ช๐Ÿป And thanks again for the ๐Ÿบ !

cgmckeever commented 2 years ago

What was the fix? I see some Timestamp changes?

jeffreydwalter commented 2 years ago

https://github.com/jeffreydwalter/arlo/commit/50d14cf8bcab1e7b052954415d77d6c1917ac136

Someone submitted support for arloq there and I merged it in without really looking at it. My basestation gave up the goose, so I don't have any arlo cameras anymore. ๐Ÿคท๐Ÿป

cgmckeever commented 2 years ago

ah, there you go .. WAIT -- and you are still supporting this? THANK YOU

jeffreydwalter commented 2 years ago

Happy to help! It's kinda my baby. These days I do it for the people and the... ๐Ÿบ ๐Ÿบ ๐Ÿบ ! lolz ๐Ÿ˜‚ Cheers!

cgmckeever commented 2 years ago

Thanks again for building this .. The community needs to get you a new basestation! .. Someone has to have a spare one