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.
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…
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
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.
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?
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.