Adding custom icons simple explanation
Moderator: leecollings
-
- Posts: 504
- Joined: Sunday 01 November 2015 22:45
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.2
- Location: Twente
- Contact:
Adding custom icons simple explanation
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.
Last edited by HvdW on Thursday 16 May 2024 7:30, edited 1 time in total.
Bugs bug me.
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Adding custom icons simple explanation
Why would you need DzVents to change the icon for a text device? You can do that with the edit button on the device like the other devices.
Additional the easiest way to get the custom icon number is to go to the custom icon page (menu Setup - Other - Custom Icons) and count, starting with 101. First from left to right and then going a row down. For example:
101, 102, 103
104, 105, Etc
Additional the easiest way to get the custom icon number is to go to the custom icon page (menu Setup - Other - Custom Icons) and count, starting with 101. First from left to right and then going a row down. For example:
101, 102, 103
104, 105, Etc
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- psubiaco
- Posts: 194
- Joined: Monday 20 August 2018 9:38
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Italy
- Contact:
Re: Adding custom icons simple explanation
Thanks for the explanation.
It will be super to collect several customs icons in a Domoticz repository, so they can be added in the next Domoticz versions.
Domoticz by default has very very few icons available, and I'm too lazy to add customs icons!
It will be super to collect several customs icons in a Domoticz repository, so they can be added in the next Domoticz versions.
Domoticz by default has very very few icons available, and I'm too lazy to add customs icons!
Paolo
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Adding custom icons simple explanation
It is not that simple as you have to create an install script to fill the database with the custom image data too.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 212
- Joined: Thursday 14 March 2024 10:11
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Adding custom icons simple explanation
In general, that is of course correct. However, there are circumstances where it is desirable to change the icons from a script. That's why it was made possible. An example of this, with cnanging of weather icons, I just posted in Configurable 'KNMI Weerlive' script.
Domoticz in Ubuntu virtual machine on Synology DS718+ behind FRITZ!Box.
Using: EvoHome; MELCloud; P1 meter; Z-Stick GEN5; Z-Wave-js-ui; MQTT; Greenwave powernodes 1+6; Fibaro switch, plugs, smoke; FRITZ!DECT 200. Scripts listed in profile interests.
Using: EvoHome; MELCloud; P1 meter; Z-Stick GEN5; Z-Wave-js-ui; MQTT; Greenwave powernodes 1+6; Fibaro switch, plugs, smoke; FRITZ!DECT 200. Scripts listed in profile interests.
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Adding custom icons simple explanation
I understand that but from the original instruction in the first post I got the impression that for a text device you could only do that by dzvents and not by manual edit.
But I see the start topic has been changed to a better instruction. But still steering users to use SQLite to query the database.
But I see the start topic has been changed to a better instruction. But still steering users to use SQLite to query the database.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 212
- Joined: Thursday 14 March 2024 10:11
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Adding custom icons simple explanation
Yes, I think your counting method or the https://yourIP:yourport/#/Custom/ShowAllDeviceValues that I mentioned is easier for most users.
Domoticz in Ubuntu virtual machine on Synology DS718+ behind FRITZ!Box.
Using: EvoHome; MELCloud; P1 meter; Z-Stick GEN5; Z-Wave-js-ui; MQTT; Greenwave powernodes 1+6; Fibaro switch, plugs, smoke; FRITZ!DECT 200. Scripts listed in profile interests.
Using: EvoHome; MELCloud; P1 meter; Z-Stick GEN5; Z-Wave-js-ui; MQTT; Greenwave powernodes 1+6; Fibaro switch, plugs, smoke; FRITZ!DECT 200. Scripts listed in profile interests.
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Adding custom icons simple explanation
I do not know what you have custom but that is not working for me. What does work is this undocumented API call:
Code: Select all
/json.htm?type=command¶m=getcustomiconset
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 212
- Joined: Thursday 14 March 2024 10:11
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Adding custom icons simple explanation
Oh, this is very stupid of me!
I meant:
I use it so often that I included it in a custom page, so that I can easily access it from the menu. I had pasted the URL of that page into the message without a second thought. My apologies for the confusion. I will correct it in my other Weerlive post.
BTW. I did the same with the command to see all schedules. You can see it with:
I find it very useful to quickly find all kinds of details this way.
I meant:
Code: Select all
https://yourIP:yourport/json.htm?type=command¶m=getdevices&plan=0
BTW. I did the same with the command to see all schedules. You can see it with:
Code: Select all
https://yourIP:yourport//json.htm?type=schedules
Domoticz in Ubuntu virtual machine on Synology DS718+ behind FRITZ!Box.
Using: EvoHome; MELCloud; P1 meter; Z-Stick GEN5; Z-Wave-js-ui; MQTT; Greenwave powernodes 1+6; Fibaro switch, plugs, smoke; FRITZ!DECT 200. Scripts listed in profile interests.
Using: EvoHome; MELCloud; P1 meter; Z-Stick GEN5; Z-Wave-js-ui; MQTT; Greenwave powernodes 1+6; Fibaro switch, plugs, smoke; FRITZ!DECT 200. Scripts listed in profile interests.
Who is online
Users browsing this forum: No registered users and 0 guests