Presence detection not reliable

Hi all,
Home assistant is a stable platform and I want to use presence detection on it because on my homey it is not reliable. But on HA it seems even worse. My goal is to see the presence of a person in realtime.

I have installed HA on a virtual environment and use a fritzbox modem/router. The presence must be detected of a Iphone and a Samsung phone (IOS and android)

In the configuration.yaml I have the following lines:

device_tracker:
  - platform: fritz
    host: XXX.XXX.X.X
    username: username
    password: password
    consider_home: 30
    scan_interval: 12
    new_device_defaults:
    track_new_devices: true

  - platform: ping
    hosts: 
           device_name_1: XXX.XXX.X.XX
           name_1: "phone user 1"
           device_name_2: XXX.XXX.X.XX
           name_2: "phone user 2"
    consider_home: 30
    scan_interval: 12
    new_device_defaults:
    track_new_devices: true

  - platform: bluetooth_tracker
    interval_seconds: 15
    consider_home: 60
    track_new_devices: yes

In my known_devices.yaml I have the following lines:

device_name_1:
  name: device_name_1
  mac: macadres wifi
  icon:
  picture:
  track: true
device_name_2:
  name: device_name_2
  mac: macadres wifi
  icon:
  picture:
  track: true

The update status of both phones takes often hours and is not useable.
Can some please put me in the right direction to let it work prober?

Thanks
ps. I have also installed the HA compagnion app on both phones.

the Fritz!Box is updating devices very slow, i wouldn’t recommended this integration for person presence detection. Ping for mobile devices is even worse.

With that i assume you can’t use bluetooth or did you have the possibility to access an usb dongle? What virtual environment do you use?

That is what i would use. You should have entities device_tracker.name_of_your_phone automaticaly created and this is the best way to start.

@florian.ec
I use a qnap nas with vmware as virtual environment. You are right, bluetooth is not working for me.
I also have the have entities device_tracker.name_of_your_phone but that also does not work great.

Now as a last resort I will try Nmap and ping together. Maybe that helps.

Thanks for your ideas.

it does 99% for me. Is gps always on on both phones and the app can run in background? You maybe need to set exceptions in energy management etc. for the compagnion app on these phones.

The big difference with gps and bluetooth/ping etc is that it work out of the box. If you entered the zone your home, even if your phone is then off. Bluetooth and ping would need some further automations for that.

gps is always on on both phones and the app is also set to always in the energy management.

I’ll keep on trying.