Howto: Find My iPhone (ios)

Thanks to the new Home Assistant IOS app, I can finally implement this!

mobile_app:
discovery:
ios:

input_boolean:
    findphone_button:
      name: Find My Phone
      initial: off
      icon: mdi:cellphone

automation:
    - alias: FindPhone
      initial_state: 'on'
      action:
      - service: notify.mobile_app_PHONEID
        data:
          message: "Polo!"
          data:
            push:
              sound:
                name: default
                critical: 1
                volume: 1.0
      - service: input_boolean.turn_off
        entity_id: input_boolean.findphone_button
      trigger:
      - platform: state
        entity_id: input_boolean.findphone_button
        to: 'on'

Then just add a entity-button to your lovelace UI:

      - type: entity-button
        entity: input_boolean.findphone_button

And your phone will ding you even when on silent, working just like “Find My Phone” without needing to log into anything else.

10 Likes

Hello. Nice work!
To also get that working… just put all the things in an automation?

Nice! Was searching for the docs for this and apparently there is a whole bunch of sounds that can be imported from ios directly: Sounds | Home Assistant Companion Docs

Sounds great ! Do i put the following in my config.yaml?

Yep exactly!

Yes, though to keep it cleaner you may want to put the first block into a “package” instead, to combine all input_boolean/automation and the required mobile_app/discovery/ios modules into a single file.

This is awesome, thank you for sharing! I made two buttons and are now using them in my new project.
Hitta min iPhone = Find my Phone :slight_smile:

2 Likes

@danieljarhult Can you please share your config, that looks nice?!

1 Like

I installed the home assistant on the iphone and then I copied the script and pasted it inside my config.yaml file, and I tried to put the button, but it didn’t work. Could you explain to me how to do it? Thanks