Comments (19)
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.
from axis.
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
from axis.
No worries, I'm excited to have you just experimenting :)
Everything is Vapix, it's the branding of the APIs of Axis devices.
from axis.
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.
from axis.
Sounds good, thank you!
from axis.
@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!
from axis.
Thanks! I have access to two A1001s and I'm hoping to spend some time looking into it this weekend.
from axis.
Awesome! I will look into the different access control APIs as well
from axis.
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
POST http://<mydeviceip>/axis-cgi/apidiscovery.cgi
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.
from axis.
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?
from axis.
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.
from axis.
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)
from axis.
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.
master...drewclauson:add-door-control
from axis.
Hey! Looked at it and the documentation a bit, overall it looks good! Awesome job!
I do have comments, but nothing major.
E.g. door_control in param_cgi.py is superfluous since you have the api discovery mechanism stated, so one can always look in api discovery or check if door_control is None to see if it is supported.
Big groups of properties inside of a dict (device and door capabilities) should probably be clarified with global strings to avoid manually specifying keys in home assistant or other places the library is used.
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)
from axis.
E.g. door_control in param_cgi.py is superfluous since you have the api discovery mechanism stated, so one can always look in api discovery or check if door_control is None to see if it is supported.
Thanks, I wasn't quite clear on that, but decided to mimic stuff that I was seeing in light_control.
Big groups of properties inside of a dict (device and door capabilities) should probably be clarified with global strings to avoid manually specifying keys in home assistant or other places the library is used.
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?
from axis.
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
from axis.
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.
from axis.
Feel free to publish your PR, it might be better to contain this discussion to that rather than in this issue
from axis.
Published #90
from axis.
Related Issues (20)
- Axis f34 HOT 1
- rtsp streaming player window HOT 3
- Support for speakers as media_player entity in HA HOT 10
- Server disconnected without sending a response HOT 13
- HTTPS support HOT 6
- Axis problem with post command HOT 1
- Websocket support HOT 1
- Enable/disable automations
- sending command to enable/disable an action rule
- Axis cameras (Companion line) - solved by kimjohnson
- Add PTZ, zoom and preset positions to Axis camera integration
- Pytest picked
- Companion line support
- Axis M1031-W keeps trying to connect to the default IP and spamming the logs
- Cannot view RTSP stream Axis M3106-LVE
- Axis integration, motion sensors randomly stops reporting
- New device class doorbell needed to resolve homekit issue
- Debouncing HA state updates
- Axis camera motion sensor becomes unavailable
- Feature request of PTZ commands and preset positions in Axis cameras HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from axis.