Using a device tracker coordinate as a zone or create a sensor that detects distance between 2 devices trackers

I currently have a tile tracker and GPS logger for the phone.
I am trying to determine a way to create the following alert:
if the coordinates of the tile tracker and the coordinates of the phone are .5 miles apart or greater, then send an alert.

Is it possible to create a zone that dynamical updates the coordinates of the tile tracker? If not then the next option I can think of would be a template variable the calculates the distance between the two devices and based off that distance it would give an alert.

Thanks in advance!

I used google travel time between the two coordinates. Now if I can use the distance attribute and make a comparison to being > than .5

“destination_addresses”: [
“origin_addresses”: [
“status”: “OK”,
“mode”: “walking”,
“units”: “imperial”,
“duration”: “1 hour 38 mins”,
“distance”: “4.9 mi”,
“unit_of_measurement”: “min”,
“friendly_name”: “ItemDistance”,
“emulated_hue”: false

I use the google travel time as well. I also have a binary sensor that turns on if the distance between two points does not equal a set number (Meaning that the path it is taking is different from usual)

platform: template
    value_template: '{{ (state_attr( "sensor.home_to_work_time", "distance")/1.609 |float)|round(1) != 23.5 }}'
    friendly_name: 'Alternate Route'
    device_class: moving

The value_template takes the distance attribute, converts it to miles, rounds it to 1 decimal and then compares it to see if it equals 23.5. If so, it turns the binary sensor off, otherwise it is on.

Thanks for the inspiration!

I used your idea to make the following:
value_template: “{{ (states.sensor.itemdistance.attributes.duration.split(’ ')[0] | int) <= 5 }}”

I originally used the distance attribute but because it alternated between ft and mi the values were inconsistent. So i kept duration, now it give a binary value for if the distance is greater than 5 minutes.

I have a Waze sensor that uses two device trackers. Mine and my wife. Nothing fancy, no templates.