Trigger ICloud3v3 Update(s) on device change

Introduction

Simple little blueprint, crafted based on this comment: iCloud3 v3 iDevice Tracker - Version 3 Prerelease version is now available - #1186 by gcobb321

Useful for forcing icloud3 to update based on another device_tracker, for example when the phone disconnects/connects to the home network, for icloud3 to run the location update.

Installation

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Required Devices

  • a device tracker
  • Devices created by the icloud3v3 integration

YAML

blueprint:
  name: Trigger icloud3 Update On Network Change
  description: When a network based device tracker changes state, trigger an icloud3 update
  domain: automation
  input:
    device_to_track:
      name: The Device To Track
      description: This is the device to monitor
      selector:
        entity:
          filter:
            - domain: device_tracker
    device_to_refresh:
      name: The Device To Refresh
      description: This is the device to monitor
      default: []
      selector:
        entity:
          filter:
            - domain: device_tracker
          multiple: true
trigger:
  - platform: state
    entity_id:
      - !input device_to_track
    from: null
    to: null

action:
  - repeat:
      for_each: !input device_to_refresh
      sequence:
        - service: icloud3.action
          data:
            device_name: "{{ repeat.item }}"
            command: locate
mode: single