Group of lights

In my floorplan lets say I have 2 lights controlled by one switch.

In my dashboard setup is this the correct way? Do I add 1 entry for each light in my svg? is there a better way?

           - entity: switch.office_light
              element: switch.office_light
              state_action:
                action: call-service
                service: floorplan.image_set
                service_data: /local/floorplan/home_simple/light_${entity.state}.svg
              tap_action: toggle
            - entity: switch.office_light
              element: switch.office_light1
              state_action:
                action: call-service
                service: floorplan.image_set
                service_data: /local/floorplan/home_simple/light_${entity.state}.svg

image

You should be able to do just one with a grouping of the entity and element. Have a look at this example Floorplanner Home Example - Floorplan for Home Assistant

I must be missing something. I don’t see in that example the yaml code to group several lights as one element.

My point was you should be able to do this

            - entity: switch.office_light
              element: switch.office_light
            - entity: switch.office_light
              element: switch.office_light1
              state_action:
                action: call-service
                service: floorplan.image_set
                service_data: /local/floorplan/home_simple/light_${entity.state}.svg

But yes I do it differently. I would have a single image which has the two bulbs and just toggle the one image’s visibility using class_set or style_set