Echo Devices (Alexa) as Media Player - Testers Needed

I have this done with follow part in configuration.yaml

smart_home:
  endpoint: https://api.eu.amazonalexa.com/v3/events
  client_id: !secret alexa_client_id
  client_secret: !secret alexa_client_secret
  filter:
    include_entities:
      - light.livingroom_all
      - light.dressoir_all
      - light.hallway
      - light.balcony
      - light.kitchen_all

Follow the tutorial on this page:

2.3.0 is out.

Two features in this release:

  1. Notifications are now exposed as sensors. This means you can see upcoming alarms, timers, and reminders. For those of you who understand templates, share anything you create on the Wiki!
  2. We have a clear_history service to delete voice history (thanks to macbury who submitted this months ago and I finally added it). Use at your own risk since there isn’t an undo. Also read the warning in the docs if you’re using last_called sensors while deleting history.

Also added fixes for the integrations page and added additional logic to catch expired logins. As that’s hard to test, I’ll need logs if it doesn’t work for you.

You should really be on HACS. *While you shouldn’t need 1.4.1 any more, please note you can edit options in HACS 14.x to view more than 5 releases by changing the Integration Options.

Feature

  • add clear_history service (ecbc8b6)
  • add logic to catch login errors (6633598)
  • add basic notifications sensors (465b2ca) (resolves #144)

Fix

  • update to alexapy 1.3.0 (64c5d8f) (fixes #387)
  • catch connection errors in config_flow and inform user (ef06760)
  • prompt for login on disconnect (cb3a8fb)
  • fix bug where unable to relogin using configurator (81a7127)
  • fix bug where import configuration not resumed (6579b6f)

Full changelog.

As always, please use the the Wiki and FAQ if you need instructions or have questions. Also, please help in documenting features in the wiki since this thread is basically unsearchable now. We also use GitHub for bug reports/feature requests .

1 Like

Hello,
first of all thx for the your huge input into Homeassistant, i really appreciate this!!!
One small question:
how can i play in an Alexa Group?
I have a group called “wohnung” and i have an entity called “media_player.wohnung”, which is availible and has 56253 supported_feautures^^.
But if i call following:

 -  entity: media_player.wohnung
    image: /local/AntenneBayern.png
    tap_action:
      action: call-service
      service: media_player.play_media
      service_data:
        entity_id: media_player.wohnung
        media_content_id: Antenne Bayern
        media_content_type: TUNEIN

nothing happens,
it is working with
entity_id:media_player.echo_dot_wohnen
on 1 device.
Do i miss something?
Thx in Advance
Wiesl

Wiki

sry, i am no native speaker.
This means that it can work or not and i have no syntax error or anything?
i donnot understand, what the group “guest.room” or “everywhere” is?
Sry for the dumb question.
My setup is 2 Echo Dots in one group called “wohnen”.
i can play on any of the two Echos via ServiceCall :
entity_id: media_player.echo_dot_wohnen
or
entity_id: media_player.echo_dot_schlafen

but i cannot play any media on both simultanioulsy.
can you please share the workaround or hack for this example.
Thx in Advance
Wiesl

You could just send the same message to both echos using target and putting both of your echos there?

From the Wiki:

doorbell:
  sequence:
  - service: media_player.volume_set
    entity_id: media_player.downstairs
    data:
      volume_level: '1.0'
  - service: notify.alexa_media
    data:
      data:
        type: tts
      target: 
        - media_player.downstairs
        - media_player.upstairs
      message: 'Ding-dong. Someone is at the door.'

Or you can a group in HA. for example “group.alexamedia” and call the automation like this below:

      - service: notify.alexa_media
        data:
          data:
            type: announce
          target:
            - group.alexamedia
          message: "Your Message goes Here!"

I am really struggling here, I am trying to get a basic automation to work. My wife and I work odd schedules and with winter coming it would be good to know if either one gets to work safely.

My use case is when someone arrives or leaves a location, send a tts announcement to a device or group. here is where i am…

this is the basic automation I can’t seem to get to work. If any one has an idea please clue me in…

- id: 'location announce alert'
  alias: ' Jack is leaving work - tts'
  trigger:
  - entity_id: device_tracker.jack
    event: arrive
    platform: zone
    zone: zone.work
  action:
  - data:
      entity_id: media_player.office_2
      message: "Jack has just left work"
    service: notify.alexa_media

Have you looked at the docs or even the post right before yours?

You don’t have the “data:” section syntax correct. It needs a “target:” and “type:” of tts.

I use the “to” option (my wife for some reason doesn’t think this is funny but it definitely works). I don’t use entity_id (I think that is old), use target instead. I use state instead of zone in the trigger and that works very well. You could do “from” instead of “to” for triggering on leaving a zone.

- id: alexa_notify_person1_has_arrived
  alias: "Alexa Notify - Angelo has arrived"
  initial_state: 'on'
  trigger:
    platform: state
    entity_id: person.angelo
    to: "home"
  condition:
    - condition: time
      after: '15:00:00'
      before: '19:30:00'
  action:
    - service: notify.alexa_media
      data:
        target:
          - media_player.main_show
          - media_player.kitchen_show
          - media_player.kitchen
        data:
          type: announce
        message: 'Hear ye, hear ye, the one, the only, the man who needs no introduction, the man with the plan, Angelo, yes I said Angelo, is now arriving.'

I assume you need help in German so hopefully one of those regulars can explain. But first Alexa relies on multiroom groups. While we can create an entity for the group once you make one, you can’t directly make it play. You have to hack the service by adding the verbal command to play to the group.

That’s what I do as well

Did anyone get the new alarm, reminder and timer sensors after update? My HA is not showing them at all. The clear history service is available.

Are you using filters like include_devices? That will stop them from being discovered.

Ah yes, that was the problem… again :slight_smile:

@Montie, any way to get Alexa to whisper without the announce beep? Any way to disable the leading chime?

No. TTS won’t have the beep but it cannot process SSML.

I’ve been using this integration for a year or so and recall seeing my bluetooth speakers listed with each echo device where I had set them up in the Alexa App. I’m now on the most current version and I can’t see the bluetooth speakers in the Source or Source List on the states page. Am I alone? Is there a config option I need to select to show and then select the alternate speakers?

Speakers are not Bluetooth sources. They are sinks. You can still connect to them using a source call but they won’t show in the UI.

EDIT: add link

Thanks for the link. So, I need to use the BT Speaker Devices as paired in the Alexa App and the BT speakers paired to a specific Echo device are no longer available as an attribute to the Echo in HA?