Detect MAC addresses over local wifi connection

If we could detect MAC addresses ove the local wifi connection, with an occasional ping, like arp-scan, it could be used for alarm system setting, where all known mobile phone MAC addresses would trigger the shutting down of a security system.

The triggers could also be used to notify when a person is within range, or even as a time clock system for employees.

Show all MAC addresses on the network, detect all those on a friend list. If a friend disconnects, ping them to make sure it is not a device going to sleep. After two missed pings, flag that friend as off the premises, triggering whatever notification you want.

1 Like

That’s a pretty cool idea. When the API is released you can definitely get this working on a raspberry pi with a python script that sends data to the cayenne servers. It doesn’t look like there is any easy way to run an arp from an Arduino, at least that I could find.

As I’m starting to use Cayenne (RPi3) to use as a home automation system (before I was using PLC), this “geofencing” idea is just great! At this moment I have a 3 level self made security system, depending on the range away from my home (level 1 warning = x meters from my home, etc.). We need to disable or enable the alarm system every time by our self’s.
Would be a great feature to create a secured (friend) list of mobile phones to automate the security system.

Any idea of this is feasible to program?

1 Like

That’s a really good idea, I can see that being useful in a few cases.

Searching the net, there are a few people who have made something like this, but I’m struggling to get a system going myself.

Using arp-scan in Python works, but the Rpi3 inbuilt wifi will not work as it doesn’t have monitor mode. A separate wifi dongle works fine.

There are four Android devices in my home that I want to detect. Three of them work fine, but one will not respond to ping requests if it is in standby mode.

I would like to detects wifi packets, but if a white listed device is missing, to then ping it as a sort of check sum before we can definitively say it is not in the area.

Update.

I’ve found some Python code that uses arp-scan to listen for specific MAC addresses. It uses individual threads for each address.

At the moment, I am streaming the data to Initial State via ISStreamer. I can then log into IS to see an in/out board.

An interface between Python and Cayenne, even just Boolean variables, would allow me to add triggers.

2 Likes

@bestes; Is this feasible to integrate in the Cayenne dashboard/widget’s in the near future (next release)?

Hey @FreV!

Can you be more specific? Integrate python code into widgets? …We are on the verge of releasing our MQTT API which may also be an option here :slight_smile:

-B

If I explain how the Initial State system works:

A Python library is installed. Scripts call the ISStreamer from the library and passes variables to the streamer. The IS website represents those variables in a number of formats, just like Cayenne.

Cayenne does the whole job, finds the sensor, displays the data, triggers the output device. Being able to pass variables to Cayenne from a Python script would be highly desirable.

Cayenne works fantastically for some applications, but almost controls too much in some instances. I have a custom button / led board that I control from Python. I can control it from Cayenne also, but I can’t do both at the same time.

If there was a Python library that would allow me to interact with Cayenne, I could write the code that passes the variables to Cayenne, then use the full power of Cayenne to record data and set triggers.

More specific? An ‘geofencing’ option in Cayenne, based on MAC address (or IP) would be great. Then the Cayenne app knows when you are around.

Would be a great feature to create and a secured (friend) list of mobile phones to automate things.

That’s a feature of Home Assistant. I don’t think Cayenne can do that.

YET.