https://github.com/homebridge-plugins/homebridge-unifi-network
Homebridge UniFi SmartPower Plugin
https://github.com/homebridge-plugins/homebridge-unifi-network
Last synced: 4 months ago
JSON representation
Homebridge UniFi SmartPower Plugin
- Host: GitHub
- URL: https://github.com/homebridge-plugins/homebridge-unifi-network
- Owner: homebridge-plugins
- License: apache-2.0
- Created: 2022-10-02T23:44:59.000Z (almost 4 years ago)
- Default Branch: latest
- Last Pushed: 2025-09-18T04:30:28.000Z (10 months ago)
- Last Synced: 2025-11-27T12:52:07.654Z (7 months ago)
- Language: TypeScript
- Size: 808 KB
- Stars: 9
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# homebridge-unifi-network
[](https://www.npmjs.com/package/homebridge-unifi-network)
[](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
# UniFi SmartPower Homebridge Platform Plugin
[UniFi SmartPower](https://store.ui.com/collections/unifi-network-smartpower) plugin
for [Homebridge](https://github.com/homebridge/homebridge).
## Models Supported
- [SmartPower PDU Pro (USP-PDU-Pro)](https://store.ui.com/collections/unifi-network-smartpower/products/usp-pdu-pro)
- [SmartPower Plug (USP-Plug)](https://store.ui.com/collections/unifi-accessories/products/unifi-smart-power)
- [SmartPower Strip (USP-Strip)](https://store.ui.com/collections/unifi-accessories/products/smartpower-strip)
- [Next-Generation Gateway Pro (UXG-Pro)](https://store.ui.com/products/unifi-next-generation-gateway-professional)
## Configuration
### Required Configuration
```json
{
"platforms": [
{
"platform": "UniFiSmartPower",
"name": "UniFi SmartPower",
"host": "192.168.1.1", // Controller or CloudKey IP address
"port": 443, // and port
"username": "admin", // See note below about account credentials
"password": "ubnt"
}
]
}
```
#### Account Credentials
You can use your Ubiquiti account credentials, though 2FA is supported. However, it is strongly
recommend to create a local user with Admin privileges just for this plugin. See
[this Ubiquity Help Article](https://help.ui.com/hc/en-us/articles/1500011491541-UniFi-Manage-users-and-user-roles)
for creating new users.
### Optional Configuration
#### Control Switch
Considering how easy it is to accidentally command an outlet/switch from HomeKit
you can optionally add a switch to enable/disable control. When disabled,
commands to control an outlet/switch will be ignored:
```
{
"platforms": [
{
// ... required config, see above
"controlSwitch": {
"create": , // Defaults to false.
"name": "", // Defaults to "UniFi Control Enabled".
"timeout": , // Timeout (in seconds) before the control switch reverts. Defaults to 60s. 0 disables the timeout.
"guardOutlets": , // If true, outlets will be guarded by this control switch. Defaults to true.
"guardSwitchPorts": , // If true, switch ports will be guarded by this control switch. Defaults to true.
"guardRpsPorts": // If true, RPS ports will be guarded by this control switch. Defaults to true.
}
}
]
}
```
#### Include/Exclude
Sites, devices, outlets, and/or ports can be included or excluded by their id (see logs during startup):
```
{
"platforms": [
{
// ... required config, see above
"includeSites": [""],
"excludeSites": [""],
"includeDevices": [""],
"excludeDevices": [""],
"includeOutlets": ["."],
"excludeOutlets": ["."],
"includeInactivePorts": , // Defaults to false
"includePorts": ["."],
"excludePorts": ["."],
"includeInactiveRpsPorts": , // Defaults to false
"includeRpsPorts": ["."],
"excludeRpsPorts": ["."]
}
]
}
```
NOTE: When `includeInactivePorts` is set to `true` all PoE capable ports will be added regardless if
the switch is supplying power to a connected device or not. This is not recommended since the plugin
will refresh and automatically add new ports when they become connected. Leaving this set to `false`
will reduce clutter in the Home app by removing switches that do not control anything.
### Advanced Configuration
These config values should not be configured under normal situations, but are
exposed nonetheless. Min, max, and default values are enforced to keep the
plugin usable.
#### Refresh Devices Poll Interval
The polling interval (in seconds) to query the API for devices changes:
```
{
"platforms": [
{
// ... required config, see above
"refreshDevicesPollInterval": , // Defaults to 600
}
]
}
```
#### Status Cache TTL
The time to live (in seconds) for a cached status to avoid excessive API calls:
```
{
"platforms": [
{
// ... required config, see above
"outletStatusCacheTtl": , // Defaults to 15
}
]
}
```
#### Status Poll Interval
The polling interval (in seconds) to query the API for status changes:
```
{
"platforms": [
{
// ... required config, see above
"outletStatusPollInterval": , // Defaults to 15
}
]
}
```