Pass string of text from Conversation input to intent scrpit

Hello again
I am trying to get my LEDCube connected to the Conversation section of Home Assistant. So far I have managed to get UDP sending to work by PyScript, and can send service calls through the developer to change its modes and text. However, I am lost when it comes to sending strings from voice to the service.

Currently, my custom sentence works on mode random as it is hard coded as seen here

language: "en"
intents:
  CustomLEDCubeMode:
    data:
      - sentences:
          - "Set LEDCube mode to random"

and my intent_script.yaml is as follows:

CustomLEDCubeMode:  # Intent type
    speech:
      text: Mode set
    action:
      service: pyscript.setmode
      data: 
        mode: "random"

What I want is away to replace “random” with a variable and have this pass from the command, through the intent and into the service mode field. I’ll need something similar when it comes to text passing as well.

Thank you for reading

language: "en"
intents:
  CustomLEDCubeMode:
    data:
      - sentences:
          - "Set LEDCube mode to {led_color}"
lists:
  led_color:
    values:
      - "random"
      - "red"
      - "blue"
CustomLEDCubeMode:  # Intent type
    speech:
      text: Mode set
    action:
      service: pyscript.setmode
      data: 
        mode: "{{ led_color }}"
1 Like

Thank you so much for this! I noticed this has{led_color} be a list of possibilities. Is there an equivalent for if I want it to just be the rest of the command as string? my other setting for the cube is “set LEDCube text to {whatever text is desired}”.