Is it possible to create a software device Tracker?

Is is possible to create my own Device Tracker? Something like a Helper Button.

My Goal is track if a person is at home by using a HomeKit automation.
The HomeKit automation has the trigger “Arrives at home” and switches a Helper Button on.
With this helper button I trigger some automations in HomeAssistant and it works like it should be.
But I also would like to set a HomeAssistant person to be shown as is home.
For this I thought a fake device tracker would make sense.

If there is another solid solution I am happy to hear.
But I can’t use the icloud integration because my son does not share his location with me and using my router does not work because sometimes he turns his phone off and this would mark him as away.

you can create a devce tracker and then use the device_tracker.see service to set the location.

I only may create device_trackers by some integration.
Since all trackers created by integrations are needed, I added three device_trackers by Demo integration.
Then used the “device_tracker.see” service.

If you have a boolean then all you need to do is add this boolean to a yaml (gui doesn’t work) group with the other family members.
Then you have a group that has the state home/away when family is home or this software boolean is on.

The method I have used in the past is to create a dummy entry in the known_devices.yaml file. There has been a warning about known_devices being phased out since v. 0.94, but it’s still working as of 2022.09…

#known_devices.yaml

my_manual_device_tracker:
  name: Manual Device Tracker
  icon:  mdi:cellphone
  track: true

The service to set the location would be something like:

service: device_tracker.see
data:
  location_name: home
  dev_id: my_manual_device_tracker
1 Like

@Didgeridrew
Can I just create a known_devices.yaml file?

Thanks it worked!
I created a known_devices.yaml file and added some devices.
This devices are connected as a tracker to the persons in HA and the trigger which is listening to HomeKits “Arrives at home” calls the service .see

2 Likes

I wish I would have thought of that…

1 Like

Hi! I’m looking to do this same thing. New to HA. I don’t see the Known Devices yaml. Did you end up creating it? Where?

Since it isn’t used by most device tracker integrations anymore the known_devices.yaml file is no longer created automatically, you must add it to your config/ folder.

Brilliant. I was looking for this for at least 1.5 years. As device_tracker entities are the only ones be chosen as person tracker entities.

The Composite tracker custom integration can also be used to translate binary sensors into device trackers.

1 Like

Wow, another great option probably outperforming the legacy known_devices.yaml approach. On the other hand it’s a custom integration… at least there are no open issues. Do you have experience with that integration?

Yes, it works well and was created by a long-time forum member and contributor to HA.

I use a virtual integration to create a device tracker. Then call a device_tracker.see service, works absolutely great.

What’s a “virtual integration” Ildar?

I do not have access to my HA, cannot give you exact link.

Googled, this one:

1 Like

In modern HA you don’t need to create a virtual component. If you just call device_tracker.see with a new dev_id, the new device_tracker will be added to HA automatically when the action is first executed.

That is correct.