Skip to content

Intent scripts run in single mode, which prevent an intent from calling itself #102199

@tetele

Description

@tetele

The problem

I'm trying to create a custom intent for chaining commands (e.g. do this, then do that and then do something else). The way I go about this is to create sentences like {sentence_1} and [then] {other_sentences}, which get to a custom intent that does conversation.process sentence_1 and then conversation.process other_sentences, which might also be a chain.

All works well, except that in this case, the custom intent script fails to run for 3 or more sentences in the chain because it's Already running. The code says that the intent script runs in the default single mode.

What version of Home Assistant Core has the issue?

core-2023.10.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

intent_script

Link to integration documentation on our website

https://www.home-assistant.io/integrations/intent_script/

Diagnostics information

No response

Example YAML snippet

intent_script:
  ConcatenatedSentences:
    speech:
      text: OK
    async_action: true
    action:
      - service: conversation.process
        data:
          agent_id: homeassistant
          text: "{{ sentence_1 }}"
          language: "{{ language }}"
      - service: conversation.process
        data:
          agent_id: homeassistant
          text: "{{ other_sentences }}"
          language: "{{ language }}"

Anything in the logs that might be useful for us?

Logger: homeassistant.helpers.script.intent_script_concatenatedsentences
Source: helpers/script.py:1783
First occurred: October 17, 2023 at 2:29:01 PM (3 occurrences)
Last logged: October 17, 2023 at 2:45:05 PM

Intent Script ConcatenatedSentences: Already running

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions