Echo Devices (Alexa) as Media Player - Testers Needed

Change the name from alexa app. Then ha will see the same name you given in alexa app.

@Sunonline

Once you rename the device from alexa app. Then in ha delete your alexa from pycache again and restart ha.

New captcha will prompt. put in then all your alexa devices will be in ha.

I have done all those things, that wasn’t the issue.

I’ve worked it out I think. I’ve only just started using Docker and didn’t realize the entity_registry.yaml file held names unless manually changed.

My alexa devices show in entity_id as media_player in ha frontend, but none show in entity_registry.yaml

Hello

I kind of messed up I think when trying to install this. I added the Hassio add-on then saw the update note. So I added the new version of the alexa.py into the relevant folder and the config into my main configuration.yaml file, but I’m unable to uninstall the Hassio add-on.

Firstly does it need to be uninstalled or can it just be stopped?

Secondly if it does need to be uninstalled any ideas why it wouldn’t?

There’s an error in the addon that doesn’t allow you to uninstall it. Keaton will push an update soon that fixes this so we can safely remove it

Ah excellent cheers @emnaudin , apologies I must have missed that when reading through everything.

with the new update 0.7 the speech to text option is way more easily available when you click the entity from the front end. however the wrong service gets called, tts/google_say, should be media_player.alexa_tts no?

I just made a quick automation to get around that.

input_select.yaml

alexa:
  name: Alexa
  options:
    - None
    - Lounge
    - Kitchen
    - Bedroom
    - Office
  initial: None
  icon: mdi:target

input_text.yaml

alexa_tts:
  name: Alexa TTS
  initial: Hello

groups.yaml

media_players:
  name: Media Players
  entities:
    - input_text.alexa_tts
    - input_select.alexa

automation.yaml

- alias: Alexa TTS
  trigger:
    platform: state
    entity_id: input_select.alexa
  action:
    - service: media_player.volume_set
      data_template:
        entity_id: >
          {% if is_state('input_select.alexa', 'Lounge') %}
            media_player.lounge
          {% elif is_state('input_select.alexa', 'Bedroom') %}
            media_player.bedroom
          {% elif is_state('input_select.alexa', 'Kitchen') %}
            media_player.kitchen
          {% elif is_state('input_select.alexa', 'Office') %}
            media_player.office
          {% elif is_state('input_select.alexa', 'None') %}
            false
          {% endif %}
        volume_level: 0.5
    - service: media_player.alexa_tts
      data_template:
        entity_id: >
          {% if is_state('input_select.alexa', 'Lounge') %}
            media_player.lounge
          {% elif is_state('input_select.alexa', 'Bedroom') %}
            media_player.bedroom
          {% elif is_state('input_select.alexa', 'Kitchen') %}
            media_player.kitchen            
          {% elif is_state('input_select.alexa', 'Office') %}
            media_player.office
          {% elif is_state('input_select.alexa', 'None') %}
            false
          {% endif %}
        message: "{{  states.input_text.alexa_tts.state }}"
    - delay: '00:00:02'
    - service: input_select.select_option
      data:
        entity_id: input_select.alexa
        option: None

You type your text in the box, and select which device you wish to send it to. After 2 secs, it defaults back to ‘None’ so you can go again.
Alexa

8 Likes

Spotify podcasts works?

@keatontaylor Seeing warnings in the logs:

Log Details (WARNING)
Fri Jul 20 2018 12:53:41 GMT-0400 (Eastern Daylight Time)

Updating alexa media_player took longer than the scheduled update interval 0:00:100:

Looks like there is some IO related issue.

@SouzaaThales, looks like a copy paste issue with the double quotes. Try entering in the JSON by hand. Also just tested Spotify podcasts.

“media_content_id”: “The Wilderness Podcast”

@arsaboo, I might need to make the update interval longer if this is happening, but I am kinda surprised it is, the responses from amazon’s servers always seem to be pretty snappy for me

@kanga_who NICE!

@drumstick93, the reason the TTS option doesn’t work in the media player card is because that option actually uses google_tts or other TTS provider to generate an audio file that has the text spoken that you type, it then sends that to the media component to play.

There is currently no way to play arbitrary audio files on the echo devices. So instead my API is using the same method Routines use to make the echos speak a custom phrase. That is why it is a requirement that the TTS called from the alexa_tts service.

Please do make the update interval longer in the next release. I’m getting the Updating alexa media_player took longer than the scheduled update interval also, and sometimes there are more than 20…30 of them in a day. Thank You.

So the downside to a longer update interval is that there will be a longer gap between when HA checks for changes on the Alexa api. So you may ask Alexa to play some music but not see it in the UI for 20 seconds instead of just 10-15.

For those getting the update interval log messages how does the [alexa.amazon.com] (or the website for your region) perform? Is it slow to load as well?

Thanks, you are right. I was trying with media_player.media_play instead of media_player.play_media.

About podcasts, its not working, Alexa aways says " hmm i don’t know that one".