Track persons from another Home Assistant instance

I was trying to get my parents and brother’s GPS data from their Home Assistant into mine. It took me a while until I figured it out.

First, you’ll need a long-lived access token from the other Home Assistant instance.

Go over to your configuration.yaml and use the snippet below.

sensor:
  - platform: rest
    resource: https://[anotherHomeAssistantIp]/api/states/person.[entityToBeTracked]
    name: John Doe
    json_attributes_path: "$.attributes"
    scan_interval: 600
    value_template: "{{ value_json.state }}"
    json_attributes:
      - "latitude"
      - "longitude"
      - "gps_accuracy"
      - "friendly_name"
    headers:
      Authorization: Bearer [long-lived access token goes here]

After a restart, you can use the sensor in your map cards. A small step for the community, but a big step for me. Hope you find it useful.

2 Likes

Thanks, really useful post! Just created another HA instance which I will use in a vehicle, this is exactly what I need to get data (state of battery, etc) into my main instance to show on dashboard