Generic sensor value template for like entities

I use this template sensor to display brightness level when the lamp is on:

- platform: template
  sensors:
    basement_tv_lamp_status:
      value_template: >-
        {% if (is_state('light.tv_lamp', 'on')) %}
        Brightness: {{ ( state_attr('light.tv_lamp', 'brightness') | int
              / 255 * 100 ) | int }} {{ '%' }}
        {% else %}
        {% endif %}

This works just fine, (thanks again to those who helped), but if I have ten bulbs, do I have to have a template sensor for each? Is there a way to create a ‘generic’ template sensor that can be applied to all?
Thanks