Domoticz: give a youthful look by customizing the icons [Exclusive Guide]

2:05 pm October 31, 201612534

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.

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://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).

domoticz icone personnalisee libreoffice dessin vectoriel

just that to 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

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:

  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

 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.


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 icons Open Source