I had created a script under /homeassistant/scripts.yml named Find my phone to basically send a critical level or high priority alert notification for both Android and iPhone devices. Here is the script,
find_my_phone:
alias: Find My Phone
sequence:
- service: notify.{{ device_name }}
data:
message: Your phone is being located.
title: Find My Phone
data: >
{% set device_name_lower = device_name | lower %}
{% if "android" in device_name_lower %}
{
"ttl": 0,
"priority": "high",
"channel": "alarm_stream"
}
{% elif "iphone" in device_name_lower or "ipad" in device_name_lower %}
{
"push": {
"sound": {
"name": "default",
"critical": 1,
"volume": 1.0
}
}
}
{% endif %}
description: Find My Phone
icon: mdi:cellphone-sound
fields:
device_name:
selector:
text:
name: Device name
description: Name of the mobile device
required: true