Presence Detection with iPhone and OH2

I tried to use it but realized that to make automation work you have to have either a stationary iPad or an apple TV. Both of which I do not have.
So this easy solution is out of reach without further investment.

I am still wondering why myopenhab is not providing an MQTT server.
Or alternatively make the Rest API more flexible because there a lot of apps that can send POST to a server based on location. Unfortunately there is no possibility in myopenhab to process these.

It did work, but it had an impact on battery life. This does not :slight_smile:

Alex:
Your approach is working fine but a the timely accuracy is poor because the iPhone must be polled. Thanks for this. For me the benefit is no installation requirement on my family members iPhone :slight_smile:
But if you increase the polling frequency battery is of course impacted negatively.

I was replying to @GigabitGuy :slight_smile:

He asked how geolocation based on iCloud location worked for me. The fact is it had on impact on battery life. Using a script on the router to detect if the phone is connected to the network has no impact whatsoever. Also, it’s instant. Using iCloud is not.

I see @alex_bartis, I´m interested to see how the HomeKit method impacts the battery and how accurate it is on a daily basic. Although I´m hoping that Apple does some magic with it behind the scenes. I Guess we all can hope for a future where battery life is less of an issue :smile:

I’m testing presence, with the UBNT binding.
It’s working perfect right now.

When i arrive outside my house, it detects that i’m there 99% of the times, before i get thru the door.
UBNT releases a phone, after abut 15 minutes, so it don’t matter, if the phone jumps on and off the wifi. It’s still detected as being there.

The upside is also, that you get the best wifi ever, with the UBNT AP’s, and it’s not that expensive. I use the AP Lite AP’s.

A small note. The UBNT binding, i still in beta, but i think it’s already stable enough, to be released.

@GigabitGuy It should not impact battery life, more then homekit already does. Meaning that homekit is already enabled on your phone. running an extra operation should be unnoticeable.

@Robert_Jensen

Thanks for the info.

There are 2 questions:

  • When hopping on and off WiFi does not impact your presence, does the system notice when you leave the house and mark you as absent?
  • My house is not too big, yet WiFi is an issue, i have one Fritz!box in the cellar to connect to the internet, then one more on the first floor just running as Access Point and still need a repeater to get a proper signal in the bathroom, another Fritz!-AP is located on the ground floor. Reason is the structure of the ceilings (concrete) and having LOTS of WiFi-Networks in the neighborhood. Do you think that AP could improve the situation replacing the two Fritz-APs and the repeater?
  1. Yes after about 15 minuttes.

  2. Yes. You can setup as many ap’s as you want to, and they all act as one.
    As long as you can manage to get a cable between them.

/Robert
Sendt fra mobil enhed

My openhab2 installation is on a Synology DS916+ NAS. I never was able to make arp and hsping3 work on it. Right now me and my family are using Life360 app on our iphones. So i made life360 presence available to openhab2 and quite happy about it. You can see it on Life360 and MQTT if you like.

How is the flight with HomeKit method? I am thinking to try it if myself. What is your experience?

Give it a try, its fairly easy to set up.

I haven’t had that much luck getting remote access to homekit and havent had the time to setup a terminal bot just yet. I’m not convinced that the issue is caused by homekit itself and not my firewall, so you might have better luck.

Let me know how it works for you :slight_smile:

I’ve managed to do presence detection directly on my router. Works good enough for me. Both my iPhones stay connected to WiFi when I am home. No jumps in and out.

Sharing the code here:

Script currently just logs to syslog. Need to make it to post it to openhab.

@Robert_Jensen

The upside is also, that you get the best wifi ever, with the UBNT AP’s, and it’s not that expensive. I use the AP Lite AP’s.

Do you mean those APs?

Yes.

I have the lite version.

But you can select whatever fit’s your need.

Just set them up, where you need Wifi, and connect them to your switch.
Then using the controller software, on your laptop, your server (can be a raspberry pi etc) or your cloud key, manage your wifi.

It’s the controller software that the binding connect to, so you should have it running somewhere, where it can run 24/7.

/Robert

Could I run the software on the same Raspi, OH is running on?

Probably yes, but i think you will have a problem with resources.

/Robert
Sendt fra mobil enhed

I have tested it for little over a week with a telegram bot to notify me when the scene has changed.

The HomeKit method is dead to me, it haven’t detected me leaving or coming home even on´ce. This is straight up lazyness on apples part - they could do so little to make this work, but they haven’t.

Hey…
were there any problems to set the automation rule in homekit? I tried this with every possibility of settings but in the end there is one result :

Any ideas?

best regards

Sorry for the late reply, I have jumped ship since. But as far as I remember the “only” problem I had was that it simply did not work - HomeKit and the phone did not talk together as advertised - an extremely lacy oversight on Apples part. However I have presence detection working using Home Assistant and their iCloud component pulling the phone location from “Find my iPhone” - it works very very well and quick. I don’t know if OpenHAB have a similar solution.