How can I filter the Home Assistant REST API response to exclude attributes and diagnostic entities?

Hi, sorry in advance if I sound like I don’t know what I’m talking about because I don’t. I’m a beginner trying to break out of tutorial hell! :sweat_smile: I’m working on a bot that needs to get a simplified list of primary entities within a specific Home Assistant area/room.

I’m currently using /api/template and/or /api/states, but I’m overwhelmed by the excessive metadata and secondary attributes returned for each device (crossfade, double-tap settings, detailed brightness levels).

How can I specifically filter my query to only return the high-level, main control entities like (the primary light switch entity, the main media player entity), and exclude the complex metadata and secondary feature entities?

The main thing is it has to work on every setup or mostly everything, and I always hear about how it’s very bad to hard-code patterns, but at this point, I’m confused and lost, and I barely know my way around a doc.