Create light group based on floors

Hi,

So I’m managing two houses using one home assistant instance.

Since the concept of “house” or “building” does not exist in HA, I’m making the distinction using floors.

One building has four floors, the other building has two floors.

In various situations (automation, selecting entities in the UI using auto-entities), it would be good if I could include/exclude entities based on which floor they reside in.

E.g. “turn off all lights, except floor A & B”.
Or in auto-entities: show all motion sensors of floor X, Y, Z.

Any suggestions on how I should manage this?