So I have tried to solve this presence issue so many times in so many ways. Everything I have tried has kinda worked until it doesn't. Currently I"m using Combined Presence with the Habitat App + iPhone WiFi drivers. Lately it's just not reliable. Wife's phone NEVER leaves any more unless you manually send a GeoEvent.
So basically I would like to try another go at using the built in iOS presence. I have HomeBridge already. And I have multiple Apple TVs. I have failed in the past because I just couldn't find all the pieces to make it work.
Is there a neat, tidy, relatively easy to follow guide somewhere here in the Hubitat Community site? (Or an existing thread?) Seems like I'm not the only one (given all the questions and complaints about presence issues) that would benefit from this.
I know I've typed out a reasonably detailed set of instructions a couple times over the years in this Community... but here goes again...
There's 3 parts in my head that have to work in concert...
Apple HomeKit with an always on device (Apple TV, iPad, Homepod.)
Homebridge running on an always on Computer. It's a NodeJS app and thus there's a dozen ways this can be built.
Tying it all together using a "Hybrid Presence" virtual device.
For Apple's HomeKit, you really just need to follow Apple's instructions for making one of you Apple TV's the HomeKit server. This is required to enable Automations. Once you see Automations in the Apple Home app, then you know this part is done.
For Homebridge, some people use a RaspberryPi, some use an always on spare (practically obsolete) computer, some use a NAS, and some use a Mac Mini that's intended to be a Media Server. That last would be me. There's plenty of spare power left over to run many NodeJS apps, Homebridge is just one on mine. I also have Node-Red and HubConnect proxy too. The instructions for Homebridge is covered well in this Community specifically related to adding Hubitat as a Homebridge Platform.
Once you have Homebridge running and have selected a device or two to "mirror" onto your Apple Home app... and have tested it to verify clicking the buttons on the Home app work, then it's time to build a presence virtual device.
This is not at all tricky but there is a trick. Presence is a Sensor. You have to create a virtual device in Hubitat, set the Virtual Presence device driver, then "mirror" that to Homebridge and have it show in your Home app. I go one step further and use a "Hybrid Presence" virtual driver that combines a Switch with Presence.
The final step is to create automations in the Apple Home app to detect "when I get home" or leave. You'll need two automations per person. One for arrival, one for departing. When you initially create an Automation it will default to "when anyone arrives" and you'll need to select a specific person. That usually means you have to set up the other person's phone to be part of the Family and share presence. You'll know you got this right when you have the Option to pick individuals in the Automations.
That's it. Don't try and move forward until all the previous steps are tested as working.
If you want to use the hybrid driver, you'll find many of them, but here's mine:
This driver couples Presence to a Switch and vise versa. This allows you to set Presence from Hubitat via the switch. Normally, since Presence is a Sensor, just like a Door Sensor, you can't change a sensor. The door is either open or closed and you can't tell the sensor what to report. A switch on the other hand is an Actuator and just like a light switch, you can tell it what to report. By combining these into a single hybrid driver, you can force presence. If you need this, great, if not, just use the standard Virtual Presence driver. You can always change it later.
Thank you! I’ll give this a shot soon. I have HomeBridge running on a Pi4. I think where I have fallen down before that though I like in the Apple ecosystem, I have not really ventured into HomeKit. I’ll give it a go.
This is just a really tough thing to accomplish. Like you, I’ve had very good success, then it fails. I have used multiple triggers for extra security, and that’s even more of a pain.
I have found that my iPhone would always report presence/absence, but my wife and daughter’s iPhones would work for a while and then fail. This might have something to do with both of them regularly letting their phones drain until they shut down. Something I’ve only done twice in the three years I’ve had my iPhone 10.
I just stopped using location services. Much happier now.
Presence seems like one of the most useful tleings ever. Turn off stuff, make sure locks are locked, arm security and cameras etc. when I leave. Turn on lights and so forth when I come back. AND YET, I've struggled with this for 5 years. Over 3 years with SmartThings and now 1+ years with HE. I have considered that I would be happier to just give up.
But hope springs eternal. I seem to finally have Apple Presence working. BUT it's not super reliable. I still have phones coming/going randomly. SO now I have added it to Combined Presence and am awaiting a Christmas miracle of reliability.
Merry Christmas everyone. May all of your automations fire. And if I'm not asking too much, may all of our presence sensors, actual and virtual, just work. At least for awhile.
In the same situation here. We have always had Android phones until recently. In the Android I used the HE app, Life360, Google assistant, and Alexa routines. Virtually 100% of the time at least one of those worked and most of time all of them did.
Just switched to Iphones. Life360 works maybe 90% of the time. The HE app never seems to report unless we open the app. Google and Alexa never work. I have checked all the settings regarding location, etc.
Androids have got very agressive with shutting down location and wifi in the past few years, then they added a security "feature" where they randomize the MAC address for privacy. That all really messes with presence. So it isn't just the iPhone.
Presence is one of those things that is poorly supported by the smart home industry in my opinion. This isn't necessarily at the hub level, that hardware and software is mostly in place waiting for devices that report presence.
Rather, this is a lack of things like small battery friendly Zigbee or Zwave fobs/tags, local location on your phone without killing the phone battery or using the cloud, presence detectors for rooms (utilizing ultrasonic, heat mapping or other technologies), and more.
Instead we are stuck with these crazy workarounds that sorta work most of the time. It is funny how your phone can track your every move, and Google and other companies can advertise items you are considering purchasing almost in a stalker-like manner, yet we can't make smart home presence work.
Couple of questions that I hope don't sound too stupid...
First, I added in the virtual presence sensors (csteele's) like described... I even removed the switch capability through tonesto's app... So I have 5 vitural presence sensors in my Homekit... When I try to add an automation, I can select the individual person but can't select the presence sensor to act on... Did I mess this up? Was I supposed to present the switch on the Homekit side and leave presence just for the Hubitat side?
Second, how do I add another location to the Homekit? I want to add my in-laws home as I have a remote hub there connected via HubConnect... I'd like to have presence function there as well...
Apple detects the phone and it's either "present" or "not present". That's the Sensor that you are testing within the automation. It's an internal (not visualized) sensor within IOS. In other words, HomeKit sets its own Presence Sensor. You then test that sensor via HomeKit Automation and can turn devices on/off based on the state of the sensor.
You need a virtual switch on the Apple side that you can change via Automation. That switch is mirrored back to Hubitat and my driver will copy the switch state into a virtual presence.
Thus I think you did the Tonesto side backwards. Expose the switch and hide the Presence. Then you'll find the switch in Apple's Automation.
You use your phone to set a new location in an Automation. Create a new Automation and choose "People Arrive" then click Location.. That will bring up a map and you can "drop a pin" on a new location. Click Done and accept the "People will be removed" message. You cannot use this feature to track others. They have to track themselves and permit you to see that tracking. By accepting that message, you will be able to tell when your phone goes inside of or outside of that location. You'll have to do this individually on each phone for others.
For those following this thread, I’m happy to report that using HomeKit plus Wi-Fi presences
with Combined presence has been really reliable the past few days. I’m hopeful this will be pretty trustworthy. Thanks again for the help.
I expose both the Switch and the Presence back to HomeKit in my setup. That does give me two tiles but I want to "hide" the switch portion and display the Presence portion because that's the only way to see the state of that invisible IOS presence.
On my main Home App screen, I have the Presence tiles and then deep in another "Room" that I call "Whole House" is the switch. Which means if I'm really intent on changing Hubitat's perception of a Presence, I can dive deep into the Home app and do it. But I won't accidentally change Presence by fat fingering the home screen.
Great idea with moving the switches... I'm trying to set automation for the other house but having a few issues... I'm starting off by using myself first and then I'll setup the rest of the family... When I start the automation screen and then add the other house location, it seems to work... I get all the way to done and hit done with no issues...
The new automation doesn't show up in automatons though... Is it somewhere else?
Now I want to add the wife, kids, in-laws... For the other address... I re-read your post on it and I'm still not clear... I tried it on my phone and it won't let me... I tired it on their phones and it won't even let me add an automation...