At least, I think that is a suitable question! A fuller expenation is:
I want to show a Map Card on my dashboard. The spot in the center, should be the ESPHome GPS reciever that is is providing the lat/long sensors to HA.
From what I can gather, given the above I need to create a "tracker" (using Settings | Devices & Services | Helpers | Templates | Device Tracker?) and use that Tracker in my MAP Card.
However, if this is the correct workflow, I can't figure the Device Tracker GUI?
In particular the Zones field. This is what I've got...
The "zone.home" attributes "Latitude" & "Longitude" are equal to Motorhome_GPS "sensor.gps_latitude" & "sensor.gps_longditude".
The first pair, defined by hand in Settings | Devices & Services | Areas, labels & zones | Zones.
And the second from the ESPHome device with the attached u-blox reciever.
The setup preview of the device tracker shows that the "device" is "Away" and I am expecting "At_Home".
If the sensors' IDs are "sensor.gps_latitude" & "sensor.gps_longditude", why are you using "sensor.motorhome_latitude" & "sensor.motorhome_longitude" in the Template device tracker config flow?
Because that is only true now. And the Tracker shopuld say "Ay_Home".
As soon as I drive down the road, they won't be equal and the Tracker should say "Away"?
M.
I don't understand what you mean by that... the sensor entity IDs used in the Template device tracker config flow need to be the entity IDs of the sensors that actually provide the motor home's latitude and longitude.
How is the device that provides the motor home's coordinates communicating with HA?
depends on what you filled out last. Your in_zones is a static template that never updates, meaning when lat/lon update, they will always provide the state. However when you first create the entity, in_zones will likely be honored because it gets all 3 templates at the same time. In that case, in_zones will be honored until lat/lon update.
I.e. You probably filled out that form top down, making lat and lon in the preview the "last updated template", and your lat/lon are probably outside your zone home radius.
Sorry that I am not as clear as I shoul be.
The Motorhome has an on-board Raspbery Pi running Home Assistant that monitors all the Motorhome stuff (V.Battery, L.Battery, Waste Valves, Air Temps etc). The HA zone.home was created when I installed HA and populated the Lat/Long variables with the Motorhome storage location.
I now want to track a ESPHome device based on an ESP32 & U-Blox GPS reciever.
This ESPHome device will "ride" with the Raspberry Pi in the motorhome.
I would now like to see the location of that ESPHome device shown in a Map Card.
As this is all for a mobile HA instance I might suggest changing your methodology. Since there are quite a few components that are tied to physical location like sunrise/sunset, weather, etc it would make more sense to have the Home zone be the actual location of the motor home. Frenck's custom skill Spook offers actions to modify zones for just this kind of thing.
You would just need to set up an automation to update the zone based on the values from your GPS unit.
Then, to keep track of whether the motor home is at the storage location, you would create a zone for storage and use a Template binary sensor to monitor the distance between zone.storage and home.
template:
- binary_sensor:
- name: Motorhome at Storage
device_class: presence
state: |
{# On if the distance between Home and Storage less than 1km #}
{{ distance("zone.storage") < 1 }}
If you prefer to continue with the Template Device Tracker...
Is the actual entity state incorrect, or is it just incorrect in the preview shown in the Template Device Tracker config flow?
If it's the actual state, the possible issue I can see from what you have provided is the entity IDs you are using. Based on the ESPHome config you provided I would expect the entity IDs of the sensors to be sensor.motorhome_gps_latitude and sensor.motorhome_gps_longitude... double check that what you are using in the Template Device Tracker flow is correct.