Hi all,
I have created a custom integration based on the official Unifi Network API which was released a few months ago by Ubiquiti:
Unifi Network (custom integration)
Currently it provides mainly sensors and actions for Unifi devices, and device trackers for clients (laptops, phones etc).
Feel free to give it a try and give me feedback.
It can be installed by adding it as a Custom Repository in HACS.
The main goal is to show and validate what the official API provides, and maybe prepare a path to integrate it in the core Unifi Network integration which is based on unofficial APIs (and much more feature rich).
Note: both integrations can be installed in the same Home Assistant instance. They mostly play well together, you will just have some duplicated sensors (suffixed by “_2”).
Here is the full list of supported features (see github README):
Device Trackers
- UniFi Client Tracker: Reports
homewhen client is currently connected,not_homeotherwise. Attributes include IP address, MAC address, last seen timestamp, connected at timestamp (when available), andsource_type=router. Automatically created for all discovered clients when client tracking is enabled.
Device Sensors
- Device State: Current operational state (Online, Offline, etc.)
- System Statistics (per device):
- Uptime (timestamp showing when device started)
- Load Average (1, 5, and 15 minute averages)
- CPU Utilization (%)
- Memory Utilization (%)
- Uplink Statistics (per device):
- Uplink RX Rate (bps, suggested display as Mbps)
- Uplink TX Rate (bps, suggested display as Mbps)
- Radio Statistics (per device, per available radio frequency):
- TX Retries (%) — created for each available radio frequency (e.g., 2.4GHz, 5GHz, 6GHz)
- Port Statistics (per device, per physical port):
- Port State (Up, Down, etc.) with additional attributes for port details
- PoE Port Statistics (per device, per PoE-capable port):
- PoE State (Providing Power, Off, etc.) with PoE standard and type information
Device Buttons
- PoE Port Power Cycle (per device, per PoE-capable port): Triggers power cycle action on PoE ports. Button is automatically available only for ports with PoE capability.
- Restart Device (per device): Triggers a restart action on the device. Button is only available when device is online.
Update Entities
- Firmware Update (per device): Shows current firmware version and indicates if firmware updates are available. Displays “Unknown” for latest version when an update is available (UniFi API doesn’t provide specific version information). Note: Firmware installation through Home Assistant is not supported - use the UniFi Network Application for updates.
Services
- Remove Stale Clients (
unifi_network.remove_stale_clients): Removes devices from the Home Assistant device registry that are no longer in the known clients or devices list. Useful for cleaning up devices that were previously tracked but are no longer present in the UniFi network. Can target specific config entries or process all UniFi Network integrations.