-
Notifications
You must be signed in to change notification settings - Fork 0
Catalog pertinent device info available from hostifi #11
Comments
Taking this on and keeping some notes here:
|
Quick update on a couple things I tried yesterday: node-unifi didn't work well because of what seemed to be missing modules, but after installing and researching has to do with webpack not playing nicely with some modules. Errors like the one below for http, https, util and other modules. Module not found: Error: Can't resolve 'util' in '/home/onion/www/PCW_map/node_modules/tough-cookie/lib' Same with https://github.com/oddbit/unifi-js Also, I'm new to typescript and was constantly breaking typed things. Need a few free days sometimes to familiarize myself on that front. But I started a non ts gatsby project and same issues. So will pick this up again once I have a bit of time. But my plan from here on out is to look closer at API calls I see here:
Possibly just copy those into a react component or experiment with the API calls in there. @dzygmundfelt you mentioned you wanted to look into that last night. Please update if you get anywhere. |
Also useful for sussing the API: |
The first link was super helpful, and I'm querying Unifi via http calls in Postman. The call to this endpoint
with json body like
seems to be how we can get time-chunked reports of network activity. You can also pass start and end times to that call.
brought back some interesting stuff about data retention times
that could clue us in to how often we'd want to grab these reports. More broadly, I think we ought to decide on a couple of stats that we want to collect so that we can automate pulling them. Also this ticket is in the map project, but I feel like lately we've been talking more about collecting Unifi Controller stats as a separate thing. |
Also want to reference https://github.com/Art-of-WiFi/UniFi-API-client/blob/master/src/Client.php, which is some more good documentation. |
ahh that's great. Just wanted to mention I think I realized just after commenting, the libraries I failed at getting working seem to work in node but not in the browser. In gatsby there's a file usually used for generating pages that runs on build and run node. gatsby-node.js in the root dir : https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/ |
Some possible API tidbits for consideration (and totally up for debate) from Allan: data pulls
|
Just noting two key files for this project:
|
The text was updated successfully, but these errors were encountered: