Giter Club home page Giter Club logo

mqtt-arp's Introduction

mqtt-arp is an imaginatively named program that uses the Linux kernel netlink interface to watch for details of hosts making ARP requests. It uses these requests to determine if a device is present and report that information via MQTT. I use it on my OpenWRT router to report to a Home Assistant instance.

Rather than reporting all MAC addresses seen mqtt-arp takes a list of MACs to watch for. I have this configured for my phone, resulting in a reasonable proxy for whether I am home or not. mqtt-arp will report as soon as the device is seen, and send rate-limited (at most once every 2 minutes) updates when it is seen again. If the device is not seen for at least 10 minutes the location will be reported as "unknown".

There is basic configuration file support; by default mqtt-arp will read /etc/mqtt-arp.conf. The following aspects can be configured at run time:

  • MQTT host (-h / --host / mqtt_host)
  • MQTT post (-p / --port / mqtt_port)
  • MQTT username (-u / --username / mqtt_user)
  • MQTT password (-P / --password / mqtt_pass)
  • MQTT topic (-t / --topic / mqtt_topic)
  • Location to report when device is present (-l / --location / location)
  • Path to SSL certificate bundle (-c / --capath / capath)
  • MAC addresses to watch for (-m / --mac / mac)

This code is released as GPLv3+ and is available at https://the.earth.li/gitweb/?p=mqtt-arp.git;a=summary or on GitHub for easy whatever at https://github.com/u1f35c/mqtt-arp

mqtt-arp's People

Contributors

u1f35c avatar

Watchers

 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.