UniFi Network
UniFi Network
Prerequisites
Hardware support
This integration supports all UniFi OS Consoles that run UniFi Network. It also supports self hosted versions of UniFi Network.
Software support
It is recommended to run latest stable versions of UniFi Network and UniFi OS.
Early Access and Release Candidate versions are not supported by Home Assistant.
Using Early Access Release Candidate versions of UniFi Network or UniFi OS can bring unexpected changes. If you choose to opt into either the Early Access or the Release Candidate release channel and anything breaks in Home Assistant, you will need to wait until that version goes to the official Stable Release channel before it is expected to work.
Local user
You will need a local user created in your UniFi OS Console to log in with. Ubiquiti SSO Cloud Users will not work. It is recommended you use the Administrator or a user with full read/write access to get the most out of the integration, but it is not required. The entities that are created will automatically adjust based on the permissions of the user you use has.
- Login to your Local Portal on your UniFi OS device, and select Users.
-
Note: This must be done from the UniFi OS by accessing it directly by IP address (i.e. Local Portal), not via
unifi.ui.com
or within the UniFi Network app.
-
Note: This must be done from the UniFi OS by accessing it directly by IP address (i.e. Local Portal), not via
- Go to Admins & Users from the left hand side menu or [IP address]/admins/users e.g. 192.168.1.1/admins/users.
- Select Add New Admin.
- Check Restrict to local access only and fill out the fields for your user. Select Full Management for Network. OS Settings are not used, so they can be set to None.
- In the bottom right, select Add.
There is currently support for the following device types within Home Assistant:
配置
要将 UniFi Network hub 添加到您的 Home Assistant 实例中,请使用此 My 按钮:
UniFi Network 可以被 Home Assistant 自动发现。如果发现了实例, 它将显示为 已发现。您可以立即进行设置。
手动配置步骤
如果没有自动发现,请不要担心!您可以设置一个 手动集成条目:
-
浏览到您的 Home Assistant 实例。
-
转到
设置 > 设备与服务。 -
在右下角,选择
Add Integration 按钮。 -
从列表中选择 UniFi Network。
-
按照屏幕上的说明完成设置。
Permissions: The below sections on the features available to your Home Assistant instance assume you have full write access to each device. If the user you are using has limited access to some devices, you will get fewer entities and in many cases, get a read-only sensor instead of an editable switch entity实体表示 Home Assistant 中的传感器、执行器或功能。实体用于监控物理属性或控制其他实体。实体通常是设备或服务的一部分。 [Learn more].
Extra configuration of the integration
All configuration options are offered from the front end. Enter what UniFi Network integration集成将 Home Assistant 与您的设备、服务等连接和集成。 [Learn more] you want to change options on and press the cog wheel. Some advanced options are available when “Advanced Mode” is enabled on your user profile page.
Button
The Button entities will only be available and usable if the integration has a UniFi Network account with administrator privileges.
Power cycle PoE
Use the Power cycle PoE button entity to power cycle one specific PoE port to cause the connected device to restart.
Restart UniFi device
Use the Restart UniFi device button entity to restart the entire UniFi device. In case the device is a PoE switch, the PoE supply is not affected.
WLAN regenerate password
Use the WLAN regenerate password button entity to generate and apply a new password to the specified WLAN (Wireless Local Area Network). Use the WLAN regenerate password button entity to generate and apply a new password to the specified WLAN (Wireless Local Area Network). It will be randomly generated with 20 characters, consisting of lowercase letters, uppercase letters, and digits.
Image
Provides QR Code images that can be scanned to easily join a specific WLAN. Entities are disabled by default. This feature requires admin privileges.
Presence detection
This platform allows you to detect presence by looking at devices connected to a Ubiquiti
Troubleshooting and Time Synchronization
If tracked devices continue to show “Home” when not connect/present and show connected in the UniFi Controller, disable 802.11r Fast Roaming. When enabled, it has been observed on the various UniFi Controller versions, failure to declare disconnected clients.
Presence detection depends on accurate time configuration between Home Assistant and the UniFi Network application.
If Home Assistant and the UniFi Network application are running on separate machines or VMs ensure that all clocks are synchronized. Failing to have synchronized clocks will lead to Home Assistant failing to mark a device as home.
Actions
Action unifi.reconnect_client
Try to get a wireless client to reconnect to the network.
Data attribute | Optional | Description |
---|---|---|
device_id |
No | String representing a device ID related to a UniFi Network integration集成将 Home Assistant 与您的设备、服务等连接和集成。 [Learn more] . |
Action unifi.remove_clients
Clean up clients on the UniFi Network application that has only been associated with the Network application for a short period of time. The difference between first seen and last seen needs to be less than 15 minutes and the client can not have a fixed IP, hostname or name associated with it.
Switch
Block network access for clients
Allow control of network access to clients configured in the integration集成将 Home Assistant 与您的设备、服务等连接和集成。 [Learn more] options by adding MAC addresses. Items in this list will have a Home Assistant switch created, using the UniFi Device name, allowing for blocking and unblocking.
PoE port control
Provides per-port PoE control. Entities are disabled by default. This feature requires admin privileges.
Control DPI Traffic Restrictions
Entities appear automatically for each restriction group. If there are no restrictions in a group, no entity实体表示 Home Assistant 中的传感器、执行器或功能。实体用于监控物理属性或控制其他实体。实体通常是设备或服务的一部分。 [Learn more] will be visible. Toggling the switch in Home Assistant will enable or disable all restrictions inside a group.
Control WLAN availability
Entities appear for each WLAN. Changing the state of WLAN will trigger a reconfiguration of affected access points, limiting access to all WLANs exposed by the access point.
Control Port Forwarding Rules
Entities appear for each port Forwarding Rule. The switches can be identified from icon
Control Traffic Rules
Entities appear for each Traffic Rule. The switches can be identified from icon
Control Policy-Based Routing Rules
Entities appear for each Policy-Based Routing Rule. The switches can be identified from icon
Control Zone-Based Firewall Policies
Entities appear for each Zone-Based Firewall Policy. The switches can be identified from icon
Sensor
Bandwidth sensor
Get entities reporting receiving and transmitting bandwidth per network client. These sensors are disabled by default. To enable the bandwidth sensors, on the UniFi integration page, select Configure, go to page 3/3 and enable the bandwidth sensors.
Wlan clients sensor
Entities reporting connected clients to a WLAN.
Uptime sensor
Get entities reporting uptime per network client or UniFi Network device.
Power Outlet sensor
Get entities reporting the power utilization for outlets that support metrics (such as the AC outlets on the USP-PDU-Pro).
Device temperature sensor
Get entities reporting the general temperature of a UniFi Network device.
Device state
Get entities reporting the current state of a UniFi Network device.
Device CPU
Get entities reporting the current CPU utilization of a UniFi Network device.
Device memory
Get entities reporting the current memory utilization of a UniFi Network device.
Port Bandwidth sensor
Get entities reporting receiving and transmitting bandwidth per port. These sensors are disabled by default. To enable the bandwidth sensors, on the UniFi integration page, select Configure, go to page 3/3 and enable the bandwidth sensors.
Firmware updates
This will show if there are firmware updates available for the UniFi network devices connected to the controller. If the configured user has admin privileges, the firmware upgrades can also be installed directly from Home Assistant.
Removing a device in Home Assistant
Integration populates both UniFi devices as well as network clients into Home Assistant. In certain edge cases entities are left lingering even if they are not present in UniFi network anymore. This can lead to an accumulation of entries in the device registry.
To manually remove a device entry, go to the Device Info page and select “Delete” from the Device Info menu.
Only clients/devices which are no longer known by UniFi since the startup or reload of the UniFi integration can be removed.
Debugging integration
If you have problems with the UniFi Network application or integration集成将 Home Assistant 与您的设备、服务等连接和集成。 [Learn more] you can add debug prints to the log.
logger:
default: info
logs:
aiounifi: debug
homeassistant.components.unifi: debug