I am stuck in the part where i edit the Configuration.yaml
Even thought the code is correct and im not getting any errors, the Sensor.airtag is not created after the restart.
- platform: rest
name: airtag_car
value_template: "{{ value_json.results[0].formatted }}"
json_attributes_path: "$.results[0]"
json_attributes:
- lon
- lat
- district
- city
- postcode
- street
- housenumber
- state
- country
- country_code
verify_ssl: true
scan_interval: 900 # every 15 min
resource_template: >
{% set address = states('input_text.airtag').split('Car')[1].split('•')[0] %}
{% if address == "Home" %}
{% set home = "HOME ADDRESS" %}
{{
"https://api.geoapify.com/v1/geocode/search?text="
+ home | urlencode
+ "&apiKey=MYKEY&format=json"
}}
{% else %}
{{
"https://api.geoapify.com/v1/geocode/search?text="
+ address | urlencode
+ "&apiKey=MYKEY&format=json"
}}
{% endif %}
@TiToTB forgive me because I am still figuring out HA. But I am having the same problem as @fitsou. I have done the restart, code is correct, but no entity is showing up. Additionally, after seeing your comment and not being able to find known_devices.yaml, it appears that HA phased this out in 2023 and there is no longer a folder or file known_devices.yaml. Any help would be greatly appreciated.
You have to create this file using some addon like file editor or samba share, inside the config folder. Then add to the file the code provided in the guide and restart HA
@TiToTB I am having the same problem as @fitsou. I have file editor and have added a few files before but my knowledge of how to do this is very limited. Your guide is very helpful so far. Can you walk us through what code to add and how to add it to solve this problem of not showing up as an entity?
I finally took my time to implement some improvements:
I have changed the approach of the shortcut when extracting information. This way it should work correctly in any language (no need modifications) and it should prevent some fails due to OCR.
The guide now includes tips and lessons learned in these months (ie, how to use it with iPads or more than 3 AirTags)
I have modified the main sensor, so now you can:
a) Identify frequent locations (home, work, …)
b) Limit the address by city, country… and thus avoid false matches.
c) Identify when the AirTag is unavailable (and show “Last seen…”)
d) Include sensor’s last update date.
Since it has been tricky for some users, creating the device tracker is now optional. In any case, they can use the main sensor that also indicates the address and coordinates.
I have included options and tips in the guide on how to implement coordinate updates. I hope it helps you and gives you some ideas.
In the future, i have some ideas to get the battery level of the AirTag and the last seen address when it get lost. We will see!
I have included the link to the printable model of the ‘aguatracker’ in the post, to combine the functions of the AirTag and an NFC keychain (to open doors, trigger automations…) Keep in mind that it is design to perfectly fit this cheap clones, because not all of them has the same chip.
Can I ask how you were able to add this code into HA, every time I try to add my code, I can’t see the expose sensor for the airtag, I try adding where the configure.yaml & try to add the sensor in where sensor.yaml but still not able to see it in HA, can you shed some light on how you were able to add the code into HA for the sensor?
Can you assist with this code, if possible, i am having an issue trying to add this sensor code into HA, I try where sensor.yaml & configure.yaml but not able to see the see sensor for the airtag expose into HA