Git Product home page Git Product logo

homebridge-people's Introduction

homebridge-people

This is a plugin for homebridge. It monitors who is at home, based on their smartphone being seen on the network recently.

Installation

  1. Install homebridge (if not already installed) using: npm install -g homebridge
  2. Install this plugin using: npm install -g homebridge-people
  3. Update your configuration file. See below for a sample.

Configuration

"accessories": [
	{
    "accessory" : "people",
    "name" : "People",
    "people" : [
      { "name" : "Pete", "target" : "PetesiPhone" },
      { "name" : "Someone Else", "target" : "192.168.1.68" }
    ],
    "threshold" : 15
  }
],

target may be either a hostname or an IP address

How it works

  • When started homebridge-people will continually ping the IP address associated with each person defined in config.json.
  • When a ping is successful the current timestamp is logged to a file (seen.db.json)
  • When a Homekit enabled app looks up the state of a person, the last seen time for that persons device is compared to the current time minus threshold minutes, and if it is greater assumes that the person is active.

Accuracy

This plugin requires that the devices being monitored are connected to the network. iPhones (and I expect others) deliberately disconnect from the network once the screen is turned off to save power, meaning just because the device isn't connected, it doesn't mean that the devices owner isn't at home. Fortunately, iPhones (and I expect others) periodically reconnect to the network to check for updates, emails, etc. This plugin works by keeping track of the last time a device was seen, and comparing that to a threshold value (in minutes).

From a very limited amount of testing, I've found that a threshold of 15 minutes seems to work well for the phones that I have around, but for different phones this may or may not work. The threshold can be configured in the .homebridge/config.json file.

Notes

Running on a raspberry pi as non 'pi' user

On some versions of raspbian, users are not able to use the ping program by default. If none of your devices show online try running sudo chmod u+s /bin/ping. Thanks to oberstmueller for the tip.

homebridge-people's People

Contributors

petelawrence avatar

Watchers

James Cloos avatar Jonny 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.