Home Assistant doesn’t currently support the use of variables in a Template Trigger.
If you would like this ability to be added, please consider voting for: