Ping + Arp custom_component device tracker

In the config folder. If you don’t have the folder, you will have to create it.

1 Like

Is “count” in seconds?

Hi, count is the number of packets sent by the ping command. 5 is a common number to avoid false positives.

Does Android phones behave the same way?

Easy to test.
Just connect the phone to your wifi, and from other computer just ping the android phone and confirm it respond.
Now run arp -a to display the arp table and find the android phone ip / mac address
Turn sleep your android and wait until it does not respond to ping.
Run again arp -a and you should still see the ip / mac address.

Finally disconect the android phone from the wifi and wait a few seconds and run again arp -a.
The entry ip / mac address should be gone.

Did something similar a while ago using a simple bash script.

I got false positive sometimes, so this is not reliable :frowning:
This night for exemple I was home and my iPhone switched 2 times from “home” to “not_home” during 1 minute.

I will try to remove ‘consider_home: 60’ to see it’s the problem.

I think this is normal with the iPhone. No one knows what they do at night. :blush:
Also seeing this from time to time.

Hi @jean675 Is the other way arroud. to avoid false positives when you set a too low value for “consider_home”, consider to increase it to for instance to two minutes: consider_home: 120

It still doesn’t work with consider_home : 120.

14

the first line shows me I’m absent from 05:43 to 05:43
the second line shows me I’m absent from 06:38 to 06:40
the third line shows me I’m absent from 08:03 to 08:04
the fourth line shows me I’m absent from 09:50 to 09:50
the fifth line shows me I’m absent from 10:59 to 11:00
the sixth line shows me I’m absent from 11:30 to 11:31

I have an iPhone X with iOS 12.2

Here is my component :

device_tracker:
  - platform: ping_arp
count: 5
consider_home: 120
hosts: 
  iPhone_de_jean: 192.168.1.30
new_device_defaults:
  track_new_devices : false

Don’t know if my settings or if the component is not reliable with iPhones.

works fine for me. indents maybe?

device_tracker:
  - platform: ping_arp
    count: 5
    consider_home: 120
    hosts:
      host_1: 192.168.1.30

And you have checked so this is not an internet problem?

not a syntax problem
not an internet issue, and in any case it’s LAN only

hi @jean675, can I ask you which hardware is running home assistance? raspberry? wifi?

Hi [JBelinchon]
I has add code
device_tracker:
- platform: bluetooth_tracker
track_new_devices: false
- platform: ping_arp
count: 5
consider_home: 120 #This setting speed up the transition from home to not_home
hosts:
myIphone: 192.168.1.15
- platform: ping
hosts:
hostone: 192.168.1.15
Anh copy file device_tracker.py to ping_arp folder
In known_devices.yaml show

myiphone:
  hide_if_away: false
  icon:
  mac: 04:D1:3A:D9:EF:80
  name: Kien ơi
  picture:
  track: false
hostone:
  hide_if_away: false
  icon:
  mac:
  name: hostone
  picture:
  track: false

but in home assistant UI , do not have device_tracker.myiphone
or device_tracker.hostone

Please help me

Just turn true the device you want to be tracked.

myiphone:
  hide_if_away: false
  icon:
  mac: 04:D1:3A:D9:EF:80
  name: Kien ơi
  picture:
  track: true

when use your component, do i need use ping component or i remove it ?

That does not mean that the router does not drop the connection, internet or no internet

They can live together

it mean I cant remove ping component
Thank your repply, i come from Vietname.
sorry about english