iPhone Presence Detection with hping3 and ARP

One last quick question. Im planning to follow this example: Generic Presence Detection
I’m not barking up the wrong tree here again? :smile:
It seems clean and simple so i think i’ll be able to work that solution out on my own.

I’ve used that for years now and it still works fine. It is what I would recommend for flapping and in case you ever decide to add more sensors for each person.

1 Like

I use Thomas arping
Where do i config the arping parameters in network binding ??
thanks

https://docs.openhab.org/addons/bindings/network/readme.html#binding-configuration

did it work for you ?
my presecence detection is not satisfiying

I run in Docker and don’t want to run OH as root so I don’t use the arping feature. I have an external python script that executes a version of the above script for me. Others have reported great success with the arping feature of the Network binding.

I’m new to openHAB2 and just want to know if this method in the first post is active or has been replaced with something else since?

I’m currently having problem with my iPhones wifi connection dropping in and out.

The Network binding now will do arping so you can just use that. Look at the readme for the binding for details.

There is also an iCloud binding people have been successful using.

Hi,
Has anybody measured the impact of waking the iPhone’s WiFi to answer the pings in battery life?
Regards.

Excellent question @jjmeseguer, I was thinking about the same issue. Yesterday I spent some time googling for that with no success.

So if someone has more information, that would be great!!

Thank you

Thanks Rich!
The network binding works now after some configuration. I extended the time to 90000ms before the device is stated as offline. Seems to be working since then. Before the iPhone presence went offline/online around every minute.

1 Like

Sorry for my ignorance… How set IP and MAC on script file?

(Sorry for my ignorance) :sweat_smile:

How set IP and MAC on script file?

I am receiving the following error on the presence…Anyone have any ideas?

2018-10-08 17:01:01.774 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Determine presence Iphone’: An error occurred during the script execution: Couldn’t invoke ‘assignValueTo’ for feature JvmVoid: (eProxyURI: IphonePresence.rules#|::0.2.1.2.0.0.0.0.2.0.1::0::/1)

Blockquote

How does one update to 2.19?

iOS 12.0.1 iPhone Xs.
It doesn’t work. It takes about 30 seconds after the screen is black then the script says “not present” anyone seen the same?

iPhone 7 here. Same results. it just doesn’t work. i tried so many settings and so many versions. I just can;t get a decent detection. I don’t like cloud stuff, but i think im going to switch to the icloud binding and use the geofencing rule.

It doesn’t seem to work for newer android phones. I have a Samsung Galaxy S8 and a Galaxy S9. Both are not responding to the hping3 call (100% loss) and are not in the arp table afterwards.

I can do a simple ping when they are not in sleep and then the script detects the phone, but hpin3 doesn’t seem to do the trick at all.

hi

I’ve got an iphone 6s and the suggested procedure doesnt work. i have iphone 6s with ios 12.1.12. if i understand the script corretcly you flush the arp table and then send udp packets using hping3. how can the hping3 know the iphone mac ?

i tried using a static arp entry for the iphone, and i sniff the udp packets arriving but it stil doesnt answer arp. is there another way to wake the iphone up?

Regards

Hi

My solution is to assign fixed IP addresses to the iPhone from my WLAN router. Then I use pingable network device as an item and the channel with lastseen:

DateTime iPhone_Lastseen "Last seen" {channel="network:pingdevice:00xy0000:lastseen"}

Cheers