Getting ZHA Group number from entity ID

I saw in another topic by seblu that there is a way to get the ieee from the entity id of a ZHA device.

{{ (device_attr("light.room3", "identifiers")|list).0.1 }}'

I’m putting together a blueprint, and I found that I’m having more difficulty with getting the group number from an entity ID in a similar way. Is there a way to get the group number from an entity ID so that I could make a blueprint that only requires the group’s entity ID to work? Thanks!