From e32717db89d8a51fd0476cc753e661b2e7d5a9fe Mon Sep 17 00:00:00 2001 From: tschmidty69 Date: Sun, 14 Jan 2018 15:18:14 -0500 Subject: [PATCH] Snips say and say_action services (new) (#4399) * Update media_player.markdown * Update media_player.markdown * Update snips.markdown * Update media_player.markdown * Update snips.markdown --- source/_components/media_player.markdown | 4 +- source/_components/snips.markdown | 58 ++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/source/_components/media_player.markdown b/source/_components/media_player.markdown index 5e19cf34e9c..62c1af3a4cc 100644 --- a/source/_components/media_player.markdown +++ b/source/_components/media_player.markdown @@ -14,7 +14,7 @@ Interacts with media players on your network. Please check the sidebar for a ful ## {% linkable_title Services %} ### {% linkable_title Media control services %} -Available services: `turn_on`, `turn_off`, `toggle`, `volume_up`, `volume_down`, `media_play_pause`, `media_play`, `media_pause`, `media_stop`, `media_next_track`, `media_previous_track`, `clear_playlist` +Available services: `turn_on`, `turn_off`, `toggle`, `volume_up`, `volume_down`, `volume_set`, `media_play_pause`, `media_play`, `media_pause`, `media_stop`, `media_next_track`, `media_previous_track`, `clear_playlist`, `shuffle_set` | Service data attribute | Optional | Description | | ---------------------- | -------- | ------------------------------------------------ | @@ -63,6 +63,6 @@ Currently only supported on [Spotify](/components/media_player.spotify/), [MPD]( | Service data attribute | Optional | Description | | ---------------------- | -------- | ---------------------------------------------------- | | `entity_id` | no | Target a specific media player. For example `media_player.spotify`| -| `shuffle` | no | `true`/`false` for enabling/disabling shuffle | +| `shuffle` | no | `true`/`false` for enabling/disabling shuffle | diff --git a/source/_components/snips.markdown b/source/_components/snips.markdown index 642faabf93d..1e8dae2e052 100644 --- a/source/_components/snips.markdown +++ b/source/_components/snips.markdown @@ -171,3 +171,61 @@ SetTimer: ``` {% endraw %} +### Sending TTS Notifications + +You can send TTS notifications to Snips using the snips.say and snips.say_action services. Say_action starts a session and waits for user response, "Would you like me to close the garage door?", "Yes, close the garage door". + +#### {% linkable_title Service `snips/say` %} + +| Service data attribute | Optional | Description | +|------------------------|----------|--------------------------------------------------------| +| `text` | no | Text to say. | +| `site_id` | yes | Site to use to start session. | +| `custom_data` | yes | custom data that will be included with all messages in this session. | + +#### {% linkable_title Service `snips/say_action` %} + +| Service data attribute | Optional | Description | +|------------------------|----------|--------------------------------------------------------| +| `text` | no | Text to say. | +| `site_id` | yes | Site to use to start session. | +| `custom_data` | yes | custom data that will be included with all messages in this session. | +| `can_be_enqueued` | yes | If True, session waits for an open session to end, if False session is dropped if one is running. | +| `intent_filter` | yes | Array of Strings - A list of intents names to restrict the NLU resolution to on the first query. | + +#### Configuration Examples + +```yaml +script: + turn_on_light: + sequence: + service: script.turn_on_light + service: snips.say + data: + text: 'OK, the light is now on' + +automation: + query_garage_door: + trigger: + - platform: state + entity_id: binary_sensor.my_garage_door_sensor + from: 'off' + to: 'on' + for: + minutes: 10 + sequence: + service: snips.say_action + data: + text: 'Garage door has been open 10 minutes, would you like me to close it?' + intentFilter: + - closeGarageDoor + +# This intent is fired if the user responds with the appropriate intent after the above notification +intent_script: + closeGarageDoor: + speech: + type: plain + text: 'OK, closing the garage door' + action: + - service: script.garage_door_close +```