Displaying Data Array from Custom Component

Hi all,
I’m working on a wine cellar project, but I think this could apply elsewhere.

Thanks to other members here and on GitHub, I have a custom component that grabs an inventory list and stores it in a python DataFrame. That’s working. The component then makes sensors for some statistical and summary data and makes those available to Home Assistant. That’s working too.

So I have the data in memory on the HA server. Now I’m trying to figure out how to display it properly. Step 1 is making it available to HA.

Do I make every wine bottle (or row in a generic array) available as a separate sensor? That seems like it would cumbersome / inefficient and potentially lead to a database management nightmare.

Can I make one sensor and pass a reformatted version of the data array to HA and then use that for display? I haven’t had much luck seeing someone else do this so I’m not sure if it’s possible.

End goal would be a graphic that shows inventory by location (bins and shelf slots), but this would be something like 200 separate locations, which is why I’m shying away from a separate sensor for each.

All ideas appreciated. Thanks.

Make a single sensor with a timestamp as the state, so you can see when its updated and react to that, and then attributes with the data you have.

Thanks. I think I’m going to make a sensor for each column or bin and add slots as attributes. As long as I’m making the changes, I’m going to calculate some advanced stats and export them as well.

Pandas in python seems to have most of what I need, but it’s gonna take some time to learn / work out but at least I have the plan now.

Thanks again for the idea, I didn’t see attributes in any of my other custom component sensors (they’re pretty simple stuff so far), so I hadn’t considered that.