Domoticz: give a facelift by customizing the icons

Icons included by default in Domoticz are a little old and do not always meet our needs. Fortunately it is possible to customize some of them quite simply. This method applies to the following devices: Media Player and ON / OFF

How to create new icons for Domoticz

Domoticz didn’t need a specific icons file. Domoticz manages just two States (ON / OFF) from 2 images. You can retrieve images from another Open Source automation software files or prepare your own. To simply create new icons, the easiest is to start from a design in a vector format (SVG). For example on the website Flaticon you can find very many files vector available for free (as long as you quote the author!). You can also take a look on the side iconfinder.

Here is what one finds for example with the key word garage door (and Yes, it will a do a little Google transat to find the right keywords). I selected the two icons on the second line. The closed door is checked.

flaticon recherche

Now, open the cart in the upper right. Click Download collection
2-flaticon-domoticz-icone-collection

Choose SVG

flaticon domoticz icone format svg

If you quote the author of icons, you can download them for free.

flaticon free download domoticz

The download starts immediately after (my-icons-collection). After decompression, go to the svg directory to find the recovered icons.

Now we can personalize them with a vector drawing software. If you do not, there are several Open Source and free. The easiest is the drawing of free Office module ( https://libreoffice.org ). Inskscape (https://inkscape.org/) is also a very good choice if you want to get into more complex icons.

Launch Libre Office and open a new drawing. Open the vector image (svg file). For example, I created on a first page one OFF with a Green State wording FARM and on a second page a State WE (OPEN label).

domoticz icone personnalisee libreoffice dessin vectoriel

Now we can export these two images in PNG format (file-> Export…)

domoticz icone export icone png on off

Give a file name and respect the formalism of Domoticz for each State ON and OFF (48_On and 48_Off).

domoticz icone export png nom fichier

In the selection list, choose Pixels and enter 48. Finish with OK.

domoticz icone export png 48x48 pixels

Open a FTP connection (read this article if you do not know how) and drop the two files in the directory domoticz /www/images.

domoticz icone transfert images icones ftp filezilla

Install new icons on a server Domoticz

Now that we have our new icons, it is to install and configure Domoticz to use them. Open a SSH connection or connect you to your Domoticz directly on the Raspberry.

Let’s start by editing the file switch_icons.txt , which is located in the directory www folder domoticz

the configuration file looks like this. It for 19 default icons.

Each line corresponds to an icon. The line includes 3 names:

  1. the name of the image file by removing (48_On.png or 48_Off.png)
  2. the wording of the icon (shown in bold)
  3. a sub-caption (an optional additional information)

note. You can take the opportunity to translate the labels of the icons by the way

Best is to declare your personal icons at the end of the list. Domoticz built the selection list by sorting alphabetically labels of the configuration file. Save the file with Ctrl + X then O (or Y).

Add a new line of declaration of the garage icon

we restart the Domoticz service to take into account the new configuration file.

Also refresh the browser.

Edit now a device, a type switch On / OFF. In the list of choices, you will find your new icon. Save the change.


domoticz choix icone personnalisee

And here, your device is now customized. To get a better look, it is best to make icons with a transparent background.

domoticz icone affichee

Other sources of Open Source icons

Subscribe to the weekly newsletter

No spam and no other use will be made of your email. You can unsubscribe anytime.

DIY Projects