Is it possible to pass a template to a rest_command? This doesn’t work, but shows the intent:
service: rest_command.rhasspy_speak
data_template: >-
"Today is {{ now().strftime("%A") }} the {{ now().strftime("%-d")}} {{ now().strftime("%B") }} {{ now().strftime("%y") }}"
I formerly used the Hermes Session controller, but rhasspy will no longer let me use an external MQTT. Doing so breaks the microphone input on rhasspy. I can use the internal MQTT to pass events to HA, but now need to use rhasspy speak to get speech back. Is there a way to use a template with rhasspy speak? Thanks.
Thank you for the prompt response. Here is the automation now:
service: rest_command.rhasspy_speak
data:
payload_template: >-
Today is {{ now().strftime("%A") }} the {{ now().strftime("%-d")}} {{
now().strftime("%B") }} {{ now().strftime("%y") }}
Trace says that the payload parses correctly, but rhasspy is silent. It plays the wakeup sound, so audio output is okay. here is the config for the rest command:
where 192.168.0.130 is the IP for the pi that rhasspy is running on. HA is at 192.168.0.109. Do you see anything wrong with the automation or the config?
and then in my HA automation I have a time trigger that I was just using to test if it would work. obviously use whatever trigger you wanted. note that even though yaml for rest_command has ‘payload’ when i use it in automation yaml it’s ‘payload_data’. You seem to be using ‘payload’ when maybe it should be ‘payload_template’ in your rest_command since that’s what you call it in the automation. hope that helps
alias: rhasspy_send_text_for_speech
description: ''
trigger:
- platform: time
at: '00:00:00'
condition: []
action:
- data_template:
ipnum: http://192.168.1.134:12101
payload_data: hello from home assistant
service: rest_command.rhasspy_speak
mode: single