Script !include file.yaml possible?

Hi everyone,

I am tryng to copy speech_engine Home-AssistantConfig/speech_engine.yaml at master · CCOSTAN/Home-AssistantConfig · GitHub . I copied the script (after removing all conditions) but landed into an error. I tried to message author on twitter with no success.

when i am testing it, i am getting the following error.

I think this is related to the following line in the script.
speech_message: !include ../templates/speech/briefing.yaml

I have this file added in the main config folder as reference by the author. When I am trying to add this line in my script, I am unable to save the script and unable to test it. this is why i am probably seeing the error.

Any suggestions how to include the file with yaml extensions in the script please. Any pointer will be highly appreciated.

Thank you in advance.

Could you make a better screenshot of the error?

Use Windows key + Shift + S and then mark the area you want to screenshot.
Then make a post here and use CTRL + V to insert the screenshot.

Hi, thank you for your reply… here is a screenshot of the message.

I think this is to do statement “speech_message: !include …/templates/speech/briefing.yaml” in the script. in one of Author video, he mentioned he have not updated his HA from 2021.11 yet.

I guess update made from 2021.11 onward probably changed ways of refering to yaml in the script. I checked the formatting of the code in Visual studio and found no issue. from the message, it is looks like issue with defining variables ?

I think that should still work, but try to place your briefing.yaml in the same folder as your configuration.yaml
Then set the include to just ./briefing.yaml or maybe even just briefing.yaml

Also be sure to not use capital letters.
Linux is case sensitive in its filesystem opposite Windows, so Briefing.yaml will be different from briefing.yaml.
In general HA is not happy with capital letters in anything but friendly names.

Thank you for the suggestinos. i copied the author code and updated script via file edit. I followed your advise and pased file “briefing.yaml”. I used speech_message: !include briefing.yaml and it worked.

I then started looking into way author was referring to the file location. I updated author code as speech_message: !include ./templates/speech/briefing.yaml (with one dot) and it worked so i think the author used three dots when referring to the file loccation which was actually causing the error.
Issue is now resolved. Thanks for your hints and suggest. appreciate it.

Three dots is not valid.
One dot means current folder and will in nearly all cases be the same as not using ./ in the beginning.
Two dots mean the parent folder, ie. go one folder up in the folder tree.
And finally a slash means the root. This can the root of the drive, but the root can also be programmatically set, so the root is another folder. A programmatically set root is often used on web servers, so a slash only refer to the root of that web site.