Code Monkey home page Code Monkey logo

homebridge-delayed-occupancy's Introduction

Delayed Occupancy Sensor Plugin for Homebridge

This plugin is designed to solve HomeKit's inability to reset the timer that starts when an accessory is controlled by a motion sensor event.

Note: you must setup a HomePod, HomePod mini, Apple TV or iPad as a home hub before installing this plugin as it relies on automations to function.

Don't use this plugin: use a better one

This plugin exists to solve a particular problem of mine and I consider it functionally complete. I don't intend to add any more features.

I recommend using homebridge-magic-occupancy instead as it was forked from the same source but has added a lot more functionality and is Homebridge Verified.

Why does this plugin exist?

The code is derived from the original homebridge-occupancy-delay plugin which I used successfully for many years. My version just modifies logging, configuration and accessory metadata.

What does this plugin do?

The plugin creates a virtual occupancy sensor with one or more associated switches. When a switch turns on, the sensor detects occupancy. When all the switches turn off, the sensor ways for the nominated delay period before it stops detecting occupancy. If a switch is turned on before the timer ends, the timer is reset.

What automations do I need to configure to make this work?

This example describes a basic scenario to enable motion-sensor activated lights.

  1. When your motion sensor detects motion, turn the activation sensor switch on.
  2. When your motion sensor stops detecting motion, turn the activation sensor off.
  3. When the occupancy sensor detects occupancy, turn your lights on.
  4. When the occupancy sensor stops detecting occupancy, turn your lights off.

The plugin allows you to create multiple activation switches so that you can link multiple sensors to the same occupancy sensor. The plugin will wait until all the switches are off before starting the timer.

How to install

The simplest method to install and configure this plugin is via homebridge-config-ui-x. Just search for @djelibeybi/homebridge-delayed-occupancy on the Plugins tab.

To install manually, run the following command in your Homebridge directory. Depending on how you installed Homebridge, you may need to add the -g and/or the --unsafe-perms parameters:

npm install [-g|--unsafe-perms] homebridge-delayed-occupancy

The -g option will install the plugin globally and the --unsafe-perms option is needed for some platforms to install successfully.

Configuration

The plugin can be configured via the homebridge-config-ui-x admin interface.

To configure the plugin manually, add one or more configuration stanzas to the accessories block of your Homebridge config.json file:

   "accessories": [
       {
         "accessory": "delayed-occupancy-sensor",
         "name": "Delayed Occupancy Sensor",
         "delay": 5,
         "switches": [
           "First activation switch",
           "Second activation switch"
         ]
       }
   ]

The switches list is optional. If you do not include this list, a single switch will be automatically created by the plugin. If you provide this list, then the names provided will be used as the name of each switch in HomeKit.

homebridge-delayed-occupancy's People

Contributors

archanglmr avatar djelibeybi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

homebridge-delayed-occupancy's Issues

Maximum of 3600 seconds

Is there a technical reason for the maximum of 3600 seconds? I'm looking to add an occupancy delay of 24h which is triggered when my system detects rain. I.e. the occupancy goes off if there is no rain for the last 24h.

Cheers

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.