Alexa Media Player Routines

Hey all,

I’m hoping this will help someone, because this took hours to figure out. It really should not be that hard for a newbie :frowning: I was just lucky I found this legends blog with all the info on it.

FYI, im very new to HA, so I doubt I could really help if you have questions, but ill give it a go LOL

Also, hopefully this goes without saying, but you need to have Alexa Media Player installed and working

Go Kick Dirt – 22 Oct 20

Calling Alexa routines from Home Assistant

I have been trying to find a simple way to have Home Assistant start and stop the internet radio station Radio Paradise on all my Alexa speakers in the house. I have a couple of Echo dots and Echo …

  1. create the Alexa routines
  2. create the scripts (I just pasted these directly into the scripts.yaml and edited to what I needed)
radioparadise:
  alias: Play Radio Paradise
  icon: "mdi:play"
  sequence:
  - service: media_player.play_media
    data:
      media_content_id: Radio Paradise
      media_content_type: routine
    entity_id: media_player.den_echo_dot
  mode: single

stopmusic:
  alias: Stop playing music on Alexa
  icon: "mdi:stop"
  sequence:
  - service: media_player.play_media
    data:
      media_content_id: stop playing music
      media_content_type: routine
    entity_id: media_player.den_echo_dot
  mode: single 
  1. Put the following in your configuration.yaml
homeassistant:
  customize: !include customize.yaml
  packages: !include_dir_named packages # package setup
  1. Create a “customize.yaml” in the HA config folder and add this code block (edit for your own context)
script.radioparadise:
  friendly_name: Start Playing
  icon: mdi:play
script.stopmusic:
  friendly_name: Stop Playing
  icon: mdi:stop
  1. I also created a lovelace card to test it out, but up to you

Copy to clipboard

entities:
  - action_name: Play
    entity: script.radioparadise
  - action_name: Stop
    entity: script.stopmusic
show_header_toggle: false
title: Radio Paradise
type: entities
1 Like