Skip to content

A custom component for Home Assistant to detect iPhones connected to local LAN, even if the phone is in deep sleep.

License

Notifications You must be signed in to change notification settings

mudape/iphonedetect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iPhone Detect for Home-Assistant

Validate with hassfest HACS Validate hacs_badge

downloads downloads downloads

This integration sends a mDNS message to defined hosts.
The device responds if it's connected to the network, even when in deep sleep, and an entry in the ARP cache is made and read.
Usefull as a device_tracker for your person integration to see if users are at home.

Installation

After installation you need to restart Home-Assistant before using the integration.

Using HACS

If you dont' have HACS installed yet, I highly recommend it.
Open your Home Assistant instance and open a repository inside the Home Assistant Community Store. or search for iPhone Device Tracker.

Manual

Download the iphonedetect directory and place in your <config>/custom_component

Configuration

Network

Assign a static IP address to the device you want to track, probably in your router.
Alternative, set a manual IP in your device WiFi configuration.
Avoid automatically connect to differtent SSID's (2.4 and 5 ghz bands)

Setup

Open your Home Assistant instance and start setting up a new integration.

If you don't have My Home Assistant redirects set up, go to Settings -> Devices & Services
Click "Add integration" and search for iPhone Device Tracker

Give the entity a unique name and enter its IP address.

image

This will create an entity device_tracker.<name>

Repeat the steps for additional entities.

Options

You can change the consider home timeout per tracked device in the UI.
Default is 24 seconds.
image

Reconfigure

You can change the IP address of the tracked device in the UI.
image

Troubleshooting | FAQ

Private Wi-Fi address The device private MAC address will remain the same for each network, as long as the network isn't recreated or rotating (iOS 18+) MAC is used.

In other words, if a tracked device no longer can be found the user have propably recreated the connection to your Wi-Fi forcing a new random MAC address to be used.

Note that if your WiFi has different SSID for the 2.4 and 5 ghz bands, and the phone has private network enabled, two different MAC will be presented to the DHCP.
Most likely that will require the integration to track two IP's per user/Person.
So, for best result only have/connect to one SSID, turn off private network and assign static IP.

False or flaky not_home status Especially when the network has multiple Access Points, tracked devices sometimes are marked as not_home when actually connected to the network. Increasing the consider home timeout might help this. Most likely it's a network issue though, try placing your AP's at different locations.

Devices might auto-update during night, they of course then will be not_home for awhile.

Attribution

Original idea from return01

Disclaimer

Author is in no way affiliated with Apple Inc.
Author does not guarantee functionality of this integration and is not responsible for any damage.
All product names, trademarks and registered trademarks in this repository, are property of their respective owners.

Buy Me A Coffee

About

A custom component for Home Assistant to detect iPhones connected to local LAN, even if the phone is in deep sleep.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages