Hi there!
Sensor names cannot contain uppercase letters, spaces, or special accents ![]()
Hi there!
Sensor names cannot contain uppercase letters, spaces, or special accents ![]()
Thanks for your fast respon
I already update sensor name without uppercase, space, or special accents but still find sensor
Have you restarted HA?
I’m sorry I’m not an iPad user but maybe locking screen rotation? Idk if the standard mode on iPad is hz or vertical : )
Yeah I already restart my HA and reload yaml too
I use HA OS 16.3 and supervisor 2025.11.5
can you share your updated sensor code block. i’ve an example here Deprecation of legacy template entities in 2025.12 – Infrastructure Blog with udpated template code
Thanks for your hard work on this. I’m trying to use this to send us alerts when my Dad, who has dementia, leaves the home location. I’ve almost got it working, but it appears to constantly lock the location to my country without any address. Any ideas? Everything looks good with the text import as far as I can tell, but it looks like it’s failing to pick up the “Home” and therefore assigning just the Country which I have set in the next section.
Here’s my code…
- platform: rest
name: airtag_grandadkeys_geo
value_template: "{{ value_json.results[0].formatted }}"
json_attributes_path: "$.results[0]"
json_attributes:
- lon
- lat
verify_ssl: true
scan_interval: 300 # every 5 min
force_update: true
resource_template: >
{% set address = states('input_text.airtag').split('GrandadKeys')[1].split('•')[0] %}
{% if address == "Home" %}
{% set home = "14 Craigallan Park, Bo'ness" %}
{{
"https://api.geoapify.com/v1/geocode/search?text="
+ home | urlencode
+ "&apiKey=*****&format=json"
}}
{% else %}
{% set fix = address + "Scotland, UK" %}
{{
"https://api.geoapify.com/v1/geocode/search?text="
+ fix | urlencode
+ "&apiKey=******&format=json"
}}
{% endif %}
- platform: template
sensors:
airtag_grandadkeys:
friendly_name: "grandadkeys"
value_template: >
{% set home = "14 Craigallan Park, Bo'ness" %}
{% if ":" in states('input_text.airtag').split('GrandadKeys')[1].split('•')[0] %}
{{ states('input_text.airtag').split('GrandadKeys')[1].split('•')[0].split(',')[0] }}
{% elif home in states('input_text.airtag').split('GrandadKeys')[1].split('•')[0] %}Home
{% else %}
{{ states('sensor.airtag_grandadkeys_geo') }}
{% endif %}
attribute_templates:
latitude: >
{% if ":" in states('input_text.airtag').split('GrandadKeys')[1].split('•')[0] %}null
{% else %}{{ state_attr('sensor.airtag_grandadkeys_geo','lat') }}
{% endif %}
longitude: >
{% if ":" in states('input_text.airtag').split('GrandadKeys')[1].split('•')[0] %}null
{% else %}{{ state_attr('sensor.airtag_grandadkeys_geo','lon') }}
{% endif %}
status: >
{% if ":" in states('input_text.airtag').split('GrandadKeys')[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
- platform: rest
name: airtag_grandadshoe_geo
value_template: "{{ value_json.results[0].formatted }}"
json_attributes_path: "$.results[0]"
json_attributes:
- lon
- lat
verify_ssl: true
scan_interval: 300 # every 5 min
force_update: true
resource_template: >
{% set address = states('input_text.airtag').split('GrandadShoe')[1].split('•')[0] %}
{% if address == "Home" %}
{% set home = "14 Craigallan Park, Bo'ness, EH51 9QY" %}
{{
"https://api.geoapify.com/v1/geocode/search?text="
+ home | urlencode
+ "&apiKey=*****&format=json"
}}
{% else %}
{% set fix = address + "Scotland, United Kingdom" %}
{{
"https://api.geoapify.com/v1/geocode/search?text="
+ fix | urlencode
+ "&apiKey=*****&format=json"
}}
{% endif %}
- platform: template
sensors:
airtag_grandadshoe:
friendly_name: "grandadshoe"
value_template: >
{% set home = "14 Craigallan Park, Bo'ness, EH51 9QY" %}
{% if ":" in states('input_text.airtag').split('GrandadShoe')[1].split('•')[0] %}
{{ states('input_text.airtag').split('GrandadShoe')[1].split('•')[0].split(',')[0] }}
{% elif home in states('input_text.airtag').split('GrandadShoe')[1].split('•')[0] %}Home
{% else %}
{{ states('sensor.airtag_grandadshoe_geo') }}
{% endif %}
attribute_templates:
latitude: >
{% if ":" in states('input_text.airtag').split('GrandadShoe')[1].split('•')[0] %}null
{% else %}{{ state_attr('sensor.airtag_grandadshoe_geo','lat') }}
{% endif %}
longitude: >
{% if ":" in states('input_text.airtag').split('GrandadShoe')[1].split('•')[0] %}null
{% else %}{{ state_attr('sensor.airtag_grandadshoe_geo','lon') }}
{% endif %}
status: >
{% if ":" in states('input_text.airtag').split('GrandadShoe')[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
Scratch the above 2 messages. Working now by adding the code that forces “Home” to lower case.
The only issue I have now is that the trackers are shown as “Away” when they are inside the “Home” zone within HA. Error in log shows…
Device Tracker location is also not updating when the sensor is updated.
Should I even have this many entities for 2 Airtags? Both *.geo entities show on the map, but only one of Device trackers show, and it never updates.
First of all thank you for sharing your solution! I have done all the steps but I receive an error when I initiate the shortcut. The error messge: Could not run call service the operation took too long to complete. By any chance can someone advice? Thanks in advance!
Hi.
I’m excited to add this integration, and have gotten a good bit of it done, but on first restart of HA, I get a warning about Legacy sensor template deprecation:
Is there an updated sensor definition I can use? this thread is gigantic and tricky to search.
Also, unfortunately the leash sensor is showing up in HA, but all its states are Unknown except for last update time. I’m clueless how to troubleshoot this.
I have this same null result.
On first glance and with only 40 year old college German, this looks like a very similar integration to @TiToTB’s work.
Testing it now to see if it works.
did you figure it out and could refresh your german a bit? ![]()
is there a way to do this with a mac?
I have not figured it out, but the machine-translated German shows me that the post really is exactly the same method.
Unfortunately, with the template change the instructions for keeping this integration working are no longer coherent enough for me to make this work.
The whole “how to” needs a rewrite that goes step by step with the new template system.
this describes the template changes. if you can’t get it to work let me know, i’ll may reqrite the HowTo as i need to expand the amount of trackers from default of 4
Deprecation of legacy template entities in 2025.12 – MRi-LE Selfhosted
So I admit I’m entirely helpless here in implementing these changes. I’m very new to the depths of HASS, and frankly don’t even really understand what the intent of a template is.
Is it possible to get an example of what an AirTag template sensor should look like? Is that even the right terminology?
I tried this with no luck:
## Airtag Integration ##
#template:
- sensor:
- default_entity_id: sensor.airtag_leash
icon: mdi:dog-side
attributes:
latitude: '{% if ":" in states(''input_text.airtag'').split(''Leash'')[1].split(''•'')[0]
%}null {% else %}{{ state_attr(''sensor.airtag_ITEM_geo'',''lat'') }} {% endif
%}'
longitude: '{% if ":" in states(''input_text.airtag'').split(''Leash'')[1].split(''•'')[0]
%}null {% else %}{{ state_attr(''sensor.airtag_ITEM_geo'',''lon'') }} {% endif
%}'
status: '{% if ":" in states(''input_text.airtag'').split(''Leash'')[1].split(''•'')[0]
%}unavailable {% else %}available {% endif %}'
last_update: '{{ as_timestamp(states.input_text.airtag.last_updated)|timestamp_custom
(''%d/%m/%Y %H:%Mh'') }}'
name: Leash
state: '{% set home = "My Redacted Street" %} {% if ":" in states(''input_text.airtag'').split(''Leash'')[1].split(''•'')[0]
%} {{ states(''input_text.airtag'').split(''Leash'')[1].split(''•'')[0].split('','')[0]
}} {% elif home in states(''input_text.airtag'').split(''Leash'')[1].split(''•'')[0]
%}Home {% else %} {{ states(''sensor.airtag_ITEM_geo'') }} {% endif %}'
but I’m not even sure if I have the enclosing file setup correctly. should it be “template.yaml”?
OK, I may have gotten it.
Not sure how, but at the moment, HASS knows where my dog’s collar is!