Top 10 entities in main screen lovelace (?)

Hi everybody,

I’m upgrading my HA config and I was wondering: “is it possible to show the 10 most (manually operated) entities with automated updates in the main screen?”. I think I can count them (monitoring the event bus or MQTT communication) but how about displaying them? Let’s call it my epiphany after a few beers on a saturday night …

Mario

You could write an Automation (or maybe a Python Script) that took the counts you’ve measured and added the 10 entities to a group. Then just display the group in the front end.

Any idea how you add entities programmatically to a group?

Not sure you can.

You might be able to use the auto entities card to display them though:

Yes. There is a group.set service available. It’s not documented, it seems, in the Home Assistant docs. But if you go to the “Services” tab in “Developer Tools” you can select group.set and it will give you some details on how to use it.

3 Likes

Well that’s a new one to me. Someone else was asking about this today, I’ll let them know.

1 Like

I’ve never used it. But I learned about looking at someone else’s automation that handles adding low battery devices to a group for display. I’m not sure if you have to call group.reload after changing the group or if home assistant detects this on its own.

Either way, for this use case, I don’t think you’d bother to calculate the most used entities very often, so the extra time required to call group.reload shouldn’t be a problem.

What about figuring out the part that says “manually operated entities”. That seems like the hard part here.

Hass doesn’t track manual vs programmatically.

that part i have covered :stuck_out_tongue: 80% of all (manual) actions go through MQTT with a local domotics broker where the topic identifies if it is a push button on the wall, a input inside HA (MQTT) or automation. That way I know the difference … If I ever succeed in this wild idea, i will post the concept and the code. I think it will or nodered or pin ython …