AirTag "integration" (user friendly + device tracker)

Hi!

You dont need It. The shortcut splits the information, so you just need to create a second sensor to get the data.

Please follow the guide :blush:

Thanks, I read and reread the guide but I missed this point, sorry.
Then the 2 airtags that I use were together and in the sensor I always and only saw the first one, this morning I brought the second one with me and it magically appeared with its new position.
THANK YOU

1 Like

Yeah the solution is a bit hacky, but very creative and for now the only option we have. Until Apple adds the devices to the website.

Or better (I hate Apple products), that the android tags get a bit cheaper and Google adds an API for them

1 Like

Agree! I am looking forward to find some cheap android tracker.

I am sure will have them soon.

1 Like

Is there in the meantime a working solution how to trigger state updates of Apple tracker without unlock an iPhone? Thats the only hurdle for this great solution!

1 Like

As far as i know, there is no way to trigger a shortcut without unlock the iphone (Apple…:sweat_smile:)

I share some Airtags with my wife. Hence my objects overview is split now to „Meine Objekte“ and „Objekte | Geteilt“. Now i do no longer get the data for the tags in section „Objekte | Geteilt“.



Does anybody get it managed to extract the data in such a case of a split list?

It looks that you are not using the last versión of the shortcut, could be?

1 Like

To be sure to have everything up to date i have extra replaced the previously used shortcut. However i changed „Objekte aus Bereich“ zu „Objekte aus Index“. Only with that change i am able to get at least the first Tag into HA. Is that change wrong?

I have seen in the logs that i get a warning:

What is the max length possible for input_text?

The 2.0 version does not use “object”, to avoid issues regarding translations.

However, you are free to modify the shortcut as you want to suit your needs :blush:

This is strange because this is how a fresh shortcut import looks like:

In this part of the guide

  1. Look for the “Call” action with the Home Assistant icon and tap on the arrow icon to expand the details. In the “Server” section, you must select your Home Assistant instance to send the data.

What is the HA instance? how to I selected?

2 Likes

Sure, here is the translation:


Okay, my attempt went better by following the instructions in version 2.0.

However, the guide still says that a sensors.yaml needs to be created, which we had previously mentioned doesn’t work. I tried placing it in the configuration.yaml, and this time HA recognized the sensor, but it appeared like this.

I am also sending the code in case i made an error.

  - platform: rest
    name: airtag_car_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('*Car')[1].split('•')[0] %}
      {% if address == "Home" %}
        {% set home = "HOME_TEST" %}
        {{
          "https://api.geoapify.com/v1/geocode/search?text="
          + home | urlencode
          + "&apiKey=APIKEY&format=json"
        }}
      {% else %}
        {% set fix = address + "" %}
        {{
          "https://api.geoapify.com/v1/geocode/search?text="
          + fix | urlencode
          + "&apiKey=APIKEY&format=json"
        }}
      {% endif %}

  - platform: template
    sensors:
      airtag_car:
        friendly_name: "Car"
        value_template: >
          {% set home = "Lerou" %} 
          {% if ":" in states('input_text.airtag').split('*Car')[1].split('•')[0] %} 
          {{ states('input_text.airtag').split('*Car')[1].split('•')[0].split(',')[0] }}
          {% elif home in states('input_text.airtag').split('*Car')[1].split('•')[0] %}Home
          {% else %}
          {{ states('sensor.airtag_car_geo') }}
          {% endif %}
        attribute_templates:
          latitude: >
            {% if ":" in states('input_text.airtag').split('*Car')[1].split('•')[0] %}null
            {% else %}{{ state_attr('sensor.airtag_car_geo','lat') }}
            {% endif %}
          longitude: >
            {% if ":" in states('input_text.airtag').split('*Car')[1].split('•')[0] %}null
            {% else %}{{ state_attr('sensor.airtag_car_geo','lon') }}
            {% endif %}
          status: >
            {% if ":" in states('input_text.airtag').split('*Car')[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:car```

further more
image

It does work.

If you haven’t used rest sensor before, you need to fully restart HA, or even load rest platform config through developers tools :blush:

Thank you for taking the time to reply.
Unfortunately even after the restart (I even restarted the whole server) the sensor.airtag has unavailable in State.

Further more the blueprint give the above error. Unknown Action device_tracker.see

and lastly I cannot find it as an entity to add it to map.

Try from Developer Tools / YAML. Then clic on “rest entities”.

I have the Docker Version of the ΗΑ. I cannot edit YAML code in HA.
Can I do something else?

I’m having the same issue. I didn’t have a sensors.yaml file anywhere. I ended up creating a new sensors.yaml file, but now I’m stuck on step five where sensor.airtage_ITEM is supposed to be available. Mine isn’t.

One other noobish question–when replacing ITEM_FINDMY_NAME with the exact name from the Find My app, should it include the asterisk (*) or not? I’ve tried it both ways so far.