Hello maciejmiklas,
The correct syntax to make this work is use an entity condition not a device condition. Device actions do not accept templates for the most part.