A "find my phone button"

So I’ve been able to cancel by adding a tag and then cancelling through use of the tag.

So, to find phone:

  - service: notify.mobile_app_pixel_5
    data:
      message: Home Assistant
      title: Home Assistant is finding your phone!
      data:
        ttl: 0
        priority: high
        channel: alarm_stream
        tag: find-me
    alias: Phone alarm rings on highest priority

Then to cancel:

  - service: notify.mobile_app_pixel_5
    data:
      message: clear_notification
      data:
        tag: find-me
    alias: Clear past notifications

I’ve found it works well on my phone but oddly is temperamental for my wife’s Pixel.

I have found this script in the custom_card_imswel_person

find_my_phone:
  sequence:
  - service: notify.mobile_app_my_android
    data:
      message: command_volume_level
      data:
        media_stream: alarm_stream
        command: 20
  - service: notify.mobile_app_my_android
    data:
      message: Home Assistant is searching your phone !
      data:
        ttl: 0
        priority: high
        channel: alarm_stream
  mode: single

I have copied this over to the main script.yaml file is this the wright place?

The card finally works, but I have no clue where to put this script or how to activate it.
I hope somebody can help me…

Thanks for reading

Found it myself…
It seems that if your home has 3 people you’ll need 3 scripts each for every phone

/config/ui_lovelace_minimalist/dashboard/views/home.yaml

cards:
  - type: horizontal-stack
    cards:
      - type: 'custom:button-card'
        template: custom_card_imswel_person
        variables:
          ulm_card_imswel_person_entity: person.guy_forssman
          ulm_card_imswel_person_use_entity_picture: true
          ulm_card_imswel_person_gps_tracker: device_tracker.pixel7_guy
          ulm_card_imswel_person_findmy_script: script.find_my_phone_guy
      - type: "custom:button-card"
        template: custom_card_imswel_person
        variables:
          ulm_card_imswel_person_entity: person.eveline
          ulm_card_imswel_person_use_entity_picture: true
          ulm_card_imswel_person_gps_tracker: device_tracker.pixel7_eveline
          ulm_card_imswel_person_findmy_script: script.find_my_phone_eveline
      - type: "custom:button-card"
        template: custom_card_imswel_person
        variables:
          ulm_card_imswel_person_entity: person.lieselotte
          ulm_card_imswel_person_use_entity_picture: true
          ulm_card_imswel_person_gps_tracker: device_tracker.nokia_xr21
          ulm_card_imswel_person_findmy_script: script.find_my_phone_lieselotte

and in the /config/script.yaml you’ll get

find_my_phone_guy:
  sequence:
  - service: notify.mobile_app_pixel7_guy
    data:
      message: command_volume_level
      data:
        media_stream: alarm_stream
        command: 30
  - service: notify.mobile_app_pixel7_guy
    data:
      message: Home Assistant is searching your phone !
      data:
        ttl: 0
        priority: high
        channel: alarm_stream
  mode: single
find_my_phone_eveline:
  sequence:
  - service: notify.mobile_app_pixel7_eveline
    data:
      message: command_volume_level
      data:
        media_stream: alarm_stream
        command: 20
  - service: notify.mobile_app_pixel7_eveline
    data:
      message: Home Assistant is searching your phone !
      data:
        ttl: 0
        priority: high
        channel: alarm_stream
  mode: single
find_my_phone_lieselotte:
  sequence:
  - service: notify.mobile_app_nokia_xr21
    data:
      message: command_volume_level
      data:
        media_stream: alarm_stream
        command: 20
  - service: notify.mobile_app_nokia_xr21
    data:
      message: Home Assistant is searching your phone !
      data:
        ttl: 0
        priority: high
        channel: alarm_stream
  mode: single

Sadly I always have my android on mute. There seems to be an option on IOS for that

Is this coming for android as well or someone know how to do ?

If I remember well from my testing months ago, there are already answers in the current thread that cause Android to sound up, even if muted. Try them. I’m afraid I don’t remember which ones.

When I try this, I don’t get a new channel created within the companion app settings page. I’m using a Galaxy S20, and currently have the following channels:

  • General
  • High accuracy location
  • Persistent Connection
  • Persistent Connection Issues
  • SensorWorker

Any ideas what I’m doing wrong?


alias: Find Nicks Phone
sequence:
  - service: notify.mobile_app_galaxy_s20
    metadata: {}
    data:
      message: Home Assistant is finding your phone
      title: Home Assistant
      data:
        ttl: 0
        priority: high
        Channel: FindPhone
        tag: find-me
mode: single
icon: mdi:cellphone-sound

Hi all, been reading this and other threads and it seems like there’s 3 separate approaches to notifying on Android devices

  1. using the HA app’s notify service
  2. installing a tasker service on the target phone, triggering that to unmute
  3. using Google’s own find-phone service

I for one would like to go with door number 3 as on my phone, having the phone set to silent or do not didsturb mode will override any notifications from the HA app. Also, I’ve experienced those notifications to sometime get delayed until the phone screen is turned turned on (not the phone itself obviously). Second, as for option 2, not a fan of having to maintain/configure another piece of software on the phone, essentially knowing that it’s possible on the OS level.

So, the question I’m asking, is there a programatic/API method to invoking the google find-my phone service?

no thats a protected intent, I already tried it long time ago :frowning:

service: google_assistant_sdk.send_text_command
data:
  command: find my pixel 7a

This puts phone in a “Find my phone” state.
Can easily make a button from there.

1 Like

I’ve tried that, and checking my My Google Activity, the assistant always responds with:

I found a few devices.
The first listed is your <exact name of device from request>.
Should I ring it?

Do you have any solution for that?

I’ve tried some prompt engineering (I know, this isn’t an LLM, but it was worth a try) like using “find and ring the device named”, but it insists on getting a confirmation.

I used something similar to the post above yours and it worked fine, except it rings in the opposite phone if what I ask it to ring on.
Perhaps there is a spelling issue?
Do you write exactly what she says as the model name?

I have example calls in my Activity Log where it requests confirmation for a device that’s written exactly as in my prompt, yeah.

But when you’re saying it rings “the opposite phone of what I ask it to ring”, then it doesn’t work for you, does it? Or I guess you’re saying, at least it rings without asking for confirmation.

It rings in my work phone when I ask it to ring on my personal phone without confirmation

What works for me is: find my phone.

I couldn’t engineer any working prompt which includes a device name. If I do, I always get a confirmation question, either “I found a few devices. The first listed is X. Should I ring it?” or “I can help by making X ring on full volume right away. Would you like me to do that?”

But if I don’t state a device, but only call it the “phone”, then it rings right away.

Here’s a script that worked for me, OnePlus 9.
The script:

  • Sets alarm volume to max
  • Repeat until the phone becomes interactive (=screen turns on): Play alarm tone and wait 5 seconds
  • After phone is turned on (and 5 second loop is finished): Clear the notification

When testing the script, be aware it will not do anything (except turning the volume up) if your screen is on.

alias: Find My Phone
sequence:
  - action: notify.mobile_app_smartphone
    data:
      message: command_volume_level
      data:
        media_stream: alarm_stream
        command: 20
    alias: Increase volume to max
  - alias: Play alarm sound until phone is turned on
    repeat:
      sequence:
        - action: notify.mobile_app_smartphone
          data:
            message: Finding your phone
            data:
              ttl: 0
              priority: high
              channel: alarm_stream
              tag: find-my-phone
        - delay:
            hours: 0
            minutes: 0
            seconds: 5
            milliseconds: 0
      until:
        - condition: state
          entity_id: binary_sensor.smartphone_interactive
          state: "on"
  - alias: Clear the notification
    action: notify.mobile_app_smartphone
    data:
      message: clear_notification
      data:
        tag: find-my-phone
description: ""
icon: mdi:alarm-light

2 Likes

This also worked for me on S23 Ultra but I also had to set the ringer mode to normal by adding action to turn from silent to normal in the sequence. Full script I used below.

alias: Find My Phone
sequence:
  - action: notify.mobile_app_lucas_phone
    data:
      message: command_volume_level
      data:
        media_stream: alarm_stream
        command: 20
    alias: Increase volume to max
  - alias: Set to Normal
    action: notify.mobile_app_lucas_phone
    data:
      message: command_ringer_mode
      data:
        command: normal
  - alias: Play alarm sound until phone is turned on
    repeat:
      sequence:
        - action: notify.mobile_app_lucas_phone
          data:
            message: Finding your phone
            data:
              ttl: 0
              priority: high
              channel: alarm_stream
              tag: find-my-phone
      count: 2
description: ""
icon: mdi:alarm-light
1 Like

Hello, i’m having trouble adding the code to automation…i get the error:

Message malformed: extra keys not allowed @ data[‘sequence’]

How can i add the code?

Sequence is for scripts.
Skip the first two rows, alias and sequence, and copy the rest