Can I get a spoken response in an automation? Automations seem to be the simplest way of adding routines to be triggered by voice. In a simple test I created this (which has no practical use except as a preliminary test). This works.
alias: Testing speech
description: I want this as a speech response to an action in Assist. Can't that be done?
trigger: []
condition: []
action:
- service: media_player.play_media
target:
entity_id: media_player.corner
data:
media_content_id: >-
media-source://tts/tts.piper?message=Home+Assistant+is+fine+today.+Thank+you+for+asking+Monkey&language=en-us&voice=en-us-lessac-low
media_content_type: provider
metadata:
title: Home Assistant is fine today. Thank you for asking Monkey
thumbnail: https://brands.home-assistant.io/_/tts/logo.png
media_class: app
children_media_class: null
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://tts
- media_content_type: provider
media_content_id: >-
media-source://tts/tts.piper?message=Home+Assistant+is+fine+today.+Thank+you+for+asking+Monkey&language=en-us&voice=en-us-lessac-low
mode: single
However, if I then add the following speech trigger for Assist, I get the error Message malformed: expected dict for dictionary value @ data[āevent_dataā]
Iāve tried adding quotes to the trigger string but that makes no difference. Is this just not possible, or is there something wrong with my syntax? The visual editor accepts it until itās time to save.
alias: Testing speech
description: I want this as a speech response to an action in Assist. Can't that be done?
trigger:
- platform: event
event_type: Conversation
event_data: How are you today
condition: []
action:
- service: media_player.play_media
target:
entity_id: media_player.corner
data:
media_content_id: >-
media-source://tts/tts.piper?message=Home+Assistant+is+fine+today.+Thank+you+for+asking+Monkey&language=en-us&voice=en-us-lessac-low
media_content_type: provider
metadata:
title: Home Assistant is fine today. Thank you for asking Monkey
thumbnail: https://brands.home-assistant.io/_/tts/logo.png
media_class: app
children_media_class: null
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://tts
- media_content_type: provider
media_content_id: >-
media-source://tts/tts.piper?message=Home+Assistant+is+fine+today.+Thank+you+for+asking+Monkey&language=en-us&voice=en-us-lessac-low
mode: single
Thanks.