Giter Site home page Giter Site logo

tp-link-omada-clients-list's Introduction

TP-Link-Omada-Clients-List

PHP Script to get connected devices with Omada Controller by your EAP accesspoints. I use this script to check the state of my wifi devices and control my homeautomation.

The script is not perfect but it works. Help, wishes, improvements are welcome.

BETA version - working (support/help wanted)

Preface: Unifi Originally I had Unifi hardware in use, there you could query the individual access points or the controller via SSH, which clients are connected. Omada access points support SSH (after activation) but do not offer a command to query the connected clients. You always have to query via the Omada software controller.

API The controller version seems to be very important, as not all endpoints always work in every version. The documentation is hard to find, I uploaded a file of another API version (might be helpful). Link to API documentation

System-Information

  • Omada Version 5.4.6 (running at Debian 11 on Proxmox VM)
  • EAP610 accesspoints

HOW-TO

  1. login to your omada controller with Google chrome
  2. (optionally) create a new user (role: viewer) and grant access to site
  3. open DevTools in Chrome and open 'Network' tab
  4. select 'Clients' Page on Omada Controller
  5. wait in DevTools to see an entry like 'clients?currentPage=1..."
  6. right click on that entry and save as HAR
  7. open HAR file with editor and search for 'clients?'
  8. you find an entry: ... api/v2/sites/SITE-ID/clients?currentPage=1 ...
  9. not the SITE-ID an enter it to the clients.php script
  10. modify the clients.php script and set the environment variables (ip, user, password)

Problems / restrictions / To-Do:

  • only the first 100 clients are returned (tested with GetClients(1,100)
  • only pagesizes from omada webinterface are working!
  • having 28 clients: tested GetClients(1,10), GetClients(2,10), GetClients(3,10) where the last two returned the same results (hint for fetched all?)
  • errorhandling / optimize programflow
  • automation of getting site-id
  • reuse cookies until expiring
  • clients disconnected for long time don't show up in list (you have to temporary fix this if your homeautomation needs the json entry, modify output, add entry with state 'off')

Helpful

thanks to mbentley and his shell script

Thoughts

  1. /api/v2/sites/Default/clients/CLIENT-MAC-ADDRESS thows error
  2. /api/v2/sites does not work to get site-id

tp-link-omada-clients-list's People

Contributors

markusuidl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.