Homeassistant in RV: Update homeassistant.set_location with device_tracker attributes

Hello i have a homeassistant instance running in my rv.

I want to update the homeassistant location with the GPS Data from a tablet in my RV.

The device_tracker.tablet is the entity with the attributes longitude and latitude.

How can i build a automation to update the homeassistant location with the given gps data?

Here is an automation snippet that I use for the same use case

service: homeassistant.set_location
data_template:
  latitude: |
    {{state_attr('device_tracker.tablet','latitude') | float}}
  longitude: |
    {{state_attr('device_tracker.tablet','longitude') | float}}
1 Like