Unifi - custom integration based on official Network API

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 home when client is currently connected, not_home otherwise. Attributes include IP address, MAC address, last seen timestamp, connected at timestamp (when available), and source_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.
6 Likes

Nice, works great. Few things, compared to the built in version, that I currently use:

The POE ports switches to be able to turn on/off the POE power
Switches for Rules
CPU temperature of UDM PRO

Hi @Holdestmade ,
thanks for the feedback. I agree those would be nice, but they are not currently provided by the official Unifi API.
I’m sure it will improve over time. It’s also partly the aim of this integration - get feedback on what’s missing and ask Ubiquiti to add it.
On my side I would also be interested in :

  • POE power consumption per port
  • POE switch on/off per port- RX/TX bandwidth per port
  • Detailed client statistics, especially RX/TX bandwidth
  • Provide the version number of available firmware updates (currently there is just a status “update available”)
  • Temperature sensors as you mentioned
1 Like

I’ve opened a thread on the UniFi forums to request additional features in the official Network API:
https://community.ui.com/questions/Feature-Request---Network-API-Enhancements-for-Home-Assistant-Integration/9f116e3d-33a4-447a-aae2-7418f4d38ddc
If you’re interested, feel free to upvote it or share your own use cases!

I’ve updated the UniFi Network API version to 10.0.160 .

:warning: Due to a breaking change in the UniFi API, please use the matching integration version:

  • Network 9.x → integration v0.2.1
  • Network 10.x → integration v0.3.0