Error when copy / paste elements in SVG

I’m having an issue when I try to duplicate an object InkScape.

I have an overlay for each room to make it look dark. When I click it, the overlay opacity is set to 0, and the “lights” below opacity is set to 100. This works fun unless I try to make a copy of the object I’m using to represent a light on.

the code below works fine however if I copy / paste an element in InkScape, it doesn’t respond to the action. I set the copy to the proper name. I don’t see any errors in The log either. If I make a wrong reference to the SVG, I see that in my log, but that isn’t the case here.

If I create a new object from scratch, it works, only when I copy/paste is it an issue.

rules:
    - entity: switch.bed3_main_light
      element: bed3-main-overlay
      tap_action: toggle
      state_action:
        action: call-service
        service: floorplan.class_set
        service_data: entitystate-${entity.state}
    - entity: switch.bed3_main_light
      element: bed3-main-lights
      tap_action: toggle
      state_action:
        action: call-service
        service: floorplan.class_set
        service_data: light-${entity.state}

Did you set the object ID correctly after the copy paste?

yes, I set the ID properly.

I did some playing around with this. If I use ctrl+D for duplicate, it works fine. If I copy / paste it will not respond to The css.

Not sure as I copy and paste lots of elements but only have a problem when I update the label but not the ID. I think you would have to compare the SVG after the paste and after the duplicate and see what the differences are. Looks like there are some SVG diff tools out there that might make this easier.