Skip to content

Alexa Media Player in Home Assistant

Alexa Media Player Integration

I’m diving into an exciting Alexa Media Player project that combines the power of Home Assistant and Alexa – turning your Alexa devices into media players within your Smart Home ecosystem. Picture this: sending custom text-to-speech announcements, triggering special sound effects, and seamlessly weaving your Alexa devices into your Home Assistant automations. And the best part? It won’t cost you a dime. So, let’s roll up our sleeves and embark on this thrilling journey!

Prerequisites: A World of Possibilities

Before we get into the nitty-gritty, let’s ensure you have the essentials:

  • Alexa-enabled Device: This could be an Echo device, a Sonos speaker, or even a FireHD Tablet. If you don’t have one yet, don’t fret – you can check out the current prices using the affiliate links below:
DeviceLink
Amazon Alexa Deviceshttps://amzn.to/45yctQC
Sonos Speakers (with Alexa)https://amzn.to/3KQ9Cea
  • Home Assistant Setup: Ideally, you’re already up and running with Home Assistant, preferably with the Add-on store, otherwise go register for my Home Assistant webinar and learn more.
  • HACS Installation: The Home Assistant Community Store (HACS) is key to making this integration smooth sailing. It not only simplifies the Alexa Media Player setup, but also ensures you get updates hassle-free. For more details and step-by-step instructions on installing HACS, you can refer to my dedicated HACS article.

Getting HACS: The First Step

HACS might sound a bit daunting if you’re new to it, but trust me, it’s a game-changer. To give you a quick rundown, HACS enhances your Home Assistant experience by enabling easy installation and management of custom components.

To install HACS do the following as stated in the official HACS website – https://hacs.xyz

  • Go to the Add-on store
  • Install one of the SSH add-ons (you need to enable advanced mode in your user profile to see them)
Advanced SSH & Web Terminal is one of the available SSH add-ons available at the time of writing this article
  • Configure the chosen SSH add-on by following the documentation for it
  • Start the SSH add-on
  • Connect to the SSH add-on
  • Run the HACS download script
wget -O - https://get.hacs.xyz | bash -
Alexa Media Player in Home Assistant 1
  • After downloading HACS restart Home Assistant
  • Press the “c” button to invoke the Home Assistant command bar, type “integrations”
  • Click the “+ ADD INTEGRATION” button in the bottom right corner and search for “HACS” or click this My Home Assistant Link – https://my.home-assistant.io/redirect/config_flow_start/?domain=hacs
  • Follow the steps & instructions that HACS initial configuration helper will give you.
  • At the end you will have something like in the picture below:
HACS menu in Home Assistant

Alexa Media Player Integration: Bringing It All Together

Once HACS is comfortably seated in your Home Assistant, it’s time to take things up a notch by installing the Alexa Media Player custom integration. This integration is the magic wand that allows you to seamlessly connect your Alexa devices to Home Assistant. Ready to see it in action? Here’s how I did it:

  • Installing Alexa Media Player: Using HACS, installing the Alexa Media Player is a breeze. Just a few clicks, and you’re on your way to a world of possibilities.
  • Inside HACS, go to Integrations > EXPLORE & DOWNLOAD REPOSITORIES and search and download Alexa Media Player
Alexa Media Player in Home Assistant 2
  • After download is complete, restart Home Assistant
  • Press the “c” button to invoke the Home Assistant command bar, type “integrations”
  • Add new integration and search for Alexa Media Player
Alexa Media Player in Home Assistant 3
  • Enter the required information (Your Amazon Account/Password/2FA) where for 2FA I followed these instructions
Alexa Media Player in Home Assistant 4
  • Confirm the OTP code and re-authenticate with your Amazon user & pass.
Alexa Media Player in Home Assistant 5
  • If everything is fine with the installation (and it will be fine) you should see a “success” window with all of your Alexa enabled devices listed.
Alexa Media Player in Home Assistant 6

Testing the Waters: Let’s Play!

With the Home Assistant Alexa Media Player integration set up, it’s time to put our creation to the test. Let’s start with a basic, but immensely powerful feature: text-to-speech (TTS) announcements.

Imagine sending custom messages to your Alexa devices using automations and scripts – it is totally possible. I will use Home Assistant’s Developer Tools for the test, but the best part is, incorporating this into your Home Assistant automations and scripts is just as straightforward.

This demo below will say “like or not?” from my Alexa enabled Fire HD tablet (of course, you can type whatever you want)

Alexa Media Player in Home Assistant 7

As YAML code this should look like this:

service: notify.alexa_media
data:
  message: like or not?
  target: media_player.YOUR_ALEXA_HERE
  data:
    type: tts

You can use the above TTS not only to announce important information, but also to add a personal touch to your smart home environment.

Adding Drama: Special Sound Effects

Now, let’s add some flair to your Smart Home scenes with sound effects. Amazon has embedded an array of sound effects that you can trigger using Home Assistant. Whether it’s alarms, beeps, or even a doorbell chime, you can seamlessly incorporate them into your automations and scripts.

Alexa Media Player in Home Assistant 8
service: media_player.play_media
target:
  entity_id: media_player.YOUR_ALEXA_HERE
data:
  media_content_type: sound 
  media_content_id: amzn_sfx_doorbell_chime_01

Imagine a dramatic alarm for smoke detection or an attention-grabbing beep for a detected intruder – the possibilities are boundless. Here is the list of additional potential sound effects – LINK

Sequencing the Smart Way

But why stop at basic sounds? Let’s dive into sequences, like Alexa’s daily briefings, that elevate your automation game. With Home Assistant and Alexa Media Player working in tandem, you can effortlessly trigger sequences to provide you with important information as you start your day, commutes, jokes and more.

Alexa Media Player in Home Assistant 9
{
  "entity_id": "media_player.alexa",
  "media_content_id": "Alexa.Joke.Play",
  "media_content_type": "sequence"
}

And just like TTS and sound effects, these sequences can seamlessly blend into your existing automations and scripts.

Beyond the Basics: Expanding Possibilities

Now that you’re familiar with the essentials, let’s explore the wealth of capabilities this integration offers:

  • Running Custom Commands: Imagine giving voice commands directly to your Alexa device using Home Assistant scripts or automations.
  • Playing Music: Your Alexa device can now double as a music player, controlled entirely by your Home Assistant setup.
  • Setting Echo Show Backgrounds: Customize the visual experience of your Echo Show devices with ease.
  • Interacting with Specific Devices: With the power to interact with only the last called device, you have unparalleled convenience at your fingertips.
  • Running Alexa Routines: Seamlessly integrate your Alexa Routines into your Smart Home automations.
  • Alexa Guard Mode: Arm and disarm your Alexa Guard mode through your Home Assistant setup.

More info on how to use the above can be found in the official Alexa Media Player documentation.

Unlocking More Knowledge: A Special Bonus

Before we wrap up this journey of Alexa and Home Assistant integration, I have a special treat for you. If you’re eager to dive deeper into the world of smart homes and gain a comprehensive understanding of key terms, I’ve prepared a Smart Home Glossary as PDF file.

It’s yours to download for free from my other website – https://automatelike.pro/glossary

Conclusion: A Seamless Symphony

And there you have it, fellow tech enthusiasts! By integrating Alexa devices as media players into your Home Assistant setup, you’re orchestrating a seamless symphony of automation and convenience. The possibilities are endless, and with every new integration, your smart home journey becomes more exciting.

Here is the full video where you can see the actual Home Assistant Alexa more visually.

Feel free to drop your questions or thoughts in the comments section. Until next time, keep automating and embracing the magic of technology.

Catch you on the smart side,

Kiril

7 thoughts on “Alexa Media Player in Home Assistant”

  1. Thanks Kiril! I’m forever burdened with knowing “a little about a lot!”. Your webinars and videos help round off a lot of topics for me. 🙂 For example, I had no idea you could work with sequences in this integration! Thanks buddy!

  2. You are welcome Christopher, I’m super happy that I’m able to help. That is the whole point to help each other here.

  3. Thanks for the tutorial. I’ve got it working to announce text on an echo dot. Can you show an example of how to play a local mp3? The music is on the HA server, and plays using the Media add-on, but I’d like to send the output to the echo dot.

  4. Hey Kril – Many thanks for the tutorial!

    I have followed the steps (many times:) but I do not get a good result i.e. I don’t get the “Success” screen instead I get an Amazon Captcha screen…. Any idea?

  5. Peyanski I enjoy all your videos. I have a question, can I get the integration that are in the Alexa app and not exposed to HA exposed to HA?

  6. Completed all the steps exacly .. my Echo dot is listed had entity but can’t use it .
    All functions are unavailable .. control / next alarm / etc.

Leave a Reply

Your email address will not be published. Required fields are marked *