Amazon Polly AccessDeniedException and changing voice

Hey!

Anyone who got Amazon Polly working can help me out?

I made a free 1year account, a group with something S3 access then added a new user to that group.
I got the AWS access id and AWS secret access key in my HASS config.yaml

This is the error its giving me:

ERROR (MainThread) [homeassistant.components.tts] Error setting up platform amazon_polly
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/tts/__init__.py", line 116, in async_setup_platform
    None, platform.get_engine, hass, p_config)
  File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/tts/amazon_polly.py", line 119, in get_engine
    all_voices_req = polly_client.describe_voices()
  File "/home/falkaub/.homeassistant/deps/botocore/client.py", line 251, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/home/falkaub/.homeassistant/deps/botocore/client.py", line 537, in _make_api_call
    raise ClientError(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (AccessDeniedException) when calling the DescribeVoices operation: User: arn:aws:iam::gfrandomhfghsfghsfhg044:user/HASS is not authorized to perform: polly:DescribeVoices

"AccessDeniedException" and “user/HASS is not authorized to perform: polly:DescribeVoices” is the problem, how to fix it? :slight_smile:

Also is there a way to change Polly voice in HASS?

I got it working yesterday with no issue, just copy my credentials from AWS. I got the credentials here

https://console.aws.amazon.com/iam/home?#/security_credential

in this section.

Access Keys (Access Key ID and Secret Access Key)

2 Likes

Yeah… Your link pointed to the right page. The Polly docs linking to some different things with users and groups.

Thank you!

Have you managed to change the voice in hass Polly?

I just successfully setup Amazon Polly and also would like to change the voice.
Seems like Joanna is the default voice but I like Sally more :slight_smile:

@GMFalka I did it, was pretty easy actually:

tts:
  - platform: amazon_polly
    aws_access_key_id: xxxxxxxxxx
    aws_secret_access_key: xxxxxxxxxx
    region_name: 'us-east-1'
    voice: Salli

Supported voices:

SUPPORTED_VOICES = ["Geraint", "Gwyneth", "Mads", "Naja", "Hans", "Marlene",
                    "Nicole", "Russell", "Amy", "Brian", "Emma", "Raveena",
                    "Ivy", "Joanna", "Joey", "Justin", "Kendra", "Kimberly",
                    "Salli", "Conchita", "Enrique", "Miguel", "Penelope",
                    "Chantal", "Celine", "Mathieu", "Dora", "Karl", "Carla",
                    "Giorgio", "Mizuki", "Liv", "Lotte", "Ruben", "Ewa",
                    "Jacek", "Jan", "Maja", "Ricardo", "Vitoria", "Cristiano",
                    "Ines", "Carmen", "Maxim", "Tatyana", "Astrid", "Filiz"]
2 Likes

Thank you Bob!

1 Like

Hey All, I try to get this working, but all I get is an error:

Failed to call service tts/amazon_polly_say. Invalid MultiSpec data: TextFrame(encoding=<Encoding.UTF8: 3>, text=['Salli'])

I tested my credentials, and they work.

Used example is:

message: >
      <speak>
          Hello from Amazon Polly
      </speak>