Wake Up to an SMS Message
February 18, 2024
Problem statement:
Automate a way to guarantee waking up when an SMS message is received from specified phone numbers.
Solution overview:
When SMS is received, phone volume will be increased, a song will play, and lights will be turned on using the Home Assistant REST API. This solution only works with Android phones.
How to set this up:
- Create a Home Assistant “Group” with all of the lights to turn on
- In the Home Assistant app, navigate to Settings > Devices & services > Helpers > Create helper
- Choose “Group” > “Switch group”
- Give it a name, and input all of the light switch entities to turn on.
- “Submit” to save this new group!
- Generate Home Assistant access token
- In the Home Assistant app, select your profile photo to navigate to “Profile” settings.
- Find “Long-lived access tokens”, then choose “Create token”.
- Copy the shown token to use later.
- Set up lights automation
- Download the “Tasker” Android app. At the time of writing, it is $3.49 on the Google Play Store.
- In the “Tasks” tab, select the “+” floating action button. Give it a name, like “Notification Task”
- In the “Task Edit” screen, select the “+” floating action button > “Net” > “HTTP Request”
- Fill in the HTTP request details:
- URL:
http://your_ha_ip:8123/api/services/switch/turn_on
- Headers
Authorization:Bearer your_access_token Content-Type:application/json
- Body
{"entity_id": "switch.your_light_group"}
- Check the box “Continue Task After Error”
- URL:
- Select the back button to save changes
- There is a play button in the bottom left corner to test that your HTTP request actually turns on the lights :)
- Set up sound automation
- Select the “+” floating action button to create a new Action.
- Choose Audio > Media Volume > Set “Level” slider to desired volume.
- Create another action, then choose Media > Music Play
- In the “File” field, input the file path to your desired audio file to play.
- Press the back button 2x to save the Action and Task, which should now include turning on the lights, turning up the phone volume, and playing a song.
- Set up SMS trigger
- In the “Profiles” tab, press the “+” floating action button > Create > Event > Phone > Received Text
- In the “Sender” field, select all contacts that you would like to receive notifications from in the event of a text message
- Press the back button to save. You will now be prompted to choose a Task that is kicked off when the trigger SMS is received.
- Choose the “Notification Task” (or whatever name was assigned in step 3.2) that was just created.
- Press the check mark button in the top nav to save. You’re ready to go! 🎉