Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
/ presence Public archive

detect presence at home with homeean

Notifications You must be signed in to change notification settings

homeean/presence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

homeean-presence

this repository is no longer actively maintained

homeean-presence provides a simple way to detect presence at your home. For each person an IP device in the same network and a BLE device can be monitored. In addition, the presence state of a person can be manually set for a certain time via webhook.

If the status changes, a webhook can be triggered.

Installation

Raspbian/Debian/Ubuntu

sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev libpcap-dev
sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)

see https://github.com/noble/bleno#prerequisites

The package is available via npm

sudo npm install -g homeean-presence --unsafe-perm

If you encounter problems with premissions, see here: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

create a config.json in ~/.homeean-presence

You can add as many person as you wish.

{
    "interval": 20,
    "threshold": 300,
    "port": 3000,
    "webhooks": {
        "absent": "https://webhook-for-absence",
        "present": "https://webhook-for-presence"
    },
    "persons": [
        {
            "name": "Your Name",
            "ip": "192.168.1.1",
            "ble": "AA:BB:CC:DD:EE:FF",
	        "webhooks": {
	            "absent": "https://webhook-for-absence",
	            "present": "https://webhook-for-presence"
            }
        },
        ...
    ]
}

Run

homeean-presence

Run in Docker

# Put your config.json in the repository root!

# Build the image
docker build -t homeean-presence:latest .

# Run the image
docker run -it --net=host --name homeean-presence homeean-presence:latest

Attention: --net=host is required by the container to have access to the host subnet and bluetooth devices.

Debug

Set the enviroment variable LOG_LEVEL to DEBUG

LOG_LEVEL=DEBUG homeean-presence

Changelog

1.3.0 (2019-11-04)

  • added support for nodejs v. 10

1.2.4 (2019-04-24)

  • improved logging

1.2.3 (2019-03-15)

  • fixed an issue with state update from webhook

1.2.2 (2019-03-14)

  • fixed timelock issue
  • improved logging

Releases

No releases published

Packages

No packages published