Android Intents & Commands in Home Assistant
Home Assistant's Android Companion App allows your automations to interact with your phone by sending "Android intents" and device commands. This lets you do things like show notifications, play sounds, control Do Not Disturb, launch apps, and more, directly from Home Assistant. This guide covers the most common intents and commands, how to use them, requirements, and their limitations.
What Are Android Intents?
Intents are messages that tell your Android device to do something – for example, opening an app, sharing a file, or triggering a built-in function. In Home Assistant, you can call the intent command to make your phone perform an action via the Companion App.
What Are Android Commands?
The Companion App exposes a set of built-in commands you can use directly from Home Assistant. These cover common phone actions, like changing the volume, toggling the flashlight, or sending notifications.
Requirements
- Home Assistant Companion App for Android (latest version recommended).
- Companion App Integration set up in Home Assistant – your device should show up in Settings → Devices & Services under "Mobile App".
- Permissions:
- Some commands require extra permissions (e.g. Notification access, Do Not Disturb access, Draw over other apps, etc.). The app usually prompts you if a permission is missing.
Common Android Commands
-
Send Notification:
notify.mobile_app_[your_device]- Shows a notification on your phone. Can include actions, images, and even TTS (text to speech).
-
Set Do Not Disturb (DND):
command_dnd(turns on/off DND or sets a mode likepriority_only) -
Change Volume:
command_volume_level- Set ringer/media/alarm volume (0.0–1.0 scale)
-
Toggle Flashlight:
command_flashlight(on/off) -
Wake Screen:
command_screen_on -
Lock/Unlock Device:
command_lock/command_unlock- Unlock requires special accessibility permissions and device admin.
-
Launch App:
command_launch_app- Specify the app package name (e.g.
com.android.chrome). See the section at the bottom of this page to find out how to get the package name for an app!
- Specify the app package name (e.g.
-
Send Intent:
command_activity- Fully custom – see next section!
How to Use: Example Automations & Scripts
To call a command, use the notify.mobile_app_[your_device] or service: android.intent (in scripts, automations, or the Services tab).
Example: Send a Notification
service: notify.mobile_app_pixel_7
data:
message: "Someone is at the door!"
title: "Doorbell"
Example: Turn On Flashlight
service: notify.mobile_app_pixel_7
data:
message: "command_flashlight"
Example: Launch an App (Chrome)
service: notify.mobile_app_pixel_7
data:
message: "command_launch_app"
data:
package_name: "com.android.chrome"
Example: Set DND to Priority Only
service: notify.mobile_app_pixel_7
data:
message: "command_dnd"
data:
command: "priority_only"
Example: Custom Intent (Open Google Maps)
service: notify.mobile_app_pixel_7
data:
message: "command_activity"
data:
intent_package_name: "com.google.android.apps.maps"
intent_action: "android.intent.action.VIEW"
intent_uri: "geo:52.9862,-6.0437"
You can use intent_action and intent_uri for powerful Android integrations. See below for more intent ideas.
Custom Intents: Advanced Examples
Example: Open Website in Browser
service: notify.mobile_app_pixel_7
data:
message: "command_activity"
data:
intent_action: "android.intent.action.VIEW"
intent_uri: "https://www.home-assistant.io"
Example: Send SMS (requires SMS permission!)
service: notify.mobile_app_pixel_7
data:
message: "command_activity"
data:
intent_action: "android.intent.action.SENDTO"
intent_uri: "smsto:+35312345678"
intent_extras:
sms_body: "Alarm triggered at home!"
Note: Home Assistant cannot send SMS directly, but it can open the SMS app ready to send.Example: Start a Call
service: notify.mobile_app_pixel_7
data:
message: "command_activity"
data:
intent_action: "android.intent.action.DIAL"
intent_uri: "tel:+35312345678"
Example: Share Text
service: notify.mobile_app_pixel_7
data:
message: "command_activity"
data:
intent_action: "android.intent.action.SEND"
intent_type: "text/plain"
intent_extras:
android.intent.extra.TEXT: "Check out this awesome Home Assistant guide!"
Limitations & Notes
- Some commands or intents may require the Companion App to be running in the background.
- Not all actions are possible on every phone, or may be blocked by your device manufacturer or Android version (especially actions like unlock, DND, or accessibility commands).
- Custom intents are powerful but can break if an app changes its intent handling. Always test after OS or app updates.
- Permissions: For anything involving phone calls, SMS, screen overlays, or DND, you'll need to approve additional permissions in your device's settings (the app usually tells you what you need).
- Notifications with media or actions may not appear on certain Android versions due to restrictions (especially battery optimizations or notification settings).
- Privacy: Some actions (like unlocking) should only be used on devices you trust!
Where to Find More
- Official Docs: Home Assistant Android Notifications
- Intent Explorer App: Use an app like Activity Launcher or Intent Launcher to test custom intents before using in HA.
Troubleshooting
- If a command doesn't work, check the app's notification log in Home Assistant (Settings → Devices & Services → [Your Phone]).
- Update the Companion App and Home Assistant Core.
- Check all permissions (especially "Draw over other apps" and "DND" for certain commands).
- Test simple actions (like sending a notification) first to confirm your device is connected.
- Remember that some features are Android-only and do not work on iOS!
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).
- 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.
- 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.
Some common package names:
Gmail: com.google.android.gm
WhatsApp: com.whatsapp
This feature works with Android devices only. iOS does not support app launching via Home Assistant notifications.