Echo Devices (Alexa) as Media Player - Testers Needed

You can try to set the volume level before you need it, save that volume level in a variable, we have a variable component, here, and feed that back, when you need to. I find myself using more variables than I would have imagined for many situations. Maybe this can help you too.

I also installed this tonight.

Works great.

What I was hoping for the ability to set the volume of my echo with an automation. If the media player is active I can set the volume and this is then remembered for subsequent voice responses. However if the media player is in standby state a request to change the volume has no effect. Am I missing something here or is there a work around.

I want to automate the volume being lowered when the kids go to bed.

In addition to what @SMARTMEDIA said about variables, another option is to do a TTS message of “…” which should allow you to set volumes while it’s playing the silence.

2 Likes

@alandtse that’s a great “hack”, nice one, … completely “out of the box” thinking right there … :slight_smile:

I’m using the input_number component

image

image

I am having a hell of a time getting TTS working…

How should my config file look when setting this up?

media_player:

Notice that I have no quotation marks around anything. Not sure if that matters or not, but it works for me.

When i try to send a TTS to it it just says “sorry text to speech can only be called with the alexa media service”

You have to use a script or use the service.

how would i go about that? using the service?

To use the tts service follow the instructions listed bellow. Also found at the top of the post.

I have this radio add on, but when I try it says that text to speech isn’t available. Is there a fix?

I just tried sending something to my alexa. It said the media player alexa tts service is needed. What is that and where do I get it?

Via the UI (the Text to speech.) does not work. You have to call the service. Read up a few posts or the top post to see how to do that. It’s pretty easy once you do it the first time.

Did anything change recently? I still get the captcha, but it never shows the alexa media player after I enter it (used to work last week).

This is excellent. In the UK, without MFA though. Good job @keatontaylor

Took a few mins to setup but I’ve simply done this:

  1. Download alexa.py from https://github.com/keatontaylor/custom_components/blob/master/media_player/alexa.py
  2. I’m using HA on an Orange Pi in a virtual environment, so created the folders custom_components/media_player under home/homeassistant/.homeassistant and copied the file there (using 0.9.1)
  3. Added the code to my configuration.yaml file (no quotes used for secret values in my secrets.yaml file):
    media_player:
  • platform: alexa
    email: !secret amazon_username
    password: !secret amazon_password
    url: “amazon.co.uk
  1. Created an entry in my automations.yaml file as follows:
  • service: media_player.alexa_tts
    data_template:
    entity_id: media_player.echo_dot
    message: “Hello World”

Works great!

Awesome. This is going to be fun.

I’ve noticed, as I think others have mentioned, that unless the echo’s are playing something as HA starts up, they will not be able to be controlled from HA (at least from the media player card)

Is it possible to send a mp3 file as TTS?

Via the UI, the services tab, choose media_player.alexa_tts:

No.1. This works:
{“entity_id”:“media_player.batman”,“message”:"Hello motherfucka’ "}

No.2. This does not work:
{“entity_id”:“media_player.batman”,“message”:“The outside temperature is {{states (‘sensor.dark_sky_apparent_temperature’) }} degrees”}

… in case No.2 Alexa just reads out loud: … " - The outside temperature is states sensor dark sky apparent temperature degrees "… :slight_smile:
… in case No.2 you have to put that in a script and call that script, then it will tell you the value of the temperature.

… at least for me, that’s how it stands for now.

1 Like