Yelling across the house to call family members downstairs can get tiring, especially in a smart home. With Home Assistant and an Alexa device, you can create a simple intercom button to send an announcement to a specific room. In my case, I use this to ask my daughter to come downstairs from her room—no more shouting required!
In a previous post, I discussed a method to play sounds through an Alexa device. This technique is similar, but with a key difference: instead of playing an MP3 file as demonstrated earlier, this method involves making an announcement where Alexa will speak a message through the speaker. This distinction allows for more personalized and direct communication via your Alexa devices.
This guide will walk you through setting up an intercom button in Home Assistant that sends an announcement via an Alexa device. While this could potentially be done with Google Home, I’ll focus on Alexa since that’s what I use.
Requirements
- Alexa Device: This guide is designed for Alexa devices.
- Alexa Media Player Integration: This integration is crucial for many Alexa-based automations in Home Assistant. If you don’t have it installed, it can easily be added through HACS. For those unfamiliar with HACS, it’s a community store that simplifies the installation of custom components and themes in Home Assistant. You can learn more about it here. If HACS doesn’t work for you, the Alexa Media Player integration has extensive documentation with other installation options.
Creating the Intercom Script
To set up the intercom, you’ll need to create a script in Home Assistant that sends an announcement to your Alexa device. Here’s how:
- Navigate to Scripts in Home Assistant:
- Go to Settings > Automations & Scenes > Scripts > Add Script > Create New Script.
- Click on the menu icon and choose Edit in YAML to manually enter the script.
- Copy-Paste the Following YAML Code:
alias: Call Daughter
sequence:
- data:
target: media_player.child_echo
data:
type: announce
message: Please come downstairs, thank you
action: notify.alexa_media
- delay:
hours: 0
minutes: 0
seconds: 8
milliseconds: 0
Customize the Script:
- Target: Change the
target
entity ID to match your Alexa device. The ID should be something likemedia_player.child_echo
. - Message: Customize the
message
to be whatever announcement you want to send.
Adding an Intercom Button to Your Dashboard
To make it easy to trigger the script, you can add a visually appealing button to your Home Assistant dashboard. The button configuration below uses custom:button-card
, an amazing custom card that offers extensive customization options. However, it doesn’t come bundled with Home Assistant and needs to be downloaded from HACS. This card allows you to create dynamic, interactive buttons with a variety of styles and animations, perfect for enhancing your dashboard.
Here’s the code for the button card:
- show_name: true
show_icon: true
type: custom:button-card
entity: script.[script name]
tap_action:
action: call-service
service: script.[your_script_name]
target: {}
name: Call Child
size: 40px
icon: mdi:face-woman-shimmer-outline
styles:
name:
- padding-top: 10px
state:
- value: 'on'
styles:
icon:
- animation:
- blink 2s linear infinite
- color: '#00b59d'
name:
- color: '#00b59d'
- animation:
- blink 2s linear infinite
- Replace
[script name]
withscript.
followed by selecting your script from the auto-complete list that appears after typing the dot. - This button will show a nice animation when pressed, adding a fun touch to your intercom feature.
Conclusion
With just a few steps, you’ve turned your Alexa device into a handy intercom system, saving you from having to shout across the house. Now, you can call family members downstairs with the press of a button!