Alexa_confirm.yaml in root folder

I have a file alexa_confirm.yaml with different answers for her, this file is in my config root.

I use

alexa:
  intents: !include_dir_merge_named alexa/

to structure my code. That works great as it does for automation, scripts and so on. But here is my problem, inside one of the subfolder one of the Alexa intent use the Alexa_confirm.yaml and is search for it in its own folder. But the file is in config root. So how can i use that file without copying this file in every subfolder?

I include my confirm file in the intent itself:

#
# Alexa Integration
#
alexa:
  intents:
    ActivateSceneIntent:
      speech:
        type: plaintext
        text: !include alexa_confirm.yaml
      action:
        service: scene.turn_on
        data_template:
          entity_id: scene.{{ Scene | replace(" ", "_") }}

    QueryLockIntent:
      speech:
        type: plaintext
        text: >
          {% if is_state('lock.front_door', 'locked') %}
            the door is locked Robert
          {% else %}
            the door is unlocked Robert
          {% endif %}

Thats not what i want, i have a lot or growing Alexa intent list and for structuring i want to have them in single files. That works great, but i do not want just “ok” as answer i want her to choose randomly from a list. And this list i add with Alexa_confirm.yaml like here.

RunScriptIntent:
  action:
    - service: notify.Wohnung
      data_template:
        message: Starte Script {{ Script }} durch Alexa
    - service: script.turn_on
      data_template:
        entity_id: script.{{ Script | replace(" ", "_") }}
  speech:
    type: plaintext
    text: !include alexa_confirm.yaml

But this file is in my config folder, but the file the code comes from is in Alexa/start/RunScriptIntent.yaml, so it can not see that file if i do not copy it into the same folder. But i do not want to move the file instead i am looking for a way to use it from config root so i can use the same file for all my Alexa intent where i want without copy it to every subfolder.

Just use a path in the include.

But be advised that there is currently an issue with using random in scripts so until that gets fixed, you’re only going to get one response until you restart HA and then it will use a new response from the list for everything.

Just do a normal path…you can go up one folder with “…/”

~Cheers

1 Like

thx, i tried that yesterday and it was not working, but it was just to late maybe.

I tried it with this

../../!include alexa_confirm.yaml

And that is absolutely wrong, after changing to

!include ../../alexa_confirm.yaml

it´s working. :slight_smile:

1 Like

Thanks for coming back and confirming :slight_smile:

~Cheers