Alexa Notify Text to Speech syntax

Hi,
I’ve installed https://github.com/custom-components/alexa_media_player/

I’m trying to do TTS and receive the error below.

2020-06-20 09:36:22 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.240165373216230] 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1295, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/notify/__init__.py", line 119, in async_notify_message
    await notify_service.async_send_message(**kwargs)
  File "/config/custom_components/alexa_media/notify.py", line 189, in async_send_message
    if data["type"] == "tts":
TypeError: 'NoneType' object is not subscriptable

Been trying this for a few hours myself, then I actually decided to read the Wiki :man_facepalming:

You need to call the notify.alexa_media service and then you can get TTS to work. My example configuration, pretty much copied from the Wiki…

tts_issue

I hope this helps you (or anyone else who comes across this post like I did!)

This helped with syntax and I tried this but nothing happens and I don’t get any errors, any ideas how I can debug what is happening?

Thanks

Only things I can suggest would be to:

  • Ensure that the volume is high enough on the device in question (I only say this as I had issues with this at one point!)
  • Ensure that you’ve set the correct media player
  • Perhaps try ‘Announce’ instead of TTS, just to see if it’s an issue with TTS for some reason. Or even better try ‘Mobile Push’ to just make sure that Alexa / Amazon is actually receiving the request from HA

Failing all of that then you can see on the Wiki that you’re able to enable logging to debug the issue

I hope this helps :slight_smile:

1 Like