Amazon Polly- "SSL: Wrong Version Number"

I would appreciate any assistance here…

My configuration.yaml:

tts:
  - platform: amazon_polly
    aws_access_key_id: !secret aws_access_key_id
    aws_secret_access_key: !secret aws_secret_access_key
    text_type: ssml
    voice: Arthur
    cache: True
    engine: neural

My script:

alias: Polly Test
sequence:
  - service: tts.amazon_polly_say
    data:
      cache: false
      entity_id: media_player.stephen
      message: |
        <speak>
          Hello from Polly
        </speak>
mode: single
icon: mdi:speaker-wireless

On my first run of the script, I get:
“To send TTS set public URL in integration configuration.”

OK, so I go to Devices & Services->Alexa Media Player->CONFIGURE and enter my Nabu Casa Remote address:
https://123456789sjp7k6rycizipuXXXXXXXXXX.ui.nabu.casa
(Significant obfuscation).

Now I get:
Failed to call service script/polly_test. <urlopen error [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1000)>

The URL I use is the same one that I connect to my Home Assistant when away.

Any tips please?

I believe you need the region.

  - platform: amazon_polly
    aws_access_key_id: *
    aws_secret_access_key: *
    region_name: 'us-east-1'
    text_type: ssml
    voice: Amy
    cache: true
    engine: neural

Same error after adding region_name.

There are different versions of SSL, like SSL 1.1, SSL 2.0, TLS 1.2, TLS 1.3 and so on.
Some of these are today considered insecure, so some sites will deactivate these versions.
This can lead to a situation where a client not being updated with the more recent versions and therefore ending up in a situation where the client do not have a version that the server consider secure and a SSL connection will therefore not be possible.

See section 2.2 herr.

PS: The versions numbers of the SSL given above are most likely wrong.
I could not remember any of the ones before TLS 1.2, so I just made some up to give an idea.

I appreciate the information, but that doesn’t help me use the Alexa Media Player integration.

True.
I do not use the services, so I can not help you with a way to fix it.
I can only help you pinpoint the problem. Others might be to help you with that extra info, I hope.

Thanks for trying. I don’t think the issue is specific to the integration, but running this integration is where it first presents.

I don’t have ssl_certificate or ssl_key in my configuration YAML file. I don’t recall why I removed them. (Maybe when I subscribed to Nabu Casa?)

I don’t recall needing SSL at HA for Alexa Media Player.
Anyway in the UI->Developers Tools->Services try out one of your Alexa devices like the following:

service: notify.alexa_media
data: 
          message: This is a test
          target: media_player.stephen
          data:
            type: tts

Thanks, that does work. In fact I use notify.alexa_media in other automations, but I want to be able to use SSML from Polly.

As far as I know, that is not possible.

You may be able to use Chime TTS to get it to work. If you have polly working, it should be possible with Chime TTS.

It’s a core integration.
Amazon Polly - Home Assistant (home-assistant.io)

The last update to GitHub was three days ago.

I will have to try the chime tts integration. It looks similar enough to Polly for what I need.

Yeah, I know about Polly. I use it myself. I just dont think its possible to do TTS to an Echo.
Chime TTS, Im sure its possible due to the way it works.

I played around with Alexa Media Player and Amazon’s Poly SSML a few years ago, so I brushed off my notes and tried a few things, and it appears to work with perhaps some limitations of some tags I couldn’t get to work, but here is an example of something I did get to work [Poly Reference]:

service: notify.alexa_media
data: 
  message: >
    <lang xml:lang="fr-FR">
    <voice name='Celine'>
    Je ne parle pas français.
    </voice>/</lang>
  data: 
    type: "announce"
  target: "media_player.kitchen_echo"

Another thing too, is it may not be possible to use HA’s Poly platform with Alexa Media Player. I’m not entirely sure this is correct, but I understand that the HA Poly platform will produce an audio file and then hand it to the media player to play. Alexa Media Player doesn’t so easily play audio files locally, so again not sure it would even work.

Thanks for the example. I’ll give it a try. But my problem seems to be with SSL.

I installed the chime tts integration and for the first time in many, many, many months. (Maybe the first time ever) And Home Assistant went belly-up. I resorted to going to the basement to reboot the host computer.

Twice.

Can you please guide me to a simple test to see if Chime will even work here?

You may be better off checking out teh official thread. I dont use Echo’s, so Im unfamiliar with what is needed.