-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Support for Access control? #43
Comments
Hi @robby-dermody! I do have plans to add support for this, but I can not promise when that would be. Feel free to open PRs to support these devices functionality. |
Sounds good, thank you! |
@Kane610 - Didn't want to open up a new issue, so I'm commenting here. I've been reading through your code and am interested in doing some work and submitting a PR to support A1001, but I'm newer to Python (I'm a .NET turned Java guy) and haven't been able to find good tutorials/documentation related to VAPIX. Do you have any recommended resources on VAPIX or guidance on where to start that would let me create a CLI app that uses this library as a dependency so I can get started to add in lock controls and door lock states? I've gotten as a far as installing PyCharm as I'm a JetBrains fanatic. Thanks! |
Hey! Awesome! When I'm adding a new API I usually augment the main function so I can just run everything from the commandline directly, ideally the main function would be a bit more advanced to offer some more CLI friendly controls. Regarding documentation you have the official API documentation here https://www.axis.com/vapix-library/subjects/t10067552/section/t10068742/display But in my experience you really need a device to try it out with, that also helps adding tests to improve iterating on it once you've got the basics implemented. Make sure to base your implementation on the latest firmware available, the API documentation typically only reflects the latest released version of the API. I just wrapped up keypad support for the deCONZ integration a couple of weeks back so I'm also eager to get something similar running with the Axis integration. Right now I'm finishing up my libraries to make sure dependencies and CI tools are helping out with verification and will also add proper typing before I go back to adding additional functionality. Don't hesitate to ping me, we can also iterate quicker over discord should you prefer. Reopening this issue in the mean time. |
Thanks! I have access to two A1001s and I'm hoping to spend some time looking into it this weekend. |
Awesome! I will look into the different access control APIs as well |
So, I've got the code connecting to my A1001 and -D is showing me params, but I'm getting a 404 when it tries to
I haven't gotten too far, but I'm guessing that's a pretty integral part of the process, being able to discover what APIs are supported? It doesn't seem to exist when looking through the device's cgi scripts, but I can get params.cgi. |
404s are expected to exist when talking to different devices with different feature sets. Older devices don't support API Discovery so its completely fine. Line 39 in f3e8b93
Line 132 in f3e8b93
|
Great, thanks. I've been able to do some figuring out of how to perform actions through VAPIX to get the basics of what I'm after (unlocking a door via button and getting door lock/unlock status). There's more than that available, but I at least have a good idea on how to make the right requests via Postman. Just need to figure out how to bring those actions into this code. I see how you're capturing events through VAPIX. I don't see anything where the library issues actions through VAPIX. Does that sound accurate? |
Awesome! Exciting to see what you come up with! There are loads of examples controlling different parts of the device through Vapix Enable MQTT service in device Line 108 in f3e8b93
Activate a specific light Line 55 in f3e8b93
Set state of port (new API) Line 163 in f3e8b93
Set state of port (old API) Line 92 in f3e8b93
I'm up for general suggestions on how to improve the library as a whole. I'm trying to reflect changes in a way so my libraries for both deCONZ and UniFi are similar. I've done a lot of refactorings and improvements over the year where I've learned something with one of the libraries and then try to reflect the same changes in the other ones. |
Thanks - sorry to be the newbie on this code, but it's my foray into a real Python library. 🤦♂️ I only thought that it wasn't using VAPIX because this URL was calling a cgi script where the A1001 would be calling /vapix/doorcontrol I'll have more time later this week to look through it more. Line 11 in f3e8b93
I'm not the best person from an architecture perspective, but I'll make any suggestions if I come up with some. (I've been working as a DBA for the past 3 years, which has left a bunch of coding experience more stagnant than I'd like) |
No worries, I'm excited to have you just experimenting :) Everything is Vapix, it's the branding of the APIs of Axis devices. |
I made some progress on putting together the basics for defining API calls that I think will be useful and also associated tests. If you have a minute, take a look at progress so far, I'm not sure of exact next steps, but I think I need to understand how to help HA discover the available services. |
Hey! Looked at it and the documentation a bit, overall it looks good! Awesome job! I do have comments, but nothing major. I'm contemplating if this should be put under a /access_control folder similar to applications Once I'm finished with the typing PR you will need to rebase and follow the additional tests performed (nothing major) |
Thanks, I wasn't quite clear on that, but decided to mimic stuff that I was seeing in light_control.
Definitely had that in the back of my head and will do that. Would that look something like below on the door class for each capability that we want to be able to use? |
I'm not sure, haven't had many capabilities like this before. What do you think? It would either be class methods like you post or globals like Line 16 in 5c1d9a2
|
Oh I see what you mean. I like the globals better, I'll work on that. Although there are a lot of capabilities, there's only a select few that will likely be useful for users. "Access" is probably the most used one, in order to allow a user to just unlock the door temporarily. That's actually the only one that I can think of currently that I need for my use case, but thought it good to just build the other ones out as other people might want them in the future. |
Feel free to publish your PR, it might be better to contain this discussion to that rather than in this issue |
Published #90 |
I'm wondering what would be the best path forward in trying to get support added for the Axis A1001? I have access to one for testing and have done some programming in python. |
I want to do this some time in the future as Drew couldn't complete it. But right now I'm focused on other things than access control. So if you can adapt Drew's or to work with latest version of the library world be a good start. If you have the patience I will help you move forward |
Hi - my apologies! - yes I totally lost track of this due to life circumstances and ended up directly using a command line integration in HA and curl command to accomplish what I needed. I was also pretty new to Python at the time. I’d offer to pick it back up, but I have little time for side projects right now. All my progress should be clear in my PR, I didn’t have any modifications that I didn’t push to that. |
Hi, just found this library. I have a A1001 door controller and tested the current state of the HomeAssistant integration. It appears that I can get a few states off of it, but no lock control (e.g. as switch entities) came across. It would be wonderful to be able to both discover and control the door lock state(s) for configured doors (as well as doors configured on additional connected/linked door controllers). Is this a planned feature? If not, I can look into adding it once I have some spare time.
(I also connected to an A8207VE MkII keypad/cam device, which was integrated via VAPIX to the aforementioned door controller -- I can see more information, including PIR state, camera feed and door status, however, I cannot operate the door lock through that as well. Being able to operate the door directly through a connection to the door controller(s) themselves would be optimal.)
The text was updated successfully, but these errors were encountered: