Anyone? This is the code I’m using and getting an error on.
That shouldn’t be a rest sensor but a template sensor.
I’m copying whats in the wiki into sensors.yaml, but nothing seems to work.
In the last week or two volume changes on an Echo no longer updates the HA media_player entity when the Echo is idle. It only works if the Echo is actually playing something. If the Echo is idle the volume in HA never changes despite changing the volume on the Echo. If a song is playing and I press the Echo’s volume button changes DO make it back to HA, but it seems much slower than they used to be (anywhere up to 5-10 seconds or so)
This suddenly happened on all of them (3 Dots and 4 Shows) last week. I was testing out playing Amazon playlists via an HA script at the time. I read something about possibly hitting a rate limit, but I only played a few dozen playlists in half an hour or so which doesn’t seem excessive.
I’ve deleted the integration and reinstalled the add-on, but the behaviour hasn’t changed. Everything else works normally, I can set the volume of an Echo from HA, but changing volume on the Echo isn’t shown in HA. I can force the media_player entity to update the volume with homeassistant.update_entity.
There’s nothing unusual about Alexa in my logs. Is this due to some recent HA change or has anybody got any ideas how to get the old behaviour back?
I read you were “playing Amazon playlists via an HA script”
I myself was trying to figure out how to launch a Spotify playlist from a physical button (Ikea E1524 for instance) to play on an Amazon Echo device.
I started to create the script below and when I click “Run script”, a toast pops up at the bottom left of my screen (“Triggered Play Spotify playlist on Kitchen Echo Dot”) but no music starts
How did you do that ? Thanks !
# in https://blablabla.duckdns.org:8123/config/script/dashboard
alias: Play Spotify playlist on Kitchen Echo Dot
sequence:
- service: media_player.play_media
target:
entity_id: media_player.kitchen
data:
media_content_id: >-
https://open.spotify.com/playlist/5xddIVAtLrZKtt4YGLM1SQ?si=YcvRqaKNTxOi043Qn4LYkg
media_content_type: playlist
mode: single
It looks about right to me (I don’t use Spotify). For Amazon Music the sequence looks like this (note my entity_id is inside my data block):
- service: media_player.play_media
data:
entity_id: media_player.kitchen_echo_show
media_content_type: "AMAZON_MUSIC"
media_content_id: "Essential Classical in everywhere group"
‘in everywhere group’ is an optional Alexa thing, you can leave the out. ‘Essential Classical’ is the name of an Amazon Music playlist. It takes some trial and error to find these. Amazon have a page about them, but 90% of them are available to paid Music subscribers only and not regular Prime members, and the page doesn’t tell you. You can see the error in the HA or Alexa log (I forget which one) when you try and play one.
I do it like this:
- service: script.turn_on
entity_id: script.command_play_music
data:
variables:
media_content: "spiele meine kaffeehausmusik playlist" #means play my kaffehausmusik playlist
media_type: custom
the script then:
- service: media_player.play_media
data:
entity_id: media_player.receiver
media_content_id: >
{% set player = states('input_select.music_sources') %}
{% if player == 'erdgeschoss' %}
{{media_content}} auf erdgeschoss
{% elif player == 'alle_etagen' %}
{{media_content}} auf alle etagen
{% elif player == 'home_office' %}
{{media_content}} im home office
{% else %}
{{media_content}} auf receiver
{% endif %}
media_content_type: custom
amazon knows, that its a spotify playlist and plays it from there
Is this integration still working? Mine worked well so far (sometimes I had to re-synch, typing the 2FA code, but no big deal) but right now… It doesn’t connect! I already tried to install versions 3.10.10, 3.9, 3.8, all versions…
I have tried 2 scenarios:
1 - With 2FA code. When my account has a 2fa code:
- I click " Add Integration" to add “Alexa media player”
- Insert my account details, and uncheck “Use Login Proxy method (2FA not required)”
- And then it loads forever…nothing else happens.
ps: I didn’t add any code to my configuration.yaml … never did and always worked…when I add the code below… it opens a web browser… so I have to retype my account details, the 2FA code… but also nothing happens
alexa_media:
accounts:
- email: !secret amazon_user
password: !secret amazon_password
url: amazon.com
2 - without 2FA code … ok let´s remove the 2FA code from my amazon account…
- I insert all info needed
- a web page automatically opens. I insert all info needed (also a captcha) and click sign-in
- It returns to HA;;now its gonna work!!! not really…it shows a forever loading …and nothing else happens…not even a time out message…
I think Amazon is cancelling this unofficial integration, one by one…
Do you guys have a solution?
Following your example, I tried the following action that worked :
service: media_player.play_media
target:
entity_id: media_player.kitchen
data:
media_content_id: "play discover weekly"
media_content_type: custom
Spotify is mentioned nowhere but starts nonetheless.
It’s probably because Spotify happens to be my default music service.
If I try the following syntax, it works as well :
service: media_player.play_media
target:
entity_id: media_player.kitchen
data:
media_content_id: "billie jean"
media_content_type: SPOTIFY
Please provide logs on Github.
EDIT: As a note, I just confirmed I can login from a fresh login to US and DE servers so the issue is likely tied to your installation for now. There is a general reauth issue happening but that’s likely tied to Amazon.
Before fighting too much with this I would suggest restarting HA first and if it still isn’t working then try to authenticate again… but also I have found the multiple restarts close together seem to make it say it needs authentication… (possibly some sort of limit in connections) but I have found if it is saying to authenticate shortly after a few restarts… waiting about 20-30 minutes and restarting again will get it to work… it actually just happened to me a couple hours ago.
I’ve noticed this too. I had a reauthentication requirement all day. I installed the recently core update and this is working again with no need to reautjenticate.
I’m from Brazil and I’m having the exact same problem.
I already restarted the HA, actually, I did that 100 times…I´ve been reading that many people have the same problem… well, we are talking about an unofficial integration…everything can happen…I just updated HA core… but remains the same issue.
I just updated the HA core, but my problem remains
that on its own can cause trouble with an integration like this.
when it goes wrong with login on to amazon, amazon will put a block on the device that tries to logon for a certain amount of time (in most cases)
so its very well possible that you used a valid option the second or third time you tried, but the amount of times between the tries was to short, because amazon did put in a block.
Wow! I already received a 2FA code from amazon, out of nothing. I was wondering why and that let me look into HA where I detected, that the media player wanted to be reconfigured. The configuration directly opened the gui for entering this code. Did it and that’s it.
This is the most easy way to reconfigure since the beginning of this configuration journey. Great work!
The only question I have is, what happens, when this code is sent during the night. Most of these codes have only a certain time before they become invalid. How does amazon handles this?
Ok, today it happened again. At point 08:00 I received a new 2FA code. But I wasn’t able to react. At 08:19 the code became invalid meanwhile and I hat to restart HA in order to relaunch the authentication. Got a new 2Fa code and it worked.
That is suboptimal. 1st question: why today again? 2nd question: What to to if I’m not at home. My wife will not be happy to have to restart HA and proceed with an authentication.
And last but not least the integration status remains as defect even it works:
I never received any 2FA code out of blue… I receive when I request only…
Mine was working … but sometimes I had to check the integrations … and the integration was down, failed, I had to generate the code (with my app), reinsert it, and it worked again…
but now I cant even finish the integration…
Anyone got the last Alexa template working? Mind sharing what I might be doing wrong? I feel as if I’ve followed the wiki…
edit: I just tried again as written and get the following error from the File Editor:
end of the stream or a document separator is expected at line 148, column 1:
template:
^