Hi everyone, starting from June release, Template entities support the device tracker platform since device_tracker.see is deprecated. Sadly I am not able to replicate the flexibility/customizability of device_tracker.see.
E.g.:
I was able to value device_tracker.see state with output of different sensors. E.g. my wife and I have a common car, so I was populating my device_tracker.see with the gps coordinates of the last person that used that car in order to save the parking position once Androdi Auto connection dropped off. Then I was able to visualize on phone dashboard the position of the car (so no matter who parked it).
My automation was as follow (and I have the same automation for my wife Android Auto sensor that works on the same device_tracker.see):
Well, the logic I would implement is a little different: it is not basing on gps coordinate, but using the phone sensor when connected to a determined wifi network.
E.g. if the "sensor.my_smartphone_wi_fi_connection" indicates being connected to "My Home" ssid then the state of the device tracker should be "home", otherwise "not home"
Regarding the android auto based location, do note that as template device trackers do not restore state, you'll loose the state if you restart HA while the car is parked.
So if you're wife parks the car somewhere, while you are home working on HA and perform a restart, the template device_tracker will become unknown
To work around this, you could create a template sensor to store the coordinates, as the template sensor will restore state, and then use the template sensor for the template device_tracker. However, you might see there will be no need for the device_tracker, as a template sensor with a longitude and latitude attribute works quite similar as a device tracker and also shows on the map just fine.
Right now I configured it as described above, but I'll probably get rid of the device tracker soon.
This is my config at the moment:
I used trigger variables instead of an jinja if statement.
I also added an action to force a location update in the mobile app.