No TTS via Rhasspy w/REST API

I’m not receiving output from my speaker when I test the a rest_command.tts service through hassio.

image

my configuration.yml is as follows:

rest_command:
  tts:
    url: http://192.168.0.n:12101/api/text-to-speech
    method: POST
    payload: '{{ payload }}'
    headers:
      content_type: 'text/plain'

The logs on my rhasspy are:

[INFO:78300838] quart.serving: 192.168.0.n:34294 POST /api/text-to-speech 1.1 200 0 319763
[DEBUG:78300826] InboxActor:  -> stopped
[DEBUG:78300823] EspeakSentenceSpeaker: speaking -> ready
[DEBUG:78300624] APlayAudioPlayer: ['aplay', '-q', '-D', 'sysdefault:CARD=sndrpigooglevoi']
[DEBUG:78300622] EspeakSentenceSpeaker: ready -> speaking
[DEBUG:78300525] EspeakSentenceSpeaker: ['espeak', '-v', 'en', '--stdout', '']

However running the following curl command works
curl -X POST -d "hi world" http://192.168.0.n:12101/api/text-to-speech

The logs on my rhasspy are:

[INFO:78777418] quart.serving: 192.168.0.20:57326 POST /api/text-to-speech 1.1 200 8 1257370
[DEBUG:78777402] InboxActor:  -> stopped
[DEBUG:78777398] EspeakSentenceSpeaker: speaking -> ready
[DEBUG:78776315] APlayAudioPlayer: ['aplay', '-q', '-D', 'sysdefault:CARD=sndrpigooglevoi']
[DEBUG:78776311] EspeakSentenceSpeaker: ready -> speaking
[INFO:78776211] quart.serving: 172.17.0.1:60340 GET /api/events/log 1.1 101 - 101697175
[DEBUG:78776166] EspeakSentenceSpeaker: ['espeak', '-v', 'en', '--stdout', 'hi world']

I had the same problem. Finally solved it, using this post as inspiration:

https://community.home-assistant.io/t/solved-send-command-from-ha-to-rhasspy/180704

The service data should not be:

{message: 'hello world'}

but

{payload: "hello world"}

As an example, this automation should notify you via Rhasspy of the hour, every hour. Works on my configuration.

- id: hourlynotification
  alias: hourly notification
  trigger:
  - minutes: '0'
    platform: time_pattern
  action:
  - data_template:
      payload: '{{ now().hour }}'
    service: rest_command.tts
1 Like