Echo Devices (Alexa) as Media Player - Testers Needed

Announcements seem to be individual to each alexa device:

settings / device settings / communication / announcements

you’re right, thanks

Hi, @keatontaylor.

There is any way to stop/dismiss an alarm playing on Alexa Echo Dot?

I have this automation and want to stop an active alarm playing:

- id: 'ligardesligarcabeceiraXXXXXXdespertador'   
  alias: 'Ligar/desligar cabeceira XXXXXX com despertador'
  trigger:
    - platform: state
      entity_id: binary_sensor.despertador_j7
  condition:
    condition: and
    conditions:
    - condition: state
      entity_id: person.XXXXXX
      state: home
    - condition: state
      entity_id: person.YYYYYYY
      state: not_home
  action:
    - service_template: >
        {% if is_state('binary_sensor.despertador_j7', 'on') %}
          switch.turn_on
        {% elif is_state('binary_sensor.despertador_j7', 'off') %}
          switch.turn_off
        {% else %}
          switch.turn_off
        {% endif %}
      entity_id: switch.cabeceira_XXXXXX

Thanks.

I used the last called sensor myself for a long while. I actually still have the sensor for some reason, but if you want to have one less sensor for your system, this works

 - service: notify.alexa_media
    data_template:
      target: 
        -  "{{ states.media_player | selectattr('attributes.last_called','eq',True) | map(attribute='entity_id') | first }}"
      data:
        type: tts

I’ve been using this for months, and it has never been wrong

1 Like

Hi, not sure if I’m doing something wrong here but I’m trying to find the timer sensor to add to a lovelace card but I can’t find any. Do I need to add any configuration to create the sensors that I’ve missed? I’m on 2.3.4 installed on Hassio using HACS. Announcements work great but I can’t seem to find any created sensors as the documentation seems to say I should?

Thanks

Probably asked and answered already, but I’m not finding it – Do echo show devices not work with this? I have 3 and all 3 are being missed/not picked up.

Both my Show 5’s are working

I created this automation, which I thought might be useful for other people, which will announce the remaining time of a timer at 5 minute intervals (providing the timer is for longer than 5 minutes).

- id: timer_announcement
  alias: Timer Announcement
  trigger:
    - platform: template
      value_template: >
        {%- set sorted_active = states.sensor.computer_room_next_timer.attributes.sorted_active | from_json -%}
        {%- set duration = (sorted_active[0][1].remainingTime / 60000) | round(0) -%}
        {%- set remaining = (((as_timestamp(states.sensor.computer_room_next_timer.state) - as_timestamp(states.sensor.time.last_changed)) / 60) | int) -%}
        {{ states.sensor.computer_room_next_timer.state != "unavailable" and duration > 5 and remaining != duration and remaining != 0 and remaining % 5 == 0 }}
  action:
    - service_template: >-
        notify.alexa_media_computer_room
      data_template:
        message: >-
          {%- if states.sensor.computer_room_next_timer.state != "unavailable" -%}
          {%- set sorted_active = states.sensor.computer_room_next_timer.attributes.sorted_active | from_json -%}
          {%- set duration = (sorted_active[0][1].remainingTime / 60000) | round(0) -%}
          {%- set remaining = (((as_timestamp(states.sensor.computer_room_next_timer.state) - as_timestamp(now())) / 60) | int) -%}
          Just thought you'd like to know, you have {{ remaining }} {{ "minutes" if duration > 1 else "minute" }} left on your {{ duration }} minute timer.
          {%- endif -%}
        data:
          type: announce
          method: all

Simply change sensor.computer_room_next_timer and notify.alexa_media_computer_room to match the Alexa device you want this to run on.

Note: This also requires a date_time sensor, sensor.time (this allows time calculations to be done more reliably than using now()).

6 Likes

Has anybody run into an issue where a routine only partially runs when initiated through a HA service call?

I have an alexa routine set up that first speaks a random goodnight phrase and then turns on a rain sound skill. When I activate the route from my Alexa app or by voice, it works as intended; however, when I activate the routine using the media_player.play_media service, the routine starts and speaks the goodnight phrase and then goes silent. If I replace the rain sound skill with music, it will work as intended, so it might have to do with the skill, but it is very odd that the issue only arises when the routine is activated using an automation and works perfectly using voice. Is there something I am missing?

You have to enable announce in the alexa app in devices settings section communication

Can anyone tell me how I could associate an announcement with an entity button press please? Thought it would be easy but can’t get it to work. (The addon works fine when I test it through developer tools > services.)

Hello all,

I do have 3 Amazon Alexa device :

  • Echo Spot
  • 2x Echo Dot

When I had the devices in the integration panel, only the first is found.
I tried to change the order, same result then I’ unable to add anymore.

The sentence provided looks like this:

EchoSpot, EchoDot1, EchoDot2

I tried to setup with the configuration.yaml instead without result using the following entries:

alexa_media:
  accounts:
  - email: !secret alexa_email
    password: !secret alexa_password
    url: amazon.fr
    scan_interval: 240
    include_devices:
      - EchoSpot
      - EchoDot1
      - EchoDot2

Note: Using the YAML configuration, not event 1 device is found :sleepy:

I need help or advice, please.

Found the issue, I used space caracter after the coma…
Keep the previous post in case of…

EchoSpot,EchoDot1,EchoDot2

Thanks

None of my 4 echo (3 second gen and one dot) display the timer sensors… not sure where to start debugging…

Same for me.

Additionaly I‘d like to use the do not disturb switches, but they also don’t show up. Can’t find them in the Integrationssection or in the entity section.

Replying to my own post here - I figured out what is going on (at least in my case). When you configure the integration, if you use an “Include” list, then the sensors and other switches don’t get set up. I just filed a bug on Github:

1 Like

I‘m also using an include list. Thanks

Include only includes devices/sensors/switches if you actually include them. So if you didn’t add the timer or the do not disturb switch, it won’t try to include it.

Seems like a bug. We’ll need the json from the routine to compare to what we’re sending the component. Instruction here.

Mind adding it to the wiki? Also, did this require the patch you mentioned earlier to change the sensor without sensor.dumps? Or does the from_json automatically convert it without the patch? Debating whether I need to add this change in.

No in the normal case, however if you are using include_devices you won’t see it unless you add them.

No. We can only replicate the Alexa app and I don’t think you can do it there.

No, but adding/removing the integration won’t cause any issues as the entity_ids will be consistent for prior entities.

You can if you can’t figure out why HACS won’t let you install it. It’ll also be harder to update it later. However, that seems like a HACS bug that needs to be resolved. Did you recently update the HACS version? That may disable the install option but I don’t know.

Thanks Alandtse, I used to use include when I configured manually but since using with Integrations I have left the default (as far as I can tell!) and there are no sensors showing. I do recall hiding all the “do not disturb” switches at one point (can’t remember if it was before or after changing to the Integration) so I maybe got carried away and hid the sensors at the same time but for the life of me I can’s find the hidden entities to check and unhide! I’ve checked my customize.yaml and nothing in there.

Is it worth deleting the integration and adding again?

Cheers

HI,
I got these errors after restart

Sun Dec 01 2019 17:26:45 GMT+0100 (Mitteleuropäische Normalzeit)
Error setting up entry [email protected] - amazon.de for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 192, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 79, in async_setup_entry
    return await hass.data[DOMAIN].async_setup_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 151, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!

image

what’s the problem?
A first test seem to be successful. alexa announce seem to work