UniFi Client Manager - Automation Scripts for UDM Console
A collection of Python scripts for automating UniFi network client management, including bulk updates, IP assignments, and client cleanup capabilities.
I recently faced the challenge of rebuilding my UniFi network from scratch, managing over 30 devices and 250+ clients. During this process, I encountered a setup error that added over 1,100 invalid clients to my network. Rather than spending hours manually cleaning up and reconfiguring everything, I developed a solution that I'm excited to share with the homelab community.
The Challenge
When you've spent years fine-tuning your network and client lists, manually re-entering all that information can be incredibly time-consuming. The situation became even more complex when a setup error populated my network with over 1,100 unwanted clients. After searching for existing bulk management solutions and finding only outdated or non-functional tools, I decided to create my own.
Introducing UniFi Client Manager
I developed a set of Python scripts called "UniFi Client Manager" that interfaces with the UniFi Controller API to automate common management tasks. The toolkit provides several key features:
- Bulk update of client names and fixed IP assignments using CSV data
- Mass removal of devices using MAC addresses from a CSV file
- API endpoint connectivity testing and validation
- Export capabilities for active clients, historic clients, and UniFi devices
Recent Updates
Based on community feedback from the Ubiquiti Facebook group, I've expanded the project's capabilities to include new export features. These additions allow users to:
- Export active client lists to CSV
- Generate historic client reports
- Create detailed UniFi device inventories
Getting Started
The entire project is available on GitHub: https://github.com/veteranbv/unifi-client-updater
The repository includes:
- Detailed setup instructions
- Example CSV templates
- Documentation for all features
- Implementation guidelines
Technical Implementation
The scripts utilize the UniFi Controller API to interact with your network infrastructure. I've updated and validated the API endpoints to ensure reliable functionality, improving upon the unofficial documentation that exists in the community.
Looking Forward
If you're managing a complex UniFi network or planning a major network rebuild, these scripts could save you significant time and effort. Feel free to check out the repository and contribute to its development. I hope this toolkit makes your UniFi network management more efficient and enjoyable. Please note, Unifi is awesome and always evolving. This is a bit of a work around, and updates to their API might break this. Please submit an issue and pull request if you're able to help as things continue to evolve.