-
Notifications
You must be signed in to change notification settings - Fork 212
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
rx_bytes incorrect, or conversion, or user/PEBKAC issue? #30
Comments
It takes a while after the end of each day for its daily stats to populate so that explains why you don't yet see the 5th in the chart. Switch to hourly stats and you will see stats up the last full hour. Regarding the use of the stat_sessions() method, you do need to provide the correct number of parameters, otherwise, PHP will assume the only provided value must be assigned to the first parameter. If you do it like so: //stat_sessions($start = null, $end = null, $mac = null, $type = 'all');
$unifi_connection->stat_sessions(null, null, $mac) will return the session collection for the device with MAC address $mac for the past week (7*24 hours). If you wish to see them for a different timeframe, simply pass the required start and end Unix timestamps in seconds. See the code comments here: See this site for some explanation and tools regarding Unix (or epoch) time(stamps): |
Issue appears to be resolved, now closing. Feel free to re-open if needed. |
I'm using the client to pull the download data of a given device, and I must be missing something very simple. The goal will be "run once daily, check amount, and if amount > 100MB then do X".
Using
stat_daily_user
, and the following very simple code, the data seems to not match the Controller report (5.9.29, with a USG3). 5 minute data is set to 1 day retention. I did change the function to be 24 hours instead of 12 but I was seeing the same thing before. I'm rusty at PHP so I could be making a bonehead mistake. :) I did check the MAC was the right one, twice. I've replaced the actual MAC withsecret_mac_here
.returns
I read that as "35MB". The controller shows:
which is obviously quite different.
Am I missing a conversion somewhere or completely misunderstanding how the controller renders things, or any number of other newbie issues?
Thanks! This was unbelievably easy to get started with. Also having problems with understanding the conversion of the time but that's another story and quite less important I think.
Here's the json dump:
The text was updated successfully, but these errors were encountered: