Using iPhone as a presence sensor

Hi everyone - I'm relatively new to Hubitat and have been using my iPhone as a presence sensor. I have Mode Manager installed, the location is set under location and modes, and I have HSM set to arm the alarm when I depart from the geofenced area.

The problem I am having is that the alarm gets armed sporadically while I'm still home because Hubitat thinks I've left. Are there any solutions for this? Any place I should check as to why Hubitat thinks I'm no longer present?

Quick answer is that the iPhone will let the WiFi sleep, which then makes the presence sensor rely on GPS, and then triangulation from cell towers. Accuracy is best when you have WiFi + GPS, okay with GPS, and poor when limited to triangulation.

Most people will utilize 2-3 different presence methods and then use an app like Combined Presence Sensor for use with their automations.

1 Like

what other ways are there to detect presence? I am also very interested in setting presence up correctly.

There are key fobs that can be used for presence, like the Smartthings Presence key fob (getting hard to find). I believe others also makes some but don't know of any off the top of my head. I've heard of others that have been using a regular sensor that they place in there car and when it get's home, they will use any reporting from the sensor as being present.

But you have to know that the key fobs use up batteries real fast and many people are put off from this limitation.

Motion sensors work too, combine via the combined presence app with your phone.

Basically, the more combined, the better particularly if you are tying HSM actions to presence. For that though I'd really just recommend manually arming/disarming when you leave, otherwise I suspect you'll still get the occasional mis-arming of your alarm system.

You can get the iPhone to not sleep you just need to have some apps that are allowed to have access all the time. My iPhone always shows connected and I'm using the WiFi presence to do that.

I have found that an iPhone connected to HE via HomeBridge makes a reliable presence sensor without having to use any kind of combined presence.

You just need to setup an automation in HomeKit to trigger a virtual presence sensor in HE.

1 Like

If your phone never sleeps, don’t you run into issues with battery life?

1 Like

If you use Amazon, the Alexa app presence works pretty well. I get no false alerts and it works well coming and going. I use routines to link to HE.

I do this without homebridge, but I do have an Apple TV that serves as a HomeKit hub. I agree that it’s been surprisingly reliable. I’ve had it set up for a few months now, and I’ve never noticed it failing. It reports arrivals fast enough to use in automations right when we arrive.

Could elaborate how this is done, we have Alexa but with underuse it for sure, now that the wife is getting comfortable talking with "her", we are slowly looking into adding a few things in there.

You would use a virtual presence sensor that also has a switch capability (there are a couple out there in other threads).

Use the Alexa app to create two routines such that when you arrive/leave, Alexa turns the virtual switch on/off.

Since the Hubitat virtual device has both presence and switch capabilities, the device will show as present or away in sync with Alexa turning it on/off.

Then you can use the virtual presence sensor to trigger Hubitat automations just like any other presence sensor.

1 Like

ok, I guess, this is where I was missing some info, I deleted the app once the Echo was setup, I guess I'll have to install it again, but I'm guessing that the app needs to be on the phone for this to work or can I just pair via Bluetooth to the echo device and use that as a presence sensor instead of the app/gps info? (I hate all these apps that keep track of you and sells that info to others).

You will have to go to the Alexa app and set your location and geofence settings which is under the settings.
In HE you need to set up a virtual switch called "i'm back" and "goodbye" this is up to you. I set it up as a Virtual Momentary Switch with 500ms auto off.


Also expose this switch to the Amazon Echo Skill.

You also need a HE rule to perform the functions that you want to happen when you arrive and leave.

In the Alexa app you will need a routine to run when you arrive and leave the geofence that triggers the virtual switch.


This should do the trick.

3 Likes

That’s correct. The Alexa app on the phone handles the geolocation part of the process, so it’ll need to remain installed on the phone with necessary permissions. So yes there’s the concern re: giving even more personal data over to Amazon as a result :face_with_raised_eyebrow:.

One thing to wonder is why is this app more reliable than the Hubitat app ??? Wouldn't the iPhone just kill the process just like all other apps unless I open it every other day or something? Makes you wonder, hmmmm.

The only reliable way i found to use an iPhone as a presence sensor is trough HomeKit. It works flawlessly every time. Haven't tried Alexa Geolocation yet, but i can say wifi detection is useless.

1 Like

In the Alexa app you can create a routine with your devices (phones) location as a trigger. Example: Trigger- When this device arrives at Home.
Action- porch lights= on
Action- say “welcome home master”
From - This Device
In order for it to work you must set Alexa app location services to “Always”

Your phone with the app is just your access point for the Amazon cloud which is what handles all of your Alexa routines. The app is an ESSENTIAL part of all echo products. It’s your control center. Routines are a group of actions to be performed when a specified trigger happens.

Same here for iPhone.

I’m currently testing ways to have my front door Auto Unlock when I walk up to it but instead of triggering the unlock yet I’m just having hubitat send me text messages of the proposed action each time so I can monitor any false positives before introducing something that might auto-unlock for a stranger.

Anyway, one of the tests I’m running is an automation of a virtual switch from Hubitat I have in Apple Home (via Homebridge). When iOS detects I’ve left home the switch turns off and Hubitat sends me a text messsage. When iOS detects I’ve returned home it flips the switch on and Hubitat sends me a text message.

Departure event doesn’t arrive until I’m about 3-5 houses away. Arrival event seems to trigger when I get about 1-2 houses close to home again.

Been running this (and some others) for about two weeks and have not had a single false positive or noticeable delay. If you’re pulling presence from iOS directly (vs an app) its super solid.