Room information for entity

Hey,

I have recently started using Home assistant and i have been looking into implementing facial recognition in various rooms to trigger various functions in the room. I have been using python api for home assistant and I’ve also been going through the sql db but i haven’t come across anything related a room for an entity. I know you can assign rooms to entities so I’m wondering if this is information is stored separately.

if anyone can point me in the direction of where i could retrieve the room information or alternatively the code that assigns the state information to the entities that would be great!