Kane610 / aiounifi

Asynchronous library to communicate with Unifi Controller
MIT License
57 stars 49 forks source link

WAN stats for unifi controller #557

Open Paktas opened 6 months ago

Paktas commented 6 months ago

Would like to see WAN statistics for Unifi Controller:

  1. TX
  2. RX
  3. IP
  4. Uptime

These are the Main components of any network and should be available for users.

As per UNIFI API wiki there are 2 ways to get it:

  1. api/stat/sites | GET | Get basic information for all sites on this controller with an additional information on health and new alerts for each site.

  2. stat/report/{interval}.{type} | POST | Intervals are '5minutes', 'hourly', and 'daily'. Report types are 'site', 'user', and 'ap'. Must specify attributes to be returned 'bytes', 'wan-tx_bytes', 'wan-rx_bytes', 'wlan_bytes', 'num_sta', 'lan-num_sta', 'wlan-num_sta', 'time', 'rx_bytes', 'tx_bytes'. Can be filtered with 'macs': […]

A similar JSON response is generated: image

Requested in other places:

Kane610 commented 5 months ago

Thanks for this detailed request. I'm a bit preoccupied with other things right now so I can't promise when I can get to this

Kane610 commented 2 months ago

RX and TX has been merged and will be available with 2024.5.0 release, it's done by providing data for all ports for all devices so you can yourself select what data is interesting. Please try out the beta