Home Assistant to trigger an audio file when I say a command to google

Hi All,

I’m new to this, so please bare with me If I ask something stupid. I would like HA to trigger an audio file locally from the Pi, when I say something to google. Is this do-able or not?

Like if I say “Good Night” it should play some audio locally or from youtube.

Thanks for all your help in advance.

Setup your HA to work with Google Home.
Make a command line switch in HA that plays audio file when turned ON
Expose switch to Google home

Setup Command line switch from HA and manually switch to verify it work
Create “routine” in Google home app that turns on the switch when you say “Good night”