While looking for a way to exclude entities from recorder and history I found this thread. Sadly this isn’t possible. I think it would be a nice addition to be able to exclude entities by platform.
After looking at code I noticed that recorder filters are generated here: https://github.com/home-assistant/core/blob/e13f78dfc5f79c23759a070de76f4aff8388845a/homeassistant/helpers/entityfilter.py#L44.
We pass entity_id, get domain from it and in return we get a simple bool value.
The part that is missing is getting the platform name from entity_id.
Is this possible from the code?
If yes, then what is the optimal way of doing that?