I managed to make the following work:
In the configuration.yaml I have:
shell_command:
shalalakpop: afplay ~/Music/Shalalakpop.aif
ding_ding: afplay ~/Music/Ship_Bell.mp3
In my automation, I have this:
- alias: 'Test ECLS On'
trigger:
platform: state
entity_id: switch.entertainment_center
to: 'on'
condition:
action:
service: shell_command.ding_ding
- alias: 'Test ECLS Off'
trigger:
platform: state
entity_id: switch.entertainment_center
to: 'off'
condition:
action:
service: shell_command.shalalakpop
When I trigger the light switch, I get the first sound, and when I turn the light off, I get the second sound.
If I want to use an include for shell_command: like this:
shell_command: !include_dir_merge_list shell
Then I would need to put a file like sounds.yaml in the shell folder. When I do that, I’m unsure of the syntax for the sounds.yaml file and everything I’ve attempted leads to no shell commands being run.
For example, if I enter in sounds.yaml:
shalalakpop: afplay ~/Music/Shalalakpop.aif
ding_ding: afplay ~/Music/Ship_Bell.mp3
I would expect everything to work as it did when I had it all defined in the configuration.yaml file. Is my syntax incorrect?