Code Monkey home page Code Monkey logo

homebridge-unifi-occupancy-sensor's Introduction


Homebridge UniFi Occupancy Sensor

npm npm Donate

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

The easiest way to configure this plugin is via Homebridge Config UI X.

"accessories": [
  {
    "accessory": "UniFi Occupancy Sensor",
    "name": "Occupancy Sensor",                    // Required. The name of the 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": [                                     // Optional - use either watch or monitor.
      "44:00:10:f0:3e:66",                         // An array of device MAC addresses to watch for.
    "monitor": [
      {                                            // Optional - use either watch or monitor. 
        "device": "44:00:10:f0:3e:67",             // An array of device MAC/AP combinations to watch for.
        "ap": "44:00:10:f0:3e:44"
      }
    ],
    "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.

License

Copyright (C) 2017-2020 oznu

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

homebridge-unifi-occupancy-sensor's People

Contributors

oznu avatar tickez avatar samwelnella avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.