Domoticz: give a youthful look by customizing the icons [Exclusive Guide]
icons offered by default by 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
before begin you, you will need to know:
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 d ‘iconfinder .
here’s 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.
now, open the cart in the upper right. Click Download collection
If you quote the author of icons, you can download them for free.
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://fr.libreoffice.org ). Inskscape (https://inkscape.org/fr/) is also a very good choice if you want to get into more complex icons.
launch free 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).
just that to export these two images in PNG format (file-> Export…)
give a file name and respect the formalism of Domoticz for each State ON and OFF (48_On and 48_Off).
in the selection list, choose Pixels and enter 48. Finish with OK.
open a FTP connection (read this article if you do not know how) and drop the two files in the directory domoticz/www/images.
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
sudo nano domoticz/www/switch_icons.txt
the configuration file looks like this. It for 19 default icons.
light; Light/Switch; A Lamp or Switch WallSocket; Wall Socket; Power Wall Socket TV; Television; TV Screen Harddisk; Hard disk; Hard disk drive Printer; Printer; Printer amplify; Amplify; Device that controls audio Computer; Laptop computer; Personal Computer System Fan; Fan; Producer Speaker airflow; Speaker; Audio Speaker Generic; Generic; Generic On / Off switch Fireplace; Fireplace; Fireplace Water; Water; Water Media. Media Player; Multi Media player Alarm; Alarm; Alarm ChristmasTree; Christmas Tree; Christmas Tree Heating; Heating; Heating Cooling device; Cooling; Cooling device ComputerPC; Computer PC. Personal Computer Phone System; Phone; Mobile Phone
each line corresponds to an icon. The line includes 3 names:
- the name of the image file by removing (48_On.png or 48_Off.png)
- the wording of the icon (shown in bold)
- 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
Garage; Garage; Door
we restart the Domoticz service to take into account the new configuration file.
sudo service domoticz.sh restart
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.
and here, your device is now customized. To get a better look, it is best to make icons with a transparent background.
other sources of icons Open Source