Giter VIP home page Giter VIP logo

homebridge-wifipresence's Introduction

HomeBridge Wifi Presence

Detect presence in the room via WiFi. This plugin uses MAC addresses to detect when somebody is in a room or not, depending on which network they are connected to.

Setup

Install plugin npm install -g homebridge-wifipresence and add accessories to homebridge config.

{
  "bridge": {
    "name": "Homebridge",
    "username": "CD:22:3D:E3:CE:30",
    "port": 51826,
    "pin": "031-45-154"
  },

  "description": "This is an example configuration for the WifiPresence homebridge plugin",

  "accessories": [
    {
      "accessory": "WifiPresence",
      "name": "Main Wifi",
      "room": "Living room",
      "mac": ["MAC ADDRESS1", "MAC ADDRESS2", ..., "MAC ADDRESSX"],
      "presenceFile": "/var/lib/misc/presence.wifi"
    }
  ],

  "platforms": [

  ]
}

MAC ADDRESSX is the device WiFi MAC Address that you want to monitor. Once this MAC Address is connected to your network, Homebridge will then trigger the presence sensor to make the room occupied. You can add more than 1 MAC address, and they should be written in lower case (i.e.: aa:bb:cc:dd:ee:ff).

presenceFile is the path to list of MAC addresses. Currently, the default path is /var/lib/misc/presence.wifi, the same as in presence.sh scripts.

Presence scripts

Two presence scripts are provided:

  • presence.sh: To run on the router/access point to gather device MAC addresses from WiFi interfaces.
  • presence_server.sh: To run on the server where Homebridge is running, for when you do not have access or cannot run scripts on the router/access point.

License

ISC

homebridge-wifipresence's People

Contributors

llun avatar pierrepinon avatar saury avatar srgmc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

homebridge-wifipresence's Issues

MAC Address

Hi.
How do we put the MAC ? With โ€œ : โ€œ or altogether in lowercase? How do we separate different MAC?
Will it be occupied only when all MAC are connected?
Are we supposed to create the file presente.wifi? What is supposed to be in the file?

Thanks

Occupied status 1, 0 pattern

When executing the script, a pattern similar to the following can be seen in the logs:

Dec 25 15:20:11 hostname homebridge[32423]: [12/25/2019, 3:20:11 PM] [WiFiPresence] Occupied statue: 0
Dec 25 15:20:11 hostname homebridge[32423]: [12/25/2019, 3:20:12 PM] [WiFiPresence] Occupied statue: 1

where the status is first 0 and then 1.

This makes Homebridge to mark the sensor as not triggered and then triggered after a second. If sensor notifications are enabled in HomeKit, this generates notification spam.

file locations / presence.wifi

maybe a beginners question.... i searched for the plugin via the config ui x in homebridge and successfully installed it. however i cannot find the presence_server.sh that i understand i need to run on the pi and it populates the presence.wifi with the mac addresses...?
please clarify if you can

Occupied statue: 0

Hello! First, thank you for this tool.

I have a problem. I'm using this tool with yours https://github.com/saury/raspberry-pi-wifi-presence-with-mac-address to get Mac addresses of online devices.

I have in presence.wifi the Mac address from my iPhone, but home bridge doesn't detect it.

Always Occupied statue: 0

I've tested with other Mac addresses in presence.wifi but nothing.

my presence.wifi

78:11:dc:fd:xx:xx
8c:be:be:31:yy:yy
d4:9a:20:66:zz:zz

my config.json
{ "accessory": "WifiPresence", "name": "My iPhone", "room": "Casa", "clients": ["d4:9a:20:66:zz:zz"], "file": "/opt/wifipresence/presence.wifi" }, { "accessory": "WifiPresence", "name": "My iPad", "room": "Casa", "clients": ["78:11:dc:fd:xx:xx"], "file": "/opt/wifipresence/presence.wifi"

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.