Echo Devices (Alexa) as Media Player - Testers Needed

I’ve been troubleshooting a speaker group issue with the Alexa app, unrelated to home assistant, however I’ve just noticed that in my devices under the integration I have old Echo devices removed from my amazon account, as well as speaker groups I have deleted. Is there a way to purge these from Home Assistant? They aren’t on my amazon account anymore.

I just started using the component, so it is very possible that I am doing something wrong. Does anyone know if media_content_type: sound works with Sonos speakers? The following works for me on an echo dot, but not on a Sonos Move. Thoughts?

    - service: media_player.play_media
      data:
        entity_id: media_player.ben_s_echo_dot
        media_content_type: sound
        media_content_id: amzn_sfx_doorbell_chime_01

Hi!
I am trying to figure out how to call a skill that I have installed on the Echo. I have the notification working fine and have my custom skill where it is easy to find the skill_id. But for the love of my life I cant figure out how to call a skill (non-custom).
What I am trying to do is to use MyTuner skill to play my radio. I know…iTunes is there and I use it today but it is not good enough since many channels aren’t working and it is also random what channel work what day etc.
However I have iTunes working and I have alexa notification working with response etc.

I just need to figure out how to find the skill_id from MyTuner.

To find the skill id, do this:

  • Open https://alexa.amazon.tld (e.g. https://alexa.amazon.co.uk) in Google Chrome
  • Open the Developer Tools and open the Network tab
  • Click on Skills and then on the Your Skills button
  • Click the clear button for the Network tab in developer tools (this makes finding the URL easier in the next step)
  • Click on the particular skill you want to find the id for
  • You should see a URL something like https://skills-store.amazon.tld/app/dp/… show in the Network tab of Developer tools. Click on this
  • Switch to the Response tab
  • Copy the JSON from there into a text editor and search for anything which contains “ask.skill” - that is your skill id (you can actually search directly in the Response tab but copying it into a text editor makes it easier).
4 Likes

Thanks a million! That was super easy when you pointed me where to look. I had found all the way till the response tab. That was the piece I was missing. Now I have the skill ID so now I can continue to play and get MyTuner to be my radio on my Alexa devices :slight_smile:

Got it to work half way. I get it to open the skill but I cant seem to be able to parse the radio station name.

I am using the same setup as the Alexa Notification where I have the following defined in a script:

mytuner_alexa_skill:
description: ‘Activates an actionable notification on a specific echo device’
fields:
text:
description: ‘The text you would like alexa to speak.’
event_id:
description: ‘Correlation ID for event responses’
alexa_device:
description: ‘Alexa device you want to trigger’
sequence:
- service: input_text.set_value
data_template:
entity_id: input_text.mytune_alexa_radio
value: ‘{“text”: “{{ text }}”, “event”: “{{ event_id }}”}’
- service: media_player.play_media
data_template:
entity_id: “{{ alexa_device }}”
media_content_type: skill
media_content_id: amzn1.ask.skill.94c477e7-61c0-43f5-b7d9-36d7498a4d04

This is what I use in the service call:
text: ‘play Sveriges Radio P3’
event_id: mytuner_test
alexa_device: media_player.kitchen_dot

I don’t think that will work with a skill you haven’t created yourself. It would need to knwo to connect to your Home Assistant instance and read the station name from that input_text.

I previously tested out one way of doing it, using a skill called Routine Stream. That skill allows you to enter a stream URL on a website, and it plays it when the skill is launched. I successfully pointed it to an .m3u file in the www folder in Home Assistant via the external URL (I use Nabu Casa remote access). It would then be possible to have a process which switches the content of the .m3u file depending on what you want to play.

Alternatively, you would need a skill which allows you to set a favourite station and will then play it, without prompting, when you launch the skill.

A couple weeks ago, I started moving everything from smartthings to Home Assistant. Everything had been working perfectly until last night. I noticed my echo notifications weren’t working. After some investigation, I found the configurator prompting to enter the captcha. I did this but had to restart HA to get it working again. After a few tests, I thought everything was working properly again. Went outside for a few minutes and came back in. Alexa was supposed to tell me that the garage door was closed but didn’t. The captcha prompt was back. I went through all the recommendations including removing the integration, removing the pickle file, etc, etc. During the integration installation, it took many tries to get past the logon page to where it gave me the captcha. This happened when I initially installed the Alexa Media Player integration.

After several tests, everything was working properly…Until it wasn’t. The captcha was back.

I never had this issue when using echo speaks with smartthings.

Anyone else having the issue?

I just checked over on the echo speaks smartthings forum and this has started happening for some with that integration as well.

Mine also stopped working.

Edit:
I kinda found the problem. If you read the message correctly, it says you should enter your password NOT the captcha. After that the HA notification was still there, then you can enter the captcha and after that you have to enter your 2FA token (if setup).

I don’t know if amazon changed something on their end or what caused all this

2 Likes

While the message is from Amazon, the component should be filling the appropriate field based on the form id so even if you type your password in the HA form, it would treat that as a captcha. If there is a password field, it should also automatically be filling it.

Of course, if the page has paged, the logs would capture the form that would need to be accounted for. If someone provides that data, we can then address it in the component.

Mine was asking for the captcha. If I entered it wrong, it would prompt to enter it again.

It hasn’t prompted again in about 24 hours so hopefully, whatever the issue was, it’s resolved.

Either that or the flow detect that and display other messages. It tries du display the captcha image which doesn’t work, so I’ve restarted HA and then the captcha image is displayed correctly but then you have to do the other steps as well (PW/2FA) and every time the flow button says “please enter the displayed captcha” If should have said “please enter password” or “please enter 2fa”

Apologies if this has been covered but I tried searching the messages here to no avail, so hopefully someone can point me in the right direction here.

I run Hassio in Docker and installed it via Manual mode and configured it in HA’s integrations page, as recommended.

I recently updated to v2.8.3, and it’s actually been working fine all this while, but an issue I’ve had is that I can’t seem to get the integration to discover all my devices.
I’ve actually not added any new devices since installation; it just simply never caught all my devices from the beginning.

Some of the Sonos speakers in my setup are missing, which is fine cause they’re mostly irrelevant to this anyway.
(I just thought it odd that only half of them showed up in HA, while the rest didn’t. Even weirder was that some of those which were discovered were speakers which were turned off at the time, while some which are always on have yet to be detected, despite multiple HA restarts.)

However, one of the missing speakers is a Sonos One, which does have built-in Alexa. Its other entities (switches and sensors) got detected, but the actual media player entity is missing.
I know this because I have another Sonos One which detected properly and I’ve been broadcasting messages through it using the integration. Both speakers have Alexa activated in the Sonos app, and their settings are virtually identical.

“Enable New Entities” is checked in the integration configuration, and I’ve restarted Hassio many times since it was installed a couple of months ago.

I’ve been trying to avoid scrubbing the integration and reinstalling it, since I’ve already edited the core.entity_registry to give proper ids and names to the existing devices.

Is there a way I could refresh the discovery process AND not lose the already discovered entities?

1 Like

ok Im testing it

Have one problem

if i


works HAPPY CAMPER

BUT

  - alias: Jug is Hot
    initial_state: 'on'
    trigger:
    - platform: state
      entity_id: switch.kettle_power
      to: "off"
    action:
      - service: notify.alex_media_lounge
        data: 
          data:
            type: tts
          message: "Jug is hot its your turn to make it "

does not work
but if I do this

  - alias: Jug is Hot
    initial_state: 'on'
    trigger:
    - platform: state
      entity_id: switch.kettle_power
      to: "off"
    action:
      - data:
          entity_id: light.office
        service: light.turn_off

it works

qustion why does not speak :frowning: did I read the wrong manual

I had similar issues. I found for me, a work around by setting the volume levels first, allowed tts or announce to function.

data:
  volume_level: '0.6'
entity_id: media_player.everywhere
service: media_player.volume_set

data:
  data:
    type: announce
  message: >-
    This is an important weather alert. {{state_attr('binary_sensor.meteoalarm',
    'description')}} is effective on {{state_attr('binary_sensor.meteoalarm',
    'effective')}}
  target:
    - media_player.kitchen
    - media_player.bathroom
    - media_player.bedroom
    - media_player.office
    - media_player.dining_room
service: notify.alexa_media

Hope its of use.
R

1 Like

Thanks Bro will have a look when I get home

well im home got it to work thanks for the pointers then I found this

NOW with a bit of thinking out side the BOX
with this last_alexa sensor

  - platform: template
    sensors:
        last_alexa:
          friendly_name: "Last alexa"
          entity_id:
            - media_player.bedroom
            - media_player.lounge
            - media_player.office
            - media_player.garage
          value_template: >
            {{ states.media_player | selectattr('attributes.last_called','eq',True) | map(attribute='entity_id') | first }}

I have a Routine “boil the jug” which turn on the jug
there fore Home assistant Knows the jug is on so when it goes off

  - alias: "Alexa: Jug is Hot"
    initial_state: 'on'
    trigger:
    - platform: state
      entity_id: switch.kettle_power
      to: "off"
    action:
      - service: notify.alexa_media
        data_template:
          target: 
            - '{{ states.sensor.last_alexa.state }}'
          message: "Jug is Boiled I'm not making it."
          data:
            type: announce
            method: all 

what every dot get given the “boil the jug” Routine
it announce the above automation.

glad you got it sorted.
sorry, I didnt mention the last_alexa template because I just made an assumption!
Worked out in the end though!

Hey everyone. Its asking for my captcha again but this time its not showing the image. It just has text Description Image. How do i get it to fix itself?

Submit anything.