Presence detection with iPhone and HomeKit and Home App Action

I started using homekit to monitor my presence at home.

As homekit works quite well for me now I started something new.
I mainly use homekit with dummy-switch-items (with no binding) to activate and deactivate scenes I defined with rules.
This way I use it for lights, hue-lights, blinds, heating, sonos, harmony hub and hyperion ambilight.

I started using owntracks for presence detection, but I discovered that it is also possible and maybe much easier to use actions in the home app on the iPhone:

I again used dummy-items:
I use 2 groups, because I use the iPhones to detect if am in the zone around the house and how many.
Only when my main door opens I set my presence to ON

Group:Switch:OR(ON, OFF)	gAnwesenheit	   "Anwesenheit HomeZone [(%d)]"	<present>	
Switch 					Anwesenheit	   "Anwesenheit"				        <present>	[ "Switchable" ]

Switch	Home1			"iPhone1"	<present> (gAnwesenheit)	[ "Switchable" ]
Switch	Home2			"iPhone2"	<present> (gAnwesenheit)	[ "Switchable" ]
rule "Anwesenheit ein"
when
	Item MainDoor changed to OPEN
then
	if (gAnwesenheit == ON) {
		Anwesenheit.sendCommand(ON)	
		}
end

rule "Anwesenheit aus"
when
	Item gAnwesenheit changed to OFF
then
	Anwesenheit.sendCommand(OFF)	
end

On my iPhone it was very easy:
Just setting up 2 actions, one for leaving the home zone and one for entering the home zone and switching the my dummy item OFF or ON

For the iPhone of my wife I had to invite her in the home app to our house and give her the right to make changes.
Then she had to set up the 2 actions in her home app using her dummy item.

The actions show up in the home app on both iPhones but really work independently.

I am right that you need either an iPad or an apple TV running permanently to use this approach?

yes thats right, thats needed

Have you noticed a big change in your battery life after getting this set up? I thought about doing something similar but didn’t want to burn through my battery.

I use the iOS location service (geofency, owntracks, reminders …) since a long time now and I do not experience a major impact on battery life.
Once you started using this service in iOS it does not matter how many apps are using it

I am also thinking about presence detection and your approach sounds interesting. But door open is not sufficient for me as there are several ways out :wink:
So I currently think about iBeacons as an additional sensor for presence - https://www.google.de/amp/s/www.housecontrollers.de/hausautomatisierung/homekit/apple-homekit-bluetooth-sender/amp/

Cheaper iBeacons are available compared to above (german) article.

Maybe worth a try.

Uwe

@Dome and LuFriFri
Did you find a way how Geofency can communicate to OPENHAB directly without the support of a “protocol translation” service by a server on the internet.

No, I did not find a way to do that.
I used Geofency with iobroker, but had to open a port on my router.
I read that one can connect iobroker to openhab, perhaps that helps?

Hey there,

I got this solution working with the “switchable” items. They are working by pressing the switches manually but i´ve another problem. The automation rule in the apple home app can´t be activate…
I´m really confused about that…
At home there is a Ipad mounted on wall and it is running as the “Main device”

Any ideas about an solution?

Best regards