How do I change the entity icon in Home Assistant? MDI icons - Material Design Icons

Home Assistant is a popular, open source home automation system that allows the integration and personalisation of many different systems and series of devices. One simple but effective way to personalise the HA interface is to change the icons assigned to entities, such as switches, sensors or lights. Home Assistant uses icons from the MDI (Material Design Icons) set. These are icons developed according to Material Design guidelines from Google.
You can use them in Home Assistant by prefixing the icon name with the prefix mdi:. For example:
- mdi:camera - camera icon
- mdi:account - account icon (human)
- mdi:alarm-light - alarm light
- etc.
The easiest way in Home Assistant is to change the icon for an already paired device. It can be added earlier through Home Assistant Discovery. Click on its icon:

Then we enter the settings:

We select the icon from the drop down list:

The icon has been selected:

Click update:

From now on the icon is changed:

For easier browsing of the icons, I recommend visiting the icon library:
https://pictogrammers.com/library/mdi/
The search engine there is much more readable than what HA offers:

It remains to consider what this looks like from the programming side. Suppose we create a sensor via Home Assistant Discovery.
We publish the data under the topic:
homeassistant/sensor/MyDevice/my_voltage/config
of content:
Code: JSON
Home Assistant then takes the default icon for the voltage:

Conversely, if we add our own setting to the JSON:
Code: JSON
Then we get:

In this way, the icon can be changed from not the Home Assistant itself, but from the source device performing HASS Discovery.
In summary, personalising icons in Home Assistant is a simple but effective way to better tailor the interface to your needs and preferences. Using MDI's rich set of icons, it is easy to change the appearance of device representations both from within Home Assistant itself and directly in the configuration of devices sending data through Home Assistant Discovery.
Do you also use the wide range of icons in Home Assistant, and if so, for what? .
Comments
Add a comment