Icon Templating For Domain?

I am attempting to apply an icon template to an entire domain, device_tracker. I have a number of devices being tracked by my router, and I would like to display the icon conditionally based upon their home/away status. I cannot figure out how to do this; I have only been able to figure out how to do it for individual entities using the template sensor.