mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-12-10 13:05:27 -06:00
Alexa Devices - Add advanced markup details and examples (#40650)
Co-authored-by: Simone Chemelli <simone.chemelli@gmail.com>
This commit is contained in:
parent
bcd05edc6e
commit
d0681874ce
@ -74,10 +74,24 @@ Available actions: `notify.send_message`, `alexa_devices.send_sound`, `alexa_dev
|
||||
|
||||
Devices with appropriate functionality will have speak and announce notify entities created. These can be used as the target for the `notify.send_message` action.
|
||||
|
||||
| Data attribute | Optional | Description |
|
||||
| -------------- | -------- | ----------------------------------------- |
|
||||
| `message` | no | Text to be output (see below for advanced markup) |
|
||||
|
||||
{% tip %}
|
||||
When sending notifications to multiple devices, you may experience delays due to rate limiting by Amazon. You can avoid this by sending notifications to speaker groups created in Alexa.
|
||||
{% endtip %}
|
||||
|
||||
{% details "Advanced Message Markup" %}
|
||||
|
||||
Amazon provide markup to control not only what is said but how it is said and to add additional option such as pausing and playing certain audio clips. Details of this are covered in [Amazon's documentation](https://developer.amazon.com/en-US/docs/alexa/custom-skills/speech-synthesis-markup-language-ssml-reference.html) where there are lots of examples (just pass everything between the `<speak>` and `</speak>` elements into the `message` parameter of the action).
|
||||
|
||||
Audio files must meet certain criteria on size, bit and sample rates and must be served over HTTPS (see [documentation](https://developer.amazon.com/en-US/docs/alexa/custom-skills/speech-synthesis-markup-language-ssml-reference.html#audio) for full details). These restrictions make them fine for text and sound effects but you will not be able to play music this way.
|
||||
|
||||
Amazon provide a set of [sounds you can use](https://developer.amazon.com/en-US/docs/alexa/custom-skills/ask-soundlibrary.html) which contains the markup you will need for that clip.
|
||||
|
||||
{% enddetails %}
|
||||
|
||||
#### Action `alexa_devices.send_text_command`
|
||||
|
||||
This action essentially allows you to control Alexa using text commands rather than speech. You should be able to request anything you would via speech using this action.
|
||||
@ -143,6 +157,35 @@ data:
|
||||
device_id: 037d79c1af96c67ba57ebcae560fb18e
|
||||
```
|
||||
|
||||
### Using advanced markup in a notification
|
||||
|
||||
```yaml
|
||||
action: notify.send_message
|
||||
data:
|
||||
message: >
|
||||
Hello, lets have some examples.
|
||||
<amazon:emotion name="excited" intensity="medium"> This is me being mildly excited! </amazon:emotion>
|
||||
The farmer's dog was called <say-as interpret-as='spell-out'>bingo</say-as>.
|
||||
<prosody pitch='high'> I can sing high </prosody> <prosody pitch='low'> and I can sing low </prosody>
|
||||
target:
|
||||
entity_id: notify.study_dot_speak
|
||||
```
|
||||
|
||||
```yaml
|
||||
action: notify.send_message
|
||||
data:
|
||||
message: >
|
||||
Stop! <break time='3s'/> Hammer Time. Watch out
|
||||
<audio src="soundbank://soundlibrary/scifi/amzn_sfx_scifi_laser_gun_battle_01"/>
|
||||
Shields up! <audio src="soundbank://soundlibrary/scifi/amzn_sfx_scifi_shields_up_01" />
|
||||
<amazon:effect name="whispered">
|
||||
<prosody rate="x-slow"><prosody volume="loud">Enough now</prosody></prosody>
|
||||
</amazon:effect>
|
||||
target:
|
||||
entity_id: notify.study_dot_speak
|
||||
|
||||
```
|
||||
|
||||
## Data updates
|
||||
|
||||
This integration {% term polling polls %} data from the device every 30 seconds by default.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user