Set an Alarm on Your Android Phone from Home Assistant
This Home Assistant script allows you to set alarms remotely on your Android phone using the Home Assistant Companion App. It's ideal for automating wake-up routines, reminders, or alarms triggered by other smart home events. This script sends a command via notification to your Android phone that sets an alarm instantly at your specified time. You can use this for: Note: Ensure the Home Assistant Companion app is installed and notifications are enabled on your Android phone. What Does This Script Do?
How to Add This Script to Home Assistant
alias: Set Alarm on Android Phone
description: Set an alarm on a selected Android device via Home Assistant Companion App.
fields:
target_phone:
name: Target Phone
description: The phone to send the alarm to.
required: true
selector:
device:
integration: mobile_app
alarm_time:
name: Alarm Time
description: Time for the alarm (HH:MM:SS)
required: true
selector:
time: {}
sequence:
- variables:
hour: "{{ alarm_time.split(':')[0] | int }}"
minute: "{{ alarm_time.split(':')[1] | int }}"
- data:
message: command_activity
data:
ttl: 0
priority: high
intent_package_name: com.google.android.deskclock
intent_action: android.intent.action.SET_ALARM
intent_extras: >-
android.intent.extra.alarm.HOUR:{{ hour }},android.intent.extra.alarm.MINUTES:{{ minute }},android.intent.extra.alarm.SKIP_UI:true
action: notify.mobile_app_{{ device_attr(target_phone, 'name') | slugify }}
mode: queued
Go to Settings > Automations & Scenes > Scripts. Click Create Script, switch to Edit YAML, paste the code above, then click Save.
Call this script from automations or other scripts, specifying your phone and desired alarm time.
- service: script.set_android_alarm data: target_phone: "Pixel 7 Pro" alarm_time: "07:30" Use Cases & Ideas