Create group for (un)availability of multiple devices

I’m trying to find a simple way to create a group which combines the availability status of multiple devices.

It should behave the same way a regular group does, but display the availability.

So - lets say I have 5 devices in that group - as long as one of them is available, the group should show “available” or “on” - or the other way around, the group should show “unavailable” or “off”, only if all devices are unavailable.

Is there a simple way to do that? - it should be simple, because the devices will probably change in future and I don’t want to have to edit dozens of template sensors every time they do … it should be as simple as dragging it from one group to another :wink:

OK, I figured it out - much easier than I initially feared it would be - just one template sensor necessary:

      device_group_01:
        friendly_name: 'Group 01'
        device_class: connectivity 
        value_template: >-
          {% if is_state('switch.switch_01', 'unavailable')
             and is_state('light.lamp_03', 'unavailable')
             and is_state('light.lamp_07', 'unavailable') %}
             off
          {% else %}
             on
          {% endif %}