The following action is triggered when the conditions are right. It plays an audio file to announce the shutdown. At exactly 2 seconds and 890 milliseconds into the audio file, there is a sound that represents the actual shutdown event, which is a light turning off. My idea was to synchronize the switch.turn_off event with the audio file at the exact point I need it to be.
After removing the delay, it still seems that the switch action waits until the audio file has completed. I’m wondering if there’s a way to overlap the two events so the lights are triggered to turn off as the audio file reaches a certain point on the timeline.
action:
- service: shell_command.initiating_shutdown_sequence
- delay:
milliseconds: 2890
- service: switch.turn_off
entity_id: switch.entertainment_center