Create a sensor for specific devices that are on

I am looking to create a sensor for each room that would turn on if one entity is on out of a list of specific devices. Someone suggested using groups but I have both light and switch entities so that won’t work.

Does anyone have any suggestions or a link to set something like this up?

It will if you use legacy yaml groups. They support mixed domains.

https://www.home-assistant.io/integrations/group/#old-style-groups

Or just convert your switches to lights first using switch-as-x.

If anyone stumbles on this later, here’s the sensor yaml that I used. It gives a true or false state.

- platform: template
  sensors:
    family_room_entities_on:
        friendly_name: 'family room on'
        value_template: >
          {% set sensors = [states.light.family_room_light_01,
                            states.switch.family_room_switch_01,
                            states.switch.family_room_switch_02] %}
          {{ sensors | selectattr('state','eq','on') | list | count > 0 }}

@tom_l 's way works as well. I just removed all my old legacy groups and recreated them in the UI so I didn’t want to go that route or convert entities.