npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-unifi-smartpower

v2.2.0

Published

UniFi SmartPower plugin for Homebridge.

Downloads

43

Readme

homebridge-unifi-smartpower

NPM Version verified-by-homebridge

UniFi SmartPower Homebridge Platform Plugin

UniFi SmartPower plugin for Homebridge.

Models Supported

Configuration

Required Configuration

{
  "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 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": <true/false>,           // Defaults to false.
        "name": "<name>",                 // Defaults to "UniFi Control Enabled".
        "timeout": <number>,              // Timeout (in seconds) before the control switch reverts. Defaults to 60s. 0 disables the timeout.
        "guardOutlets": <true/false>,     // If true, outlets will be guarded by this control switch. Defaults to true.
        "guardSwitchPorts": <true/false>, // If true, switch ports will be guarded by this control switch. Defaults to true.
        "guardRpsPorts": <true/false>     // 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": ["<site id>"],
      "excludeSites": ["<site id>"],
      "includeDevices": ["<serial number>"],
      "excludeDevices": ["<serial number>"],
      "includeOutlets": ["<serial number>.<index>"],
      "excludeOutlets": ["<serial number>.<index>"],
      "includeInactivePorts": <true/false>,          // Defaults to false
      "includePorts": ["<serial number>.<index>"],
      "excludePorts": ["<serial number>.<index>"],
      "includeInactiveRpsPorts": <true/false>,       // Defaults to false
      "includeRpsPorts": ["<serial number>.<index>"],
      "excludeRpsPorts": ["<serial number>.<index>"]
    }
  ]
}

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": <seconds>, // 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": <seconds>, // Defaults to 15
    }
  ]
}

Status Poll Interval

The polling interval (in seconds) to query the API for status changes:


{
  "platforms": [
    {
      // ... required config, see above
      "outletStatusPollInterval": <seconds>, // Defaults to 15
    }
  ]
}