#The automation run failed, only responding with "Done"

1 messages · Page 1 of 1 (latest)

thorn temple
#

I have an automation that triggers the MA media playback service based on a sentence, and it only responds with "Done" when it fails to run. Is it possible to customize the response during runtime errors, instead of just responding with "Done"? I hope someone can give me some hints. Thanks

#
  - trigger: conversation
    command:
      - (play){query}
      - "{area}(play){query}"
conditions: []
actions:
  - action: conversation.process
    metadata: {}
    data:
      agent_id: conversation.qwen2_5_7b_2
      text: "{{ trigger.slots.query }}"
    response_variable: result
    enabled: true
  - action: conversation.process
    metadata: {}
    data:
      text: "{{ trigger.slots.area }}"
      agent_id: conversation.qwen2_5_7b_3
    response_variable: area_result
  - if:
      - condition: template
        value_template: "{{ trigger.slots.area is defined and trigger.slots.area|trim != '' }}"
    then:
      - action: music_assistant.play_media
        data:
          media_id: "{{ result.response.speech.plain.speech }}"
        target:
          area_id: "{{ area_result.response.speech.plain.speech }}"
      - set_conversation_response: |-
          {{ 
            "in" ~ trigger.slots.area ~ "play"
          }}
    else:
      - action: music_assistant.play_media
        data:
          media_id: "{{ result.response.speech.plain.speech }}"
        target:
          entity_id: media_player.er_tong_fang_yin_le_bo_fang_qi
      - set_conversation_response: |-
          {{ 
            "in" ~ state_attr('media_player.er_tong_fang_yin_le_bo_fang_qi', 'friendly_name')
            ~"play" ~ state_attr('media_player.er_tong_fang_yin_le_bo_fang_qi', 'media_artist')
            ~"the" ~ state_attr('media_player.er_tong_fang_yin_le_bo_fang_qi', 'media_title')
          }}
elfin raven
#
  - action: conversation.process
    metadata: {}
    data:
      text: "{{ trigger.slots.area }}"
      agent_id: conversation.qwen2_5_7b_3
#

if that is your automation, it will fail on this step

#

you don't have an area slot in your sentences, so {{ trigger.slots.area }} will return an error which will stop your automation from further processing

#

put that action after the if statement, if you plan to include area in your sentences