Using Icons - The facts, nothing but the facts

So, this is going to seem like the most stupid question imaginable to the experienced heads here, but I’ve search high and low and have found nothing that could point me in the right direction.

I want to change the icons in my Lovelace cards to ones that better suit my scripts.

For example, I have a xiaomi ir blaster with over 20 different ir codes programmed into home assistant. It would look much MUCH better to have ‘mdi:VolumeMute’ in place of ‘hass:script-text’ in button that executes my amp’s mute button.

But simply replacing ‘hass:script-text with mdi:VolumeMute’ does not result in the change I’m looking for. For something as simple as an icon change one expects a simple solution long the same code lines…

I know, what a dumbass, right? But you’d be surprised just how impenetrable the home assistant help is on things as simple as this. Could someone point me in the right direction?

2 Likes

You can use customize to change the icon of anything:

Ok, I realise that makes perfect sense to you, but it really doesn’t make any sense to me.

Could you perhaps show me an example where a default icon has been successfully changed to a mdi icon? I know… such impertinence…

1 Like

configuration.yaml:

homeassistant:
  customize: !include customize.yaml

customize.yaml

script.lounge_tv_ch_dn:
  icon: mdi:arrow-down-bold-box-outline
  friendly_name: Channel Down
script.lounge_tv_ch_up:
  icon: mdi:arrow-up-bold-box-outline
  friendly_name: Channel Up
script.lounge_tv_down:
  icon: mdi:arrow-down-bold-circle
  friendly_name: Down
script.lounge_tv_exit:
  icon: mdi:backspace
  friendly_name: Exit
script.lounge_tv_ffwd:
  icon: mdi:fast-forward
  friendly_name: Fast Forward
script.lounge_tv_green:
  icon: mdi:square
  friendly_name: Green
script.lounge_tv_guide:
  icon: mdi:television-guide
  friendly_name: Guide
script.lounge_tv_info:
  icon: mdi:information

I totally understand your confusion. The documentation is actually pretty good, but sometimes it seems like each word requires a research project to see what that word means in HA.

Anyway, there are a number of ways to specify an icon. Probably the easiest is to go into Configuration / Customizations and type in some part of the entity name. I have two sump pumps, so I can just type sump and every entity associated with them will show up. Select the one you want and select Pick an attribute to override. Icon is one of the options. Select that and type (or paste) in the name of the icon you want to use. In my case it was mdi:water-pump. Hit save. That’s it. All done.

Here’s what one of my pump switches looks like after doing that:

Which part specifically didn’t make sense to you?

Was it the description explaining how icon can be customized?

icon string (optional)
Any icon from MaterialDesignIcons.com. Prefix name with mdi:, ie mdi:home. Note: Newer icons may not yet be available in the current Home Assistant release. You can check when an icon was added to MaterialDesignIcons.com at MDI History.

Or was it the comprehensive example that includes icon customization?

    switch.wemo_switch_2:
      friendly_name: Kitchen kettle
      icon: mdi:kettle

Whichever one it was (or both), how do you suggest it be changed to be more comprehensible?

Which part specifically didn’t make sense to you?

Was it the description explaining how icon can be customized?

Or was it the comprehensive example that includes icon customization?
[/quote]

It was the faint detection of sarcasm picked up by my trusty Future Sarcasm Detector that threw me initially. Or is that “eventually”? Hard to say with these new-fangled time travelling sensors…

I see Home Assistant has a long way to go before it can confidently call itself and it’s online enthusiast forum “consumer-ready”…

Whichever one it was (or both), how do you suggest it be changed to be more comprehensible?
[/quote]

The way forward is (obviously) to make Material Design Icons selectable from the UI, A search box linked to the icon repository, type in your desired search parameters, select your icon, DONE! If the user wants to go to the trouble of using their own or someone else’s icons not found in the Material Design database, they can always go to all the fapping about in YAML. If that’s their bag.

It must come as quite a shock to you that the vast, VAST majority of HA’s potential userbase would rather sail a galleon around Cape Horn in lively weather whilst on acid, than spend unending weekends clumsily writing unfamiliar computer code for something as (presumably) easily solvable as a vector image selector in the UI. The fact is, I saw page after page of the current and/or past users whining about how thoroughly unhelpful the icon implementation is, so clearly I’m not alone in believing there’s got to be a better, consumer-friendly way than the current regime.

Now that I’ve had time to fap with it, it’s now making more sense, but it’s also introduced a shittonne, no, a fucktonne, more work than should be the case. Hopefully, there’s a plan in the works and future users won’t want to slam themselves into a brick wall rather than yaml-fuddle their way through.

Surely you can appreciate that, yes?

2 Likes

I mean, look at that travesty of a reply. I completely destroyed that quote feature… The platform has to do more to not scare people like me away or it’s dead in the water

1 Like

It is getting better every month. Which brings other issues for people who do not have the time to keep up with the fast pace of changes.

However it is far from “dead in the water”:

I can appreciate the fact that you appear to have more time to compose opinion pieces than clarifying which part of the documentation “didn’t make sense”.

Yes.

Perhaps it’s simply not for everyone.

Home automation involves a level of complexity that will always be unfathomable to some. Even commercial, consumer-focused products like Hubitat Elevation have a significant learning curve.

I don’t think anyone here is calling anything consumer-ready.
No one should have assumed so, either.

But we are human beings. I assumed HA a consumer-friendly thing when I started also, and then quickly realized that things were not the way I thought them would be.

So what did I do? I adjusted my expectation, accepted the challenges, and then moved on - those are all part of the deal, so no need to complain.
Having great fun since also. :slight_smile:

I checked out of this thread when the tone turned nasty, and I won’t participate in that part.

But, a good point was raised. The MDI icon site makes it easy to select and copy an icon’s name. Would it be too much to ask HA to be able to accept it pasted in that way, rather than making the end user change one character?

Then, how about a link to that MDI site, right from the icon selection page in HA?

And, much as I hate to admit it, the otherwise negative posting above has a good point about making MDI icons directly selectable from within HA. These are the little things which distinguish a finished product from a classic example of lazy coding.

1 Like

The comical thing is, you can select them from the ui.

The hostility came when OP misunderstood 123s response. Because as a long time user, I knew 123 was being genuine and not sarcastic. However OP immediately took the negative route and avoided the questions and became hostile.

I’ve never been able to find that capability. All I get is a blank where I can type (or paste) in the MDI icon I want. I’ve looked at the entity, at customizations, and in the card in Lovelace. They all let me set an icon, but none let me select it. Maybe I’m looking in the wrong place.

Would you be able to help me find where to select the icon from the UI?

Thank you!

It’s possible your definition of ‘in the ui’ is different than mine. Are you asking for the ability to select it from a dropdown? I was just talking about typing the name outright.

so

But simply replacing ‘hass:script-text with mdi:VolumeMute’ does not result in the change I’m looking for.

how about trying the correct name. mdi:volume-mute

? works fine.

Yes, it looks like we were misunderstanding each other. To me, the word “select” means picking from a list, not typing in text.

No worries, I think we’re all on the same page now. Thank you!

Mans had a meltdown based on a typo hahaha

1 Like

Yes, it works. I managed to figure that out all by my stupid self, remarkably. The MDI website (or database, unsure which) capitalises the first letter of each word in the mdi code, a most unhelpful quirk which adds a seventh step (!) to an already laborious setup task in HA. As CaptTom pointed out above, it’s the little things, like, making MDI icons searchable and selectable from within HA, that separate a ready for gen. pop. product from an impenetrable fortress of insider jargon and obscure, third-party menu items that ordinary civilians are guaranteed to lose their minds over in a very short space of (already scarce) tinkering time.

HA promises so much and I’m not easily dissuaded, even by thinly veiled sarcasm designed to make me, a non-coding civilian that HA needs to attract to fulfill it’s potential, feel like the idiot in the room (if it wasn’t sarcasm then I withdraw the accusation, but it certainly seemed so to me at the time). But so often it plays like a schizoid robot that came with an operating manual written entirely in Chinese. It might make all the sense in the world to a native Mandarin speaker, but unless a translator is available, you’re left with the highly disagreeable trial and error method of resolving what should ultimately be simple matters resolved without issue in the UI. That’s time consuming for peeps who work Mon-Fri and might only have a few hours on Sunday afternoon to “suck it and see”.

We humans are less likely to give strangers the benefit of the doubt when, rightly or wrongly, hostility is detected than we are with those known to us. This is true to the power of 1000 when engagement happens online, something IT departments rarely seem to understand. All would do well to preface any responses with a friendly, hostility defusing, empathic message of hope before plowing into any cold, hard how-to steps, as CaptTom did above. It was a relief to hear that others had experienced similar frustrations and put me in a much more agreeable frame of mind than any “Please fill out this form so we can better understand how human beings are” response ever could.

I’m slowly getting more familiar with all the jargon in the various instruction pages I’ve had to endure deciphering (top of the “who-the-phuck-designed-this-travesty” list, the Xiaomi IR blaster implementation) but when I finally reach a point of detailed understanding, nine times out of ten I’m left with a thought that usually begins with “Well, why didn’t they just code all that into the UI with non-coders like me in mind?”. Sometimes I think it’s because making things easier to penetrate in the UI decreases an end user’s reliance on the IT department’s helpdesk. Then I remember…

HA doesn’t have a helpdesk. It has a “You’re a dumbass desk” instead… Hopefully things like this will be resolved soon with the appointment of a UX-designer. To say this was a welcome sign in the latest release is an understatement requiring no sarcasm. Help is on its way at last!

Thank you for your attention