-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update for use with NVR Beta software #1
Conversation
@@ -19,6 +19,8 @@ Hopefully this is enough to get you going:: | |||
-v, --verbose | |||
-d, --dump | |||
-u UUID, --uuid=UUID Camera UUID | |||
-i id, --id=id Camera Connection id | |||
-c, --connect_with_id Connect using id instead of UUID (NVR Beta API) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to detect the newer version somehow and always use the id if necessary, right? Do you know if the older versions allow use of the _id value in place of the uuid? If so, it might be easier to just do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The api path is the same... 2.0 I can try to pull more data out of the api but I am just capturing data with chrome since the api is not documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but that's just the major version. Although they definitely shouldn't be breaking something like this without a major bump, it would be quite a deal to change the version in the url.
Looks like this path will get you lots of data:
http://192.168.1.10:7080/api/2.0/bootstrap
Which includes data[0]['systemInfo'] which has a version in it. Let's just check to see if that is >= 3.2 and use the ID in that case, okay? We should probably be polling that on first connect anyway and exposing it to the client user anyway. Let me know if you want me to do that bit first and I'll be glad to so you can build on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take a look... There is also changes in the login and getsnapshot for cameras... I have login working but have not figured out the right api call to get snapshot from the camera. The fallback of getting a snapshot through the nvr still works, but the homeassistant module does not have that fallback implemented.
So I will try to find some similar information from the cameras themselves to determine how we should log in and take snapshots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'm surprised, hadn't really seen a change in the login/snapshot API through multiple major revs of the software. I hope this isn't a sign of more breaking changes to come :/
Hi, thanks for working on this. I don't run the beta so I didn't know this was broken. I have no idea why ubiquiti would change this.. I wonder if it's a known bug and will be fixed for the release.. have you seen any documentation indicating that this is intentional? Also, I'd really like to avoid having to tell the client whether to use the id or the uuid. If they expose some software version then we should check that, or if all else fails, probe somehow by trying a uuid and then an id or something like that. Thanks! |
Since its beta and this is an unpublished api... I assume that they are not worried about breaking clients. Anyway, with the bootstrap information we can make the client intelligent on when to use uuid and when to use id. I have also figured out the api/1.1 for cameras to get snapshots. I will look into updating settings as well. It will probably take me till next weekend to get enough time to do it all, but the good news is that I hacked it all together tonight and Homeassistant is working! |
Cool, thanks! |
Using a UVC Micro I see this: |
This makes us resolve names to the 'id' instead of 'uuid' for newer versions of the NVR server software. Fixes most of #1
Hi guys, I just pushed a couple changes that should fix things. I just upgraded my camera server to 3.2.x and made the changes necessary for things to keep working. If you find other stuff, please open another issue! |
The beta NVR software has an API change where
_id
is used instead ofuuid
to connect to camera's over the api. This PR introduces the option to pass aid
flag and a flag that that allows a user to specify to use the connection id vs the uuid.After this is merged I will update the Homeassistant component configuration to allow for this flag. This will allow users like myself that use the NVR beta software to use homeassistant with our Cameras.