Alexa speech to text (STT) and send string variable with Kodi Input.SendText

Hello. I am trying to setup a way to say a movie title to Alexa and have that stored as a HA variable and sent to Kodi via JSON RPC Input.SendText,

example, Alexa type on bedroom kodi, “Movie Title”

I have the rest_command and script setup to send text to Kodi and that is working when triggered manually, but I haven’t figured out a way to do the STT part.

I’m thinking if I could have HA convert the “Movie Title” as said to a text variable and input that into the script text:, it would work. Is this possible? Can anyone assist? Thank you!

rest_command:
  send_text_to_brkodi:
    url: "http://192.168.x.x:8080/jsonrpc"
    method: "post"
    headers:
      content-type: "application/json"
    payload: '{"jsonrpc": "2.0", "method": "Input.SendText", "params": {"text": "{{ text }}"}, "id": 1}'

alias: Send Text to Bedroom Kodi
sequence:
  - service: rest_command.send_text_to_brkodi
    data:
      text: Movie Title
1 Like

Hi, I’m working on this too and just succeeded by following the guide above.