piitaya / lovelace-mushroom

Build a beautiful Home Assistant dashboard easily
Apache License 2.0
3.69k stars 340 forks source link

[Feature]: Badge support in the template-chip #1383

Open roderik-maker opened 8 months ago

roderik-maker commented 8 months ago

Requirements

Is your feature request related to a problem?

I am annoyed that I cannot find a clean way to show all the status information (that I want to show) on the top of my dashboard in uniform manner.

Describe the solution you'd like

Add support for adding a badge in the mushroom-template-chip in the same way that a badge can be configured in the mushroom-template-card.

Describe alternatives you've considered

I am now using a lot of card mod to make this:

Screenshot 2024-03-02 at 10 13 57

But the scaling isn't perfect and its a little glitchy on phone screens. Additionally, because of the second layer of processing, it takes a second or 2 extra to load on older phones.

Additional context

There was also an earlier similar request for a person chip which you didn't want to make:

Chip is a small and a compact element in the UI. The quantity of information must be small : a icon and a text. Adding a badge would overload the interface. Card a more complete element if you need more information.

Originally posted by @piitaya in https://github.com/piitaya/lovelace-mushroom/issues/542#issuecomment-1229564263

Nevertheless I do think there are valid use cases. ie. in my case I would like to show the status of important items at the top of my dashboard including who is home (which is easy to see from a coloured chip) without giving up valuable horizontal real estate on narrow phone screens.

The current alternative that you mention is to write "home","away",etc... per person entity but a coloured badge achieves the same in a much cleaner manner and takes up significantly less space. (I personally really dislike it if the the chips jump onto a second line so I try to minimize their width.)

Cards are not really an option (without using a lot of card_mod) to cleanly show said information at the top as they are far too bulky.

I do understand your comment on keeping the interface clean, but I think you could give users the option to either add a badge or some text to a chip to maintain a clean layout (max 2 pieces of information per chip). Of course I totally understand if this request still doesn't align with your vision. Either way, thank you for your time and effort to make this great collection of cards!!

chenvd commented 5 months ago

I think it will be great.

alexsaas commented 3 months ago

Oh yes. It would be really great if badges were possible with the template chip. Like the template card, which I use most often besides the chips of mushroom.

I tried to recreate something like this with custom:button-card and custom_fields. This also works well and looks almost like an original mushroom chip, but handling is not so easy. Lots of code to edit and unfortunately no jinja templates work. That makes it even more complicated.

I think that such a function would be very useful. For example, I have recreated a chip with a badge that shows me the number of all missing entities from watchman. If I click on the chip, I end up in a subview where these entities are then listed. And my dashboard doesn't become confusing. You can see at first glance that there is something that needs to be checked.

@piitaya is there a small change that this function will be implemented in a future update? I would be very happy about that.

ncodee commented 2 months ago

+1, this would be a great addition.