mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-05-03 09:38:59 +00:00

* fix spelling errors * Update binary_sensor.xiaomi_aqara.markdown Reverts to previous revision before spell check. * Update tellstick.markdown Reverts to previous revision before spell check. * Update owntracks_two_mqtt_broker.markdown Reverts to previous revision before spell check. * Update cla_sign.html Reverts to previous revision before spell check. * Update credits.markdown Reverts to previous revision before spell check. * Update api.markdown Fixed spell checker changing noone to no one.
1.6 KiB
1.6 KiB
layout, title, description, date, sidebar, comments, sharing, footer, ha_category
layout | title | description | date | sidebar | comments | sharing | footer | ha_category |
---|---|---|---|---|---|---|---|---|
page | Sonos say script to speak with text-to-speech | Sonos say script to use text-to-speech with Sonos | 2017-01-18 00:00 | true | false | true | true | Automation Examples |
{% linkable_title Sonos say script to speak with text-to-speech %}
This script allows you to use TTS on Sonos.
script:
sonos_say:
alias: "Sonos TTS script"
sequence:
- service: media_player.sonos_snapshot
data_template:
entity_id: {% raw %}"{{ sonos_entity }}"{% endraw %}
- service: media_player.sonos_unjoin
data_template:
entity_id: {% raw %}"{{ sonos_entity }}"{% endraw %}
- service: media_player.volume_set
data_template:
entity_id: {% raw %}"{{ sonos_entity }}"{% endraw %}
volume_level: {% raw %}"{{ volume }}"{% endraw %}
- service: tts.voicerss_say
data_template:
entity_id: {% raw %}"{{ sonos_entity }}"{% endraw %}
message: {% raw %}"{{ message }}"{% endraw %}
- delay: {% raw %}"{{ delay }}"{% endraw %}
- service: media_player.sonos_restore
data_template:
entity_id: {% raw %}"{{ sonos_entity }}"{% endraw %}
We call this now with:
automation:
- alias: 'test'
trigger:
- platform: state
entity_id: input_boolean.mytest
action:
- service: script.sonos_say
data:
sonos_entity: media_player.office
volume: 0.5
message: 'Your husband coming home!'
delay: '00:00:05'