Need help to setup notify.alexa_media

Hi,

Probably something I don’t understand …

What I want to acheive : read a text message on/by an alexa device

When trying to use ‘Developement tools → Service’

  • with ‘notify.alexa_media’, i get an ‘[547851380720] Error handling message: Unknown error’ ending with :
 'File "/config/custom_components/alexa_media/notify.py", line 195, in async_send_message
    for target in targets:
TypeError: 'NoneType' object is not iterable'

-with ‘tts.cloud_say’, the error is :
Sorry, text to speech can only be called with the notify.alexa_media service

BTW, this error message is also said through the alexa device.

I’ve tryied to follow instructions found on this forum or/and github-alexa_media … no success.
Surely something i’m missing or misunderstanding.

Your help would be greatly appreciated.

You’re not providing all the information that the service needs. You’re missing target and most likely all the other needed attributes. Take a look at the docs for that custom integration.

@petro
Thanks for your answer.

I’ve followed the instrcution on the github link (I forgot to mention, sorry …).
Uploading: image.png…
with (in yaml mode ) :slight_smile:

service: notify.alexa_media
data:
  message: test
  target: alexa_buro
  data: 
    type: tts

no success, and no error on log.

I’ve also tryied ‘tts.cloud_say’
with

service: tts.cloud_say
data:
  entity_id: media_player.alexa_buro
  message: test

I get the following error :

Sorry, text to speech can only be called with the notify.alexa_media service. Please see the alexa_media wiki for details.https://github.com/custom-components/alexa_media_player/wiki/Configuration%3A-Notification-Component#use-the-notifyalexa_media-service

the above message is also played through alexa_buro, loud and clear

For sure, there is something I don’r understand !

Advice appreciated

1 Like

That doesn’t seem correct. You need the name of it, the entity_id of the media player, or the serial number. That doesn’t look like any of those options.

Also, it target appears to be listed. All the examples shows it as a list.

target:
- item

@petro
thanks for your interest !

It works with :

service: notify.alexa_media
data:
  message: test
  target: 
    # G090XXXXXXXXX           <- doesn't work without a preceding dash
    - G090XXXXXXXXX            <- OK, works. Only with a space between - G090xxx
    # - alexa_buro                      <- doesn't work ... the name was as defined (previous)
    # - aburo                               <- doesn't work ... the name is as defines (after change)
  data:
    type: tts

About the dash / item list, I thank that a dash was required only for/when multiple elements, and not required for a single one.
My mistake, sorry.

tts.cloud say still not working
not so important

A big thank for pointing out my errors.
Any idea why the name is not working/reconnized ?

thks

Well it would be the friendly name of the media_player entity. I would assume it should work if the friendly name of the media_player is ‘alexa_buro’. Or it would be the entity_id of the media_player, which might be something like media_player.alexa_buro

1 Like

Would anybody be so kind to show me the yaml code that i need to place in the automation action so that the tts reads the below sentence (it is partly in dutch language and probably alexa will not pronounce it correctly but it will help me understand how to build a “dynamic” message …

'Today is - {{ now().strftime("%d-%m-%Y") }}. Afvaltype(n): {{ states.sensor.afvalwijzer_tomorrow.state }} wordt opgehaald op: {{ (as_timestamp(now()) + (24*3600)) | timestamp_custom("%d-%m-%Y", True) }}!'

I have as well struggled with Alexa.

When I run the following script nothing happens:

service: notify.alexa_media_echo
data:
  message: Test

The entity is correct and I get an success indication on the button click.
I see as well that the volume adjustment is reflected in HA UI, when I tell my echo to change it.

I also tested the example which worked for someone else, but this doesn´t work either.

service: notify.alexa_media
data:
  message: test
  target: AB72C******
  data:
    type: tts

Do you have the Alexa Media Player integration installed? I think that will determine how you get it to speak.

Have you looked at the Alexa Media Player docs? They cover the yaml pretty well.

your target needs to be alexa media players entity_id’s, but your second example will do TTS to the target. Also, there’s no reason to block out the entity_id as it’s unique to your system and it poses no security threats.

1 Like

What I did so far:

  1. Installed HACS
  2. Installed Alexa Media Player
  3. Configured Alexa Media Player (Amazon Login with 2FA)
  4. Went to DevTools->Service->Selected “Notifications: Send a notification via alexa_media_echo” and put a test message into the input field.
  5. Tried the other example

What am I doing wrong?

You need to use an entity_id in the target. Are you doing that?

I tried all possible options:

service: notify.alexa_media
data:
message: test
target: AB72C64C86AW2
data:
type: tts

And with the entity name after notify

service: notify.alexa_media_echo
data:
message: test
target: AB72C64C86AW2
data:
type: tts

Also the target with the friendly name:

service: notify.alexa_media
data:
message: test
target: alexa_media_echo
data:
type: tts

And this:

service: notify.alexa_media_echo
data:
message: test
target: alexa_media_echo
data:
type: tts

And all without the data tts

None of those are entity_ids… do you know what an entity_id is?

You are right, the entity_id is media_player.echo

But this as a target does not work either:

service: notify.alexa_media
data:
message: test
target: media_player.echo
data:
type: tts

service: notify.alexa_media_echo
data:
message: test
target: media_player.echo
data:
type: tts

it needs to be formatted properly, and the notification service will have a specific name. notify.alexa_media_echo is not that name, it’s notify.alexa_media.

service: notify.alexa_media
data:
  message: test
  target: media_player.echo
  data:
    type: tts
1 Like

Thanks Pedro, this is not working either.
But I saw as well, that my Echo is no longer available (for no obvious reason).

Petro

You’ll have to check the logs to verify that alexa media player integration is still working.

1 Like

Thanks Petro :slight_smile:
It is working now, I removed my account in the alexa media configuration and on the retest it worked immediately.

Thanks a lot!

1 Like