Echo Devices (Alexa) as Media Player - Testers Needed

alexa
Tags: #<Tag:0x00007f058912b4f8>

#1636

you are using the wrong quotes

use these "


#1637

I cannot get if/else working in message. Any help is appreciated. I tested in dev info and it works as expected.

{
"entity_id":"media_player.living_room_echo_dot",
"message":"{% if 1 == 1 %}hello{% else %}bye{% endif %}"
}

It announces “if 1 1 hello else bye endif” — literally reading the if statement

reference issue 55 (closed)


#1638

That will probably not work in a dev tools service call. Try to use it in a script or automation.


#1639

Isn’t that the whole point in using service calls is to test before putting into script or automation. I means that’s what I do.

Doesn’t work in script either. Just read the if statement as if it’s just words.


#1640

That’s true. But I think the service dev tool, just passes ‘data’ and not ‘data_template’.
Take a look at the examples in the wiki. I copied them directly from my working configuration. I use them on a daily base. The templating is very sensitive to correct setup, a small typo can mess up everything.
If you post what you’re trying to achive in a script, maybe we could help.

examples are also hidden in this long thread


#1641

Sorry i know nothing about python and programming and the git pull/merge stuff…

But i hacked the component from keatontaylor to do what i missed. My version can play Joke/Flashbriefing and some other things via service call.
The sequences i know are:

  • Alexa.Weather.Play
  • Alexa.Traffic.Play
  • Alexa.FlashBriefing.Play
  • Alexa.GoodMorning.Play
  • Alexa.GoodNight.Play
  • Alexa.SingASong.Play
  • Alexa.TellStory.Play
  • Alexa.Joke.Play
  • Alexa.Calendar.PlayTomorrow
  • Alexa.Calendar.PlayToday
  • Alexa.Calendar.PlayNext

Sample with developer tools:
sequence

I thing the entity_id is a required paramter but i dont know ho to extend the schema. Also the description of the “sequence” paramter is missing and i dont know how to add it. Perhaps there are some talented programmers out there to make this a standard component.

Download: mediaplayer with sequence support (alpha stage!!!)
Keep in mind, i cant support on error. So use it at your own risk.


#1642

First, thanks for fast reply.
Cookie works after reboot.
If I delete the .pickle file HA creates a new one without captcha question, creepy…

Wich data do you need to find my problem ?


#1643

I can’t even get my simple 1 = 1 test notification as a script.

'1546701126812':
  alias: Test Alexa
  sequence:
  - data:
      entity_id: media_player.living_room_echo_dot
      message: '{% if 1 == 1 %}hello{% else %}bye{% endif %}'
    service: media_player.alexa_tts

#1644

Replace - data with - data_template
As I told you, a simple typo will mess up everything.


#1645

Ding, ding, and the winner is @Remco_Timmer. Thanks


#1646

I’m hoping in the future we could invoke a Alexa Skill using HA. Specifically the Start my car Chevy app! That would be awesome!


#1647

If you submit a pull request we can help you merge it in. Just remove the extraneous comments you have that you used for notes and also increment the version by 0.0.1 and allow edits and we can help. We all start from the beginning when it comes to programming and you’ve already made the first step by getting the code working for your use.

  1. Turn on debugging.
  2. Confirm tts works for your devices on reboot.
  3. When things fail with Alexa in the future, try the tts you used in 2 above again and put the relevant part of the home-assistant log in a secret gist. It should include any errors you may have gotten from alexa and the alexa tts component. Remove any amazon emails/passwords
  4. Private message me with the gist url. I can take a look and guide further.

#1648

I have this issue:
Set mediaplayer volume
Maybe someone here can help out.

By the way: Is it possible to update this component with the custom_updater?


#1649

Everything worked in the past, but right now I do not have the alexa_tts entity.
All my Echos are present an I can control them via HA. If I try to use the Text to Speech feature in the media card Alexa tells me that there has to be the Alexa Text to Speech service.
I already upgraded to the latest alexa.py and deleted the py-cache, but nothing changed!

Can anybody help me with this?


#1650

Well i made a pull request but i also took my README.md which should not be merged.

Sorry for this mistake.


#1651

Should playing to MRM groups work the same as a specific device?

If I do a service call in the dev console using “media_player.living_room” as the entity, it works fine (that’s a single echo). “media_player.whole_house” does not. I can control the Whole House MDM via Media Player Card if I play it using voice commands. I debugged the JSON being posted, and everything looks identical as far as what is POSTed to alexa.amazon.com. Any ideas or guidance on MRM groups?


#1652

The media card has never worked for tts..
Are you saying you don’t have a service media_player.alexa_tts? We’ll need logs to figure out why. Please turn on debugging and post any errors being generated by the component in an issue and we’ll take a look.

There have been scripts posted in the thread to help set the volume by playing a silent track prior to any TTS announcement. Please search. Alternatively, you can wait till someone resolves it here.

As for custom updater, no one’s filed an issue for it although people have requested it a couple of times.

I believe it’s an Amazon limitation that it only supports Amazon’s built in music services; HA can’t interact with the groups directly. Workarounds have been to create a HA group with all media_player entities and then adjust for the different response times since they do not all sync anymore.


#1653

Thank you, found the solution here Echo Devices (Alexa) as Media Player - Testers Needed

I also opened an issue (custom updater).


#1654

Do we need amazon music unlimited for this?

It works for me now because I have a test phase, but I won’t use it after it ended. I do have amazon music (prime). Does it work with that too?


#1655

yes it works without unlimited. Prime is enough.