Home Assistant Guide

Simple tutorials for powerful automations

Finding your Phone with Home Assistant

Here's how to add a "Find My Phone" script and a matching "Stop Ringing" automation to your Home Assistant setup. With these, you can ring any Android phone connected to Home Assistant and easily stop the ringing from a button on your phone or when you unlock the screen. This will work even if your phone is on silent.

1. Add the Find My Phone Script

  1. Copy the script YAML below:
    
    alias: Find Phone
    description: "Ring a selected Android phone via Home Assistant Companion App."
    mode: restart
    fields:
      target_phone:
        name: Phone
        description: The phone to ring/notify.
        required: true
        selector:
          device:
            integration: mobile_app
      repeat_times:
        name: Repeat Count
        description: How many times to ring (set to 1 for just once).
        default: 1
        selector:
          number:
            min: 1
            max: 15
            step: 1
    sequence:
      - service: notify.mobile_app_{{ device_attr(target_phone, 'name') | slugify }}
        data:
          message: command_ringer_mode
          data:
            command: normal
      - repeat:
          count: "{{ repeat_times }}"
          sequence:
            - service: notify.mobile_app_{{ device_attr(target_phone, 'name') | slugify }}
              data:
                message: Finding Phone
                data:
                  ttl: 0
                  priority: high
                  channel: alarm_stream
                  tag: find_phone
                  actions:
                    - action: FIND_PHONE_STOP
                      title: Stop Ringing
            - delay:
                seconds: 30
      - service: notify.mobile_app_{{ device_attr(target_phone, 'name') | slugify }}
        data:
          message: clear_notification
          data:
            tag: find_phone
          
  2. In Home Assistant, go to: Settings > Automations & Scenes > Scripts.
  3. Click + Create Script, then Edit in YAML.
  4. Delete any placeholder code, paste in the YAML above, and click Save.
  5. When you run the script, you'll be able to select:
    • Phone: The mobile device you want to ring
    • Repeat Count: How many times the phone should ring (default is 1, max 10)

How it works:
When you run this script, your phone will play your alarm sound at full alarm volume - even if it's on silent or vibrate! This is because the notification uses the alarm_stream channel, which always plays through the alarm audio path.

What you'll hear: Instead of your normal ringtone, you'll hear the sound you have set as your alarm in your Clock app.

Why set ringer mode? Changing the ringer mode to "normal" (not silent) isn't strictly necessary when using alarm_stream, but it can help if you also want to make your phone ring in other ways or ensure it's not stuck in silent mode after finding it.

2. Add the Stop Ringing Automation

  1. Copy the automation YAML below:
    
    alias: Stop Finding Phone
    description: "Stop the Find Phone script and clear the notification."
    mode: single
    trigger:
      # Trigger 1: Notification button pressed on your phone
      - platform: event
        event_type: mobile_app_notification_action
        event_data:
          action: FIND_PHONE_STOP
      # Trigger 2: Phone becomes interactive (screen unlocked/touched)
      - platform: state
        entity_id: binary_sensor.your_phone_interactive   # <-- Change this to your phone's interactive sensor, or delete this trigger if not using
        to: "on"
    condition: []
    action:
      - service: script.turn_off
        target:
          entity_id: script.find_phone     # <-- Change if your script is named differently
      - service: notify.mobile_app_your_phone  # <-- Change to your phone's notify.mobile_app service
        data:
          message: clear_notification
          data:
            tag: find_phone
          
  2. Go to: Settings > Automations & Scenes > Automations.
  3. Click + Create Automation, then Edit in YAML.
  4. Delete any placeholder code, paste in the YAML above, and click Save.
  5. Update the placeholders in the YAML:
    • notify.mobile_app_your_phone: Replace with your phone's notify service (e.g., notify.mobile_app_pixel_7)
    • binary_sensor.your_phone_interactive: Replace with your phone's interactive sensor entity ID (see below), or delete this trigger if you don't want ringing to stop when you unlock the phone
    • script.find_phone: Update if your script has a different name
  6. How to enable and find your phone's interactive sensor:
    • On your phone, open the Home Assistant app
    • Go to Settings > Companion App > Manage Sensors
    • Scroll down to Power Sensors, find Interactive and click into it, and toggle Enable Sensor on
    • To find the entity ID for the sensor:
      1. In Home Assistant, go to Settings > Devices & Services > Mobile App
      2. Click your phone under Devices
      3. Look for the Interactive sensor in the list
      4. Click on the sensor, then click the cog wheel (⚙️) for settings
      5. Copy the entity ID (e.g., binary_sensor.pixel_7_interactive)

Tip: If you don't want ringing to stop automatically when you unlock your phone, you can simply delete the second trigger (the platform: state one). If your phone's interactive state is already on when you start finding the phone, the trigger will not fire when you interact with it - you will need to either click the "Stop ringing" button in the notification, wait for the script to stop on its own after the set number of repeats, or manually stop it.

How It Works

  • Run the Find Phone script to ring your selected phone, even if it's on silent. You can repeat the ring multiple times if you want.
  • Your phone receives a loud notification with a "Stop Ringing" button.
  • Either tap the button on your phone or unlock/touch the phone (if you set up the interactive sensor) to automatically stop the ringing and clear the notification.

Your phone must have the Home Assistant Companion App installed and notifications enabled.

3. Add Find My Phone to Your Dashboard

  1. Go to your Home Assistant dashboard (Overview or any dashboard where you want the button).
  2. Click the Edit (pencil) icon in the top right corner.
  3. Click Add Card at the bottom right.
  4. Choose either a Button card (for a large, clear button) or an Entity card. Other options are available through HACS, mushroom cards, etc.
  5. In the card's entity selector, search for and select your Find Phone script (usually script.find_phone).
  6. Click Save on the card editor.
  7. When you're done, click Done at the top right to finish editing your dashboard.

Now you'll have a button right on your dashboard to quickly ring your phone - just click it, select your phone and repeat count, and your device will start ringing!