Wildcarding / Loops in a template sensor?

Like many, im not keen on the way the device tracker displays devices as home or not_home

So to make things prettier, I made a template sensor that displays connected or offline…but I obviously have to create 1 sensor for each device_tracker entity, I do this as follows:

- platform: template
        friendly_name: 'Pi-Hole'
        value_template: "{{ 'Connected' if is_state('device_tracker.rpi_pihole', 'home') else 'Offline' }}"
        friendly_name: 'Rich Laptop'
        value_template: "{{ 'Connected' if is_state('device_tracker.richlaptop', 'home') else 'Offline' }}"
        friendly_name: 'Sony TV'
        value_template: "{{ 'Connected' if is_state('device_tracker.sony_braviatv', 'home') else 'Offline' }}"

This feels sloppy…is there a cleaner easier way to achieve this? It just doesn’t seem very elegant?
Can one use wild cards to loop through device_tracker.* and create a unique sensor for each match?
I have tried this custom component by @abmantis, which works great, but displays on or off…and as I understand cannot be changed as it is a binary sensor.