Skip to main content

Check if you (or your phone) is at home and notify your smarthome via mqtt!

Project description

mqtt-presence-checker

Check if you (or your phone) is at home and notify your smarthome via mqtt. You can configure this daemon via a toml file in /etc/mqtt-presence-checker/mqtt-presence-checker.conf.

/etc/mqtt-presence-checker/mqtt-presence-checker.conf:

[main]
cooldown = 10
log = "/var/log/mqtt-presence-checker.log"

[mqtt]
host = "mqtt.example.org"
username = "<username>"
password = "<password>"
topic = "presence-checker/presence"

[mqtt.sensor.door-sensor]
topic = "zigbee2mqtt/door_sensor"
predicate = "lambda x: not x['contact']"

[ping]
hosts = [
    'alice.example.org',
    'bob.example.org'
]

This is rather rudimentary and might crash or behave strange. Feel free to fork me on github and send a PR if you find any bug!

Install

Install from pypi with:

pip install mqtt-presence-checker

Configure to start at boot with systemd. Copy mqtt-presence-checker.service to /lib/systemd/system/mqtt-presence-checker.service.

Enable your service:

sudo systemctl enable mqtt-presence-checker.service

And start it:

sudo systemctl start mqtt-presence-checker.service

Check its status:

systemctl status application.service

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mqtt_presence_checker-0.1.13.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

mqtt_presence_checker-0.1.13-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file mqtt_presence_checker-0.1.13.tar.gz.

File metadata

  • Download URL: mqtt_presence_checker-0.1.13.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.4 Linux/5.15.0-52-generic

File hashes

Hashes for mqtt_presence_checker-0.1.13.tar.gz
Algorithm Hash digest
SHA256 bf6c2e2825141363e73d00b74653471be112ea4477ddfbb7513c5fd44874bf6f
MD5 b1e550a1d1afe1d14db4b6243ec3b790
BLAKE2b-256 f1a8314126603fe2eb194d6623d275120f5c87eea5a5bc199cec0699a0f08a13

See more details on using hashes here.

File details

Details for the file mqtt_presence_checker-0.1.13-py3-none-any.whl.

File metadata

File hashes

Hashes for mqtt_presence_checker-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 47f850a260a029b24e37eaf031d411ab49736fd541444a716ba5a3816d7c7e39
MD5 3c36ea31f5cdaa4772c9254248fa5afe
BLAKE2b-256 3312de5e4b551b6fc2ed41b87f1ffdd8f4955ed5dc9c13b9bf6474413be6fec9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page