AirTag "integration" (user friendly + device tracker)

with this integration and apple airtag i can track when i left and came home ? if i can explain how if the phone and this tag will always be with me ?

Yes, you can.

However, i think there are better ways to do It in Home Assistant :sweat_smile:

How? please explain

There are multiple ways, based on GPS using device trackers, WiFi (i.e. NMAP) , Bluetooth (i.e. Bermuda) …

Hi,
do you resolve this problem?
I tried sensors.yaml, configuration.yaml but stil can’t see sensor.
Restarted HA and host.
In “check configuration”:
Configuration warnings

Platform error ‘device_tracker’ from integration ‘rest’ - No module named ‘homeassistant.components.rest.device_tracker’ Platform error ‘device_tracker’ from integration ‘template’ - No module named ‘homeassistant.components.template.device_tracker’

I use this guide

Thank you!

My code:



  - platform: rest
    name: airtag_karta_aiyato_geo
    value_template: "{{ value_json.results[0].formatted }}"
    json_attributes_path: "$.results[0]"
    json_attributes:
    - lon
    - lat
    verify_ssl: true
    scan_interval: 900 # every 15 min
    force_update: true
    resource_template: >
     {% set address = states('input_text.airtag').split('karta_aiyato')[1].split('•')[0] %}
     {% if address == "HOME" %}
      {% set home = "FULLADRESS" %}
      {{
        "https://api.geoapify.com/v1/geocode/search?text="
        + home | urlencode
        + "&apiKey=YOURAPYKEY&format=json"
      }}
     {% else %}
      {% set fix = address + "FIXADDRESS" %}
      {{
        "https://api.geoapify.com/v1/geocode/search?text="
        + fix | urlencode
        + "&apiKey=YOURAPYKEY&format=json"
      }}
     {% endif %}

  - platform: template
    sensors:
    airtag_karta_aiyato:
      friendly_name: "karta_aiyato"
      value_template: >
        {% set home = "STREETNAME" %} 
        {% if ":" in states('input_text.airtag').split('karta_aiyato')[1].split('•')[0] %} 
        {{ states('input_text.airtag').split('karta_aiyato')[1].split('•')[0].split(',')[0] }}
        {% elif home in states('input_text.airtag').split('karta_aiyato')[1].split('•')[0] %}Home
        {% else %}
        {{ states('sensor.airtag_karta_aiyato_geo') }}
        {% endif %}
      attribute_templates:
        latitude: >
          {% if ":" in states('input_text.airtag').split('karta_aiyato')[1].split('•')[0] %}null
          {% else %}{{ state_attr('sensor.airtag_karta_aiyato_geo','lat') }}
          {% endif %}
        longitude: >
          {% if ":" in states('input_text.airtag').split('karta_aiyato')[1].split('•')[0] %}null
          {% else %}{{ state_attr('sensor.airtag_karta_aiyato_geo','lon') }}
          {% endif %}
        status: >
          {% if ":" in states('input_text.airtag').split('karta_aiyato')[1].split('•')[0] %}unavailable
          {% else %}available
          {% endif %}
        last_update: "{{ as_timestamp(states.input_text.airtag.last_updated)|timestamp_custom ('%d/%m/%Y %H:%Mh') }}"
      icon_template: mdi:bag-personal