Home Assistant Guide

Simple tutorials for powerful automations

Open Any App Automatically When Entering a Zone with Home Assistant

This Home Assistant automation makes your phone open any app—like Tesco Clubcard, Gmail, or your gym app—automatically when you arrive at a specific location (zone). It works with Android phones and is great for loyalty cards, check-in apps, or anything you always use when arriving somewhere.

What Does This Automation Do?

When your phone enters a location you specify (like a shop or workplace), it waits a short time (e.g., 1 minute) and then launches the app you choose on your phone. You can use this for:

  • Opening a loyalty card app as you enter a store (e.g., Tesco Clubcard)
  • Opening a gym membership or check-in app when you arrive at the gym
  • Starting a parking app when you enter a car park zone
  • Any app you always need at a certain place

How to Add This Automation to Home Assistant

Note: This automation only works with the Home Assistant Companion App on Android. You can import the blueprint from any device, but app launching will only function on Android phones that have notification permissions enabled.

  1. Import the Blueprint
    Click the Import Blueprint button/link at the top of this article.
    — If prompted in Home Assistant, review the YAML preview and click Import.
    Alternative (manual): In Home Assistant go to Settings > Automations & Scenes > Blueprints, click Import Blueprint, paste the blueprint’s raw YAML URL, and click Preview > Import.
  2. Create an Automation from the Blueprint
    After import, locate “Open App When Entering Zone” under Settings > Automations & Scenes > Blueprints and click Create Automation.
  3. Fill in the Inputs
    • Device Tracker: Your phone’s device_tracker entity (e.g., device_tracker.pixel_7).
    • Zone: The zone where you want the app to launch (e.g., zone.tesco).
    • Mobile App Notify Service: Your phone’s notify service (usually notify.mobile_app_your_phone).
    • App Package Name: The Android package name for the app you want to open (e.g., com.puca.tesco for Tesco Clubcard).
    • Delay (optional): How long after arriving the app should open (default: 1 minute).
  4. Save
    Click Save. The automation will now trigger whenever your device enters the selected zone.

Tip: To find an Android package name quickly, open the app’s Google Play Store page in a browser and copy the text after id= in the URL (e.g., ...details?id=com.puca.tesco).

How to Find an App's Package Name (Android)

To launch an app, you’ll need its Android package name (for example, com.puca.tesco for Tesco Clubcard).

  1. Find it via Google Play Store:
    • Open the Google Play Store in your browser.
    • Search for your app and click on it.
    • Look at the web address (URL). It will look like:
      https://play.google.com/store/apps/details?id=com.puca.tesco
    • The package name is everything after id=. For the example above, it's com.puca.tesco.
  2. Or use a Package Name Viewer App:
    • Install Package Name Viewer 2.0 from the Play Store on your Android device.
    • Open it and scroll to find your app. The package name will be shown next to it.

This feature works with Android devices only. iOS does not support app launching via Home Assistant notifications.

Use Cases & Ideas

  • Open your grocery loyalty app when arriving at the store
  • Launch a gym or check-in app at the gym
  • Open a parking or travel card app at a train station
  • Start your banking app when arriving at work
  • Any other situation where you always use a specific app at a location!

Blueprint YAML

blueprint:
  name: "Open App When Entering Zone"
  description: |
    Launch a specific app on your Android device after entering a chosen zone.
    Useful for loyalty cards, check-ins, and more.

  domain: automation
  input:
    person_device_tracker:
      name: Device tracker
      description: The device tracker entity to monitor (usually your phone)
      selector:
        entity:
          domain: device_tracker

    target_zone:
      name: Zone
      description: The zone that triggers the automation
      selector:
        entity:
          domain: zone

    mobile_notify_device:
      name: Mobile app notify service
      description: >
        Enter your phone's notify service (e.g., notify.mobile_app_yourphone).
        You can find this in Developer Tools > Services.
      selector:
        text:

    app_package_name:
      name: App Package Name
      description: Android package name to launch (e.g., com.puca.tesco for Tesco, com.google.android.gm for Gmail)
      selector:
        text:

    launch_delay:
      name: Delay before launching app
      description: How long to wait after arriving before launching the app
      default: 00:01:00
      selector:
        duration:

mode: single

trigger:
  - platform: zone
    entity_id: !input person_device_tracker
    zone: !input target_zone
    event: enter

condition: []

action:
  - delay: !input launch_delay
  - condition: zone
    entity_id: !input person_device_tracker
    zone: !input target_zone
  - service: !input mobile_notify_device
    data:
      message: command_launch_app
      data:
        package_name: !input app_package_name