In this video I will show you how to create a Twilio account, how to buy a Twilio Number for free, how to verify your mobile number, and how to configure Home Assistant to trigger automatic voice calls when something happens in your Smart Home (in my case when the Sun is set).
I have a little bonus for you at the end of this video as well, so watch it closely from start to end..
Table of Contents
Requirements:
To complete the tutorial you will need:
- Working HA – if you don’t have such yet – check my tutorial here.
- And Twilio account – you can use my referral link to register a Twilio account – www.twilio.com/referral/vmWUuW
Free Twilio accounts have some limitations:
- Short trial message in the beginning of every call
- Free calls to 1 verified phone
- Calls duration is limited to 10min per call
- Unused phone number for more than 30 days may be removed
You can stay on the free tier witch is perfectly fine and everything will work OK, but if you decide to upgrade you can do this by add $20 or more to your Twilio Account.
If you used my referral link both you and I will receive additional $10 that could be used for Twilio services. Of course, you are not obliged to upgrade and you can stay on the free trial account.
With that being said let’s start configuring those Voice Calls notifications.
Preparing Twilio
Before enable your Home Assistant for voice calls, first you have to meet Twilio.
It’s easy just follow these steps:
- Create a Twilio Account and login – link
- Verify your mobile number as shown in the video
- Buy a Twilio number as shown in video (don’t worry it is free, unless you want to pay for full account)
Home Assistant Configuration
We have a Twilio account with a phone number and a verified mobile number that Twilio can call, now let’s configure our Home Assistant.
- If yes, then remove “notify:” keyword and paste only the other lines under your existing notify section.
- if no, then copy and paste everything below and replace your credentials & phone.
For voice notifications in your Home Assistant, add the following to your configuration.yaml file:
IMPORTANT! Check if you already have “notify:” section in your configuration.yaml.
# Example configuration.yaml entry twilio: account_sid: ACCOUNT_SID_FROM_TWILIO auth_token: AUTH_TOKEN_FROM_TWILIO # To Enable Twilio voice calls use the lines below notify: - name: twilio_calls platform: twilio_call from_number: TWILIO_E164_PHONE_NUMBER
Hey if you are still reading, consider subscribing, now let’s continue
Home Assistant Automation
I will create a Home Assistant automation that triggers a voice call when the sun is set just as a proof of concept.
Of course you can use anything you want and have in your Smart Home as a trigger for those calls. For example smoke detectors, motion detectors, door sensors and so on and so on.
# Example automation notification entry for automations.yaml file: - alias: The sun has set trigger: platform: sun event: sunset action: service: notify.twilio_calls data: message: 'The sun has set and maybe you are not subscribed yet' target: - +YOUR_PHONE_NUMBER
Home Assistant Voice Calls Test?
To test the above automation and the whole setup you can do the following:
Just open the “The sun has set” automation (or whatever name you set in the config above) and hit “Trigger” button.
The other way is to wait for the Sunset 🙂
What Next?
When Home Assistant and Twilio are now talking to each other the sky is the limit (it is still kind of a monolog). For example: You can create an IVR (that is an interactive voice menu) that asks you to press 1 if you want to trigger the alarm, two to call the police, 3 to ignore the call etc. etc.
Basically you can have a custom menu to control what to happen when you receive that automatic voice call.
If there is enough interest on that topic I can create a follow up video to demonstrate you how to configure this IVR and how to integrate it with Home Assistant.
Support my work
Just a quick note here this article is not Sponsored by Twilio by any means. I just like their services and they actually works great with Home Assistant that is all.
As usual, any sort of engagement on this channel does really help out a lot with the YouTube algorithm, so make sure you hit the subscribe, Like and Bell buttons (in YouTube) If you enjoy this article.
Also feel free to add me on Twitter. I post there pretty much daily.
I’m also on TikTok just for fun. If you are already there come and say hi.
My username is: KPeyanski
And as I promised you I have a little bonus for you – it is a free getting started Smart Home guide. To get it just enter your first name & email in the form below and I will immediately send it back to you.
[sibwp_form id=2]I hope that you find this tutorial useful and you have working Twilio calls in your Home Assistant at moment
Thank you for reading, stay safe and see you next time.
Awesome guide but I cannot receive a call from Twilio – triple checked everything, I have a verified mobile number (mine) and I purchased a Twio mobile number.