Adding custom icons simple explanation
Posted: Wednesday 15 May 2024 23:28
I had some trouble interpreting the wiki about custom icons plus I want to add information about how to change the Icon in a text dummy.
1) Create a nice icon by asking ChatGPT or Microsoft Copilot to draw a picture for you. Try different options to create a simple drawing of the object you want to have an icon from.
2) open https://domoticz-icon.aurelien-loyer.fr/ , give your icon a name and use the same drawing twice for on and of or use different colored pictures for on and off.
Adjust the position of the part of the picture you want to be used for your icons..
3) Let the website generate a zip file.
4) In Domoticz goto Setup -> More Options -> Custom Icons and upload your zip file.
5) Now you can use your new icon in the sensors and actors of Domoticz
To use your new icon to dynamicaly change the icon (like different icons depending on the weatherforecast) you can proceed as follows:
5) SSH to your domoticz server and cd domoticz
6) sudo sqlite3 -header domoticz.db " select id+100 id ,name from customimages"
6) make a note of the number of your icon (101, 102, 103 or whatever is displayed)
7) The dzvents code to change the icon of a txt dummy sensor is domoticz.devices('name_of_dummy_txt_sensor').setIcon(icon_number_in_sqlite)
8) Refresh your screen using Ctrl-F5 et voilá there's your icon.
1) Create a nice icon by asking ChatGPT or Microsoft Copilot to draw a picture for you. Try different options to create a simple drawing of the object you want to have an icon from.
2) open https://domoticz-icon.aurelien-loyer.fr/ , give your icon a name and use the same drawing twice for on and of or use different colored pictures for on and off.
Adjust the position of the part of the picture you want to be used for your icons..
3) Let the website generate a zip file.
4) In Domoticz goto Setup -> More Options -> Custom Icons and upload your zip file.
5) Now you can use your new icon in the sensors and actors of Domoticz
To use your new icon to dynamicaly change the icon (like different icons depending on the weatherforecast) you can proceed as follows:
5) SSH to your domoticz server and cd domoticz
6) sudo sqlite3 -header domoticz.db " select id+100 id ,name from customimages"
6) make a note of the number of your icon (101, 102, 103 or whatever is displayed)
7) The dzvents code to change the icon of a txt dummy sensor is domoticz.devices('name_of_dummy_txt_sensor').setIcon(icon_number_in_sqlite)
8) Refresh your screen using Ctrl-F5 et voilá there's your icon.