How to do Amazon Alexa TTS Announcements without using Alexa Media Player (no reauthentication needed)

Some nice fellow pointed out this possibility to me on Facebook and I really like that my TTS announcements are no longer subject to the frequent reauthentication whims of Alexa Media Player after implementing this, so I thought I would share a guide.

It is actually possible to make announcements using this method and bypassing Alexa Media Player entirely. This has some advantages, the big one being that you will not lose your announcement capabilities every time that Alexa Media Player loses it’s authentication (which happens every couple weeks for me, and which is why I’m moving my Alexa announcements over to this method). The downside is that it’s quite a bit more configuration to do and you need Nabu Casa or the Alexa Custom Skill set up, and you cannot use dynamic text, it has to be a fixed message. Here’s how it’s done:

first make a very simple script with no actions as a tag for the announcement you want to make:

script:
  announce_dishes_are_clean:
    sequence:

Then make a template binary)sensor which reads the on/off value of the script and converts it into a motion sensor:

binary_sensor:
  - platform: template
    sensors:
      announce_dishes_are_clean:
        device_class: motion
        value_template: "{{ states.script.announce_dishes_are_clean.state == 'on' }}"

Then you will need to sync your alexa entities in the nabu casa configuration (ensure that you have binary_sensors set to sync or at least the individual sensor you are adding).
image

and and turn on the option to sync the entity states

then you will need to create a matching routine in the alexa app to actually read out the announcement when it sees the state change of our dummy movement sensor:

You can now test to see if it works in the developer tools. If it does, you should hear your announcement:

Then you can use it as a service call in your automations and never worry about reauthentication of Alexa Media breaking it again:

- id: kitchen_bar_alexa_notify_clean_dishes
  alias: "TTS Notify Clean Dishes to Kitchen Bar Alexa"
  initial_state: 'true'
  trigger:
    platform: state
    entity_id: sensor.bosch_dishwasher_door
    to: 'open'
  condition:
    condition: and
    conditions:
      - condition: template
        value_template: '{{ (as_timestamp(now()) - as_timestamp(states.automation.fire_notify_clean_dishes.attributes.last_triggered | default(0)) | int > 150)}}'
      - condition: or
        conditions:
          - condition: state
            entity_id: input_select.bosch_dishwasher_status
            state: 'Clean'
          - condition: state
            entity_id: input_select.bosch_dishwasher_status
            state: 'Emptying'
  action:
    - service: script.announce_dishes_are_clean
2 Likes

Basically you’re triggering a routine that has static text. Correct?

Yep. Unfortunately using templates for dynamic text is not a possibility using this method as there’s no way to communicate it to the Alexa app and read it back.

Clever solution for some less variable situations.

Very helpful - I like this a lot. But it seems the announcement can only be played on a single echo/alexa device (as set up in the routine). Has anyone discovered a way to say this announcement on multiple devices?

UPDATE! Solved this myself, but recording here for others - you can send to multiple devices using the “messaging” action, rather than the “Alexa Says” option. Very nice, thanks again!

1 Like

So I’m having an issue with this idea. I want Alexa to simply say something when a group turns on. I’ve setup the same sort of binary_sensor template as you:

binary_sensor:
  - platform: template
    name: Home Activity
    sensors:
      home_activity:
        device_class: motion
        value_template: "{{ is_state('group.home','on') }}"

group.home is simply a group of motion_detectors.

However when trying to add this as the ‘when’ in alexa, I can see the device ‘home_activity’ but when I tap on it I get "Error. This device is not currently supported’.

Any ideas where I’m going wrong here?