# Generic Presence Detection

**URL:** <https://community.openhab.org/t/generic-presence-detection/17878>\
**Category:** Tutorials & Examples\
**Tags:** presence\
**Created:** [December 7, 2016, 11:14pm UTC](https://community.openhab.org/t/generic-presence-detection/17878 "2016-12-07T23:14:44Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![Max\_G](https://community.openhab.org/user_avatar/community.openhab.org/max_g/32/64598_2.png) [@Max\_G](https://community.openhab.org/u/Max_G)\
**Post date:** [January 21, 2017, 7:35am UTC](https://community.openhab.org/t/generic-presence-detection/17878/21 "2017-01-21T07:35:32Z")

</div>

> [@rlkoshak](#):
>
> first clear the arp table before doing the hping

Based on this conversation, I decided to change my script to that from [SeaSide](https://community.openhab.org/t/iphone-presence-detection-with-hping3-and-arp/18171/3), because it loops through multiple IPs. Tested this arvo, and it works; also, and yes, because of clearing the arp entry for the relevant IP. Nice.  
Also adopted the MQTT publish approach, as this is what I will be using (Architecturally) whenever possible.

From a rights perspective I had to use sudo in front of the arp entry deletion, and add openhab to the sudoers without password.

No network binding used for this.  
So basically, the shell script is triggered by a rule.  
The script publishes to mosquitto topic;  
OH subscribes to mosquitto topic

---

_[View the full topic](https://community.openhab.org/t/generic-presence-detection/17878)._
