Trouble getting tts to work on Voice PE

I recently got a Voice PE device and I am playing with tts - with limited results. I have it working with NodeRed (as a HA add-on) but I am having mixed results with automations and scripts. I have Nabu Casa, fwiw. The following script speaks over the Voice device:

sequence:
  - action: tts.speak
    metadata: {}
    data:
      cache: true
      media_player_entity_id: media_player.home_assistant_voice_099f4a_media_player
      message: Well, see how this works.
    target:
      entity_id: tts.home_assistant_cloud
alias: test tts
description: ""

The following automation toggles the light bu doesn’t make a sound on the Voice device:

alias: Jarvis - test
description: ""
triggers:
  - trigger: conversation
    command: This is a test
conditions: []
actions:
  - action: light.toggle
    metadata: {}
    data: {}
    target:
      entity_id: light.study_light
  - action: tts.speak
    metadata: {}
    data:
      cache: false
      media_player_entity_id: media_player.home_assistant_voice_099f4a_media_player
      message: Well, see how this works.
    target:
      entity_id: tts.home_assistant_cloud
mode: single

I feel like I’m missing something obvious, but it eludes me so far…

Hi

simply use conversation response in action

actions:
  - set_conversation_response: Well, see how this works.

Have you tried a custom sentence and an intent script?

Sentence…

language: "en"
intents:
  CustomTest:
    data:
      - sentences:
          - "This is a test"

…and intent script

intent_script:
  CustomTest:
    speech:
      text: Well, see how this works
    action: light.toggle
    target:
      entity_id: light.study_light

Edit: Don’t forget that there is a growing number of built-in sentences for which you don’t need to set up anything - just expose the entity to Assist, with a few aliases if required. Turn on/off is certainly among them.

Thanks - that helped. Unfortunately the documentation for tts.speak doesn’t make it clear that it shouldn’t be used when it’s in reply to a triggered sentence - at least not that I found.