How to select an Assist Satellite in Home Assistant scripts?

Hi everyone,

I’m trying to dynamically select an assist satellite in my Home Assistant script and then use it with the assist_satellite.ask_question action.

My goal is to have a selector in the script editor to choose the specific assist satellite that should ask a question. Here’s what I’ve tried:

Something like this:

sequence:
  - action: assist_satellite.ask_question
    metadata: {}
    data:
      question: Shall I play A?
      preannounce: true
      entity_id: {{ assist_satellite }}
      answers:
        - id: "yes"
          sentences:
            - "yes"
    response_variable: answer
fields:
  assist_satellite:
    selector:
      select:
        options:
          - assist_satellite.home_assistant_voice_091713_assist_satellit
          - assist_satellite.home_assistant_voice_053425_assist_satellit
    name: assist_satellite
alias: test - entity selector
description: ""

The problem is that the select option in my fields section returns a string (e.g., assist_satellite.home_assistant_voice_091713_assist_satellit), but the assist_satellite.ask_question action seems to expect an entity object or a specific format for the entity_id that I can’t quite figure out.

I’m struggling to get this to work correctly. Does anyone have an idea how to properly pass the selected assist satellite entity to the action, perhaps by converting the string to the expected object format, or is there a different approach I should take?

Hi @reisueber

I’m not sure if this will solve your problem but, one issue is that you need quotes around your template:

entity_id: "{{ assist_satellite }}"
1 Like

Thanks a lot for your help! The solution was indeed to add quotes around the template, so entity_id: "{{ assist_satellite }}" did the trick.

1 Like

i use this script for exactly that

alias: Test - seleccionar satélite
description: ""
fields:
  assist_satellite:
    name: Satélite a usar
    selector:
      entity:
        domain: assist_satellite

sequence:
  - service: assist_satellite.ask_question
    data:
      entity_id: "{{ assist_satellite }}"
      question: "¿Reproducir A?"
      preannounce: true
      answers:
        - id: "yes"
          sentences:
            - "sí"
        - id: "no"
          sentences:
            - "no"
    response_variable: answer

  - choose:
      - conditions:
          - condition: template
            value_template: "{{ answer.id == 'yes' }}"
        sequence:
          - service: notify.notify
            data:
              message: "Respondió que SÍ"
      - conditions:
          - condition: template
            value_template: "{{ answer.id == 'no' }}"
        sequence:
          - service: notify.notify
            data:
              message: "Respondió que NO"
mode: single