Skip to content

Commit cdadee5

Browse files
jeliassonfabaff
authored andcommitted
More documentation on Amazon Polly Component (home-assistant#2242)
* More documentation on Amazon Polly Component * Fixing indent and example
1 parent 1fe29cf commit cdadee5

File tree

1 file changed

+51
-6
lines changed

1 file changed

+51
-6
lines changed

source/_components/tts.amazon_polly.markdown

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ha_release: 0.37
1515
The `amazon_polly` text-to-speech platform that works with [Amazon Polly](https://aws.amazon.com/polly/) to create the spoken output.
1616
Polly is a paid service via Amazon Web Services. There is a [free tier](https://aws.amazon.com/polly/pricing/) for the first 12 months and then a charge per million characters afterwards.
1717

18-
To enable text-to-speech with Amazon Polly, add the following lines to your `configuration.yaml`:
18+
To get started, add the following lines to your `configuration.yaml` (example for Amazon Polly):
1919

2020
```yaml
2121
# Example configuration.yaml entry
@@ -29,9 +29,54 @@ tts:
2929
3030
Configuration variables:
3131
32-
- **aws_access_key_id** (*Required if aws_secret_access_key is provided*): Your AWS Access Key ID. For more information, please read the [AWS General Reference regarding Security Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html). If provided, you must also provide an `aws_secret_access_key` and must **not** provide a `profile_name`.
33-
- **aws_secret_access_key** (*Required if aws_access_key_id is provided*): Your AWS Secret Access Key. For more information, please read the [AWS General Reference regarding Security Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html). If provided, you must also provide an `aws_access_key_id` and must **not** provide a `profile_name`.
34-
- **profile_name** (*Optional*): A credentials profile name. For more information, please see the [boto3 documentation section about credentials](http://boto3.readthedocs.io/en/latest/guide/configuration.html#shared-credentials-file).
35-
- **region_name** (*Required*): The region identifier to connect to. The default is `us-east-1`.
36-
- **name** (*Optional*): Setting the optional parameter `name` allows multiple notifiers to be created. The default value is `notify`. The notifier will bind to the service `notify.NOTIFIER_NAME`.
32+
| Parameter | Value | Description |
33+
|---------------------|----------|-------------|
34+
| `aws_access_key_id` | Required | Your AWS Access Key ID. For more information, please read the [AWS General Reference regarding Security Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html). If provided, you must also provide an `aws_secret_access_key` and must **not** provide a `profile_name` |
35+
| `aws_secret_access_key` | Required | Your AWS Secret Access Key. For more information, please read the [AWS General Reference regarding Security Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html). If provided, you must also provide an `aws_access_key_id` and must **not** provide a `profile_name`. |
36+
| `profile_name` | Optional | A credentials profile name. For more information, please see the [boto3 |
37+
| `region_name` | Optional | The region identifier to connect to. The default is `us-east-1`. |
38+
| `name` | Optional | Setting the optional parameter `name` allows multiple notifiers to be created. The default value is `notify`. The notifier will bind to the service `notify.NOTIFIER_NAME`.
39+
|
40+
| `text_type` | text/ssml | text or ssml: Specify wherever to use text (default) or ssml markup |
3741

42+
## Usage
43+
Say to all `media_player` device entities:
44+
```yaml
45+
- service: tts.amazon_polly_say
46+
data_template:
47+
message: '<speak>Hello from Amazon Polly</speak>'
48+
```
49+
or
50+
```yaml
51+
- service: tts.amazon_polly_say
52+
data_template:
53+
message: >
54+
<speak>
55+
Hello from Amazon Polly
56+
</speak>
57+
```
58+
59+
Say to the `media_player.living_room` device entity:
60+
61+
```yaml
62+
- service: tts.amazon_polly_say
63+
data_template:
64+
entity_id: media_player.living_room
65+
message: >
66+
<speak>
67+
Hello from Amazon Polly
68+
</speak>
69+
```
70+
71+
Say with break:
72+
73+
```yaml
74+
- service: tts.amazon_polly_say
75+
data_template:
76+
message: >
77+
<speak>
78+
Hello from
79+
<break time=".9s" />
80+
Amazon Polly
81+
</speak>
82+
```

0 commit comments

Comments
 (0)