Device actions do not support templating. Use the light turn on service call if you want to use templates.
You should avoid device automations altogether.