Calling the icloud lost iphone service

Anyone has this figured out? My known_devices.yaml shows the iPhone fine via the iCloud component, but for the life of me, I can’t call the service icloud_lost_iphone with a particular device_name even via the HA user interface. I called the service with the parameter {“device_name”:“device_tracker.sherwin6s”}, I called it using {“device_name”:“sherwin6s”} and called it via its iCloud identity {“device_name”:“Sherwin 6S”} and nothing seems to work. Any ideas?

1 Like

Try entity_id in place of device_name

Nope, doesn’t work. It says - “device_tracker.icloud_lost_iphone: extra keys not allowed @ data[‘entity_id’]”

I too have the same issue. Trying to call it from IFTTT as well.

{“entity_id”:“device_tracker.iphone”} is what I am using for IFTTT,

ERROR (MainThread) [homeassistant.core] Invalid service data for device_tracker.icloud_lost_iphone: extra keys not allowed @ data[‘entity_id’]. Got ‘device_tracker.iphone’

Did you ever figure it out? I’m using the same format as always, just wondering if it requires something extra.

Nope, I was never able to solve it. I think it’s a bug.

Ah, oh well. I tried modifying the iCloud.py file like mentioned in that other thread you commented in, didn’t help. Thanks.

Have you had any luck trying to call lost iphone service?

Anyone make any progress on this?

I have been using this for a couple of weeks now and submitted a fix. Hopefully this should show up in the next release. I have tested it with my ipad and iphone and works perfectly.

1 Like

@kdvlr whats the proper service call?

I configured a template switch for this, so I can use my alexa to find my iphone or ipad. See how that looks at the end. You can use the same parameters for the lost iphone call.

The service is lost iphone service and the device_name is the device tracker component without the “device_tracker” prefix.

I wonder if I should create a switch component that will auto create a switch for each registered icloud device trackers.

- platform: template
    switches:
      kdvlrsiphone:
        friendly_name: kdvlr's iPhone
        value_template: "off"
        turn_on:
          service: device_tracker.icloud_lost_iphone
          data:
            device_name: kdvlrsiphone
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.kdvlrsiphone
1 Like

I just use the VoIP service in IFTTT…works well.

hey, i am looking for this solution for a few hours now but didnt get it to work. if i copy your configuration in my config yaml and change the names it wont read the config… any tips for me?

- platform: template
    switches:
      iphone_oelf:
        friendly_name: iPhone Oelf
        value_template: "off"
        turn_on:
          service: device_tracker.icloud_lost_iphone
          data:
            device_name: iphone_oelf
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.iphone_oelf

I could never get this to work reliably so eventually I just used a critical alert notification with a somewhat obnoxious beeping sound that plays… we like it better than the regular Find my iPhone sound, especially when a phone is in the couch cushions or buried under blankets…

That one works fine for me:


##Find my Phone##
- platform: template
  switches:
    findmyphone_iphone:
      friendly_name: Find my Phone - iPhone
      unique_id: findmyphone_iphone
      value_template: ''
      turn_on:
        service: icloud.play_sound
        data:
          account: [email protected]
          device_name: your iPhone name
      turn_off:
        service: switch.turn_off
        entity_id: switch.findmyphone_iphone
##!Find my Phone##

The iPhone Name has to be the “friendly” Name not the id or anything like that.

Also got it to work now with the gui:

just enter device name and mail account, and then it creates a new entitiy to use with alexa and co.

I’ve got the below config working. First of all go to settings/helper and create an input boolean (I called it trova_iphone_enri). Then you need to define a template in config/switch that calls the service whether you turn the switch on or off. Please note to add device name if you have more than one device in your ICloud

  - platform: template
    switches:
      trova_tphone_enri:
        friendly_name: Iphone Enri
        turn_on:
          - service: icloud.play_sound
            data:
              account: !secret account
              device_name: Iphone di Enrico
        turn_off:
          - service: icloud.play_sound
            data:
              account: !secret account
              device_name: Iphone di Enrico

Do you have some kind of config to repeat the alert sound or did you import your own longer sound file?

Imported my own longer sound… there is a couple free websites for downloading sound files… I believe I used https://freesound.org/ you can sort by length also.

Thanks. I’m getting tons of 2FA prompts after configuring the iCloud integration (despite already authenticated and working). The “iCloud3” custom add-on works but seems like overkill for wanting to press a button on the wall dashboard to find wife’s phone. This seems like simplest way forward.

Thanks for reply!