Templates in Actions

Can I use templates in my actions with the HA companion app? I want to create an action that shows the state of my guest mode switch, and when I press it, it toggles it. I want to be able to add it to my CarPlay so I have quick access to it if I forget to turn it on before we leave with a babysitter, etc.