Homebridge UniFi Occupancy Sensor
Go to file
2020-01-29 08:57:07 +11:00
.gitignore Added possibility to limit scope of a device to a particular AP 2020-01-28 07:33:42 +01:00
config.schema.json Updated documentation and configuration schema 2020-01-28 19:59:53 +01:00
index.js Added configurable polling interval 2020-01-28 07:44:06 +01:00
package-lock.json Updated dependencies 2020-01-28 19:56:42 +01:00
package.json Increase Version to 0.2.0 2020-01-28 20:02:36 +01:00
README.md Updated documentation and configuration schema 2020-01-28 19:59:53 +01:00

Homebridge UniFi Occupancy Sensor

This Homebridge plugin will provide an occupancy sensor accessory to HomeKit based on the devices connected to WiFi access points managed by a UniFi Controller.

The plugin connects to the UniFi Controller event web socket to get instant notifications of connecting devices - which can then be used to trigger HomeKit actions like turning on the lights.

Requirements

Homebridge Config

"accessories": [
  {
    "accessory": "UniFi Occupancy Sensor",
    "name": "Occupancy Sensor",
    "unifi": {
      "controller": "https://demo.ubnt.com:8443",  // Required. The url of the UniFi Controller.
      "username": "superadmin",                    // Required. A read-only user is fine.
      "password": "password",                      // Required.
      "site": "default",                           // Optional. The UniFi site to connect to.
      "secure": false                              // Optional. Set true to validate the SSL certificate.
    },
    "watch": [
      "44:00:10:f0:3e:66", 
      { "device": "44:00:10:f0:3e:67", "ap": "44:00:10:f0:3e:44" }
    ],                                             // Required. An array of device MAC addresses to watch for or objects with device MAC / AP MAC
    "watchGuests": true,                           // Optional. Set false to not monitor guest networks.
    "interval": 1800,                              // Optional. Polling interval used to query Unifi in seconds 
    "mode": "any"                                  // Optional. Set to "any", "all" or "none".
  }
]

Site Name

If you're using a non-default site you will need to specify the name of the site in the plugin config. The internal site name might not match the name you have allocated to the site exactly, you can get the required site name by navigating to the site in the unifi controller then looking at the url bar:

https://unifi.com:8443/manage/site/mofkpypu/dashboard

In this case the site name is mofkpypu and this is the value that should be entered in your Homebridge config.