Custom icons do not shown anymore / custom icons upload fails

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!

Moderators: leecollings, remb0

Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
User avatar
Domoberry
Posts: 121
Joined: Tuesday 30 May 2017 19:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Contact:

Custom icons do not shown anymore / custom icons upload fails

Post by Domoberry »

Version: 2024.7
Platform: RPI4 Bullseye
Plugin/Hardware: several
Description:

Hi Team,
Perhaps there is something I overlooked, but with both the 2024.4 and the 2024.7 updates, once done, cache cleared, restarted, etc. I lost some of the custom icons I added to Domoticz. Specifically those which I added 'manually', e.g. not using Setup / More Options / Custom Icons. For some reason this feature is not working anymore on my system for some time (I used it in the past).
The "solution" is to make a backup of /home/pi/domoticz/www/switch-icons.txt and restore that after the update.
It looks like switch-icon.txt is reset to using only the custom icons added via the Domoticz UI. The actual icon png files remain present in /home/pi/domoticz/www/images.
Anticipating many more great Domoticz updates :D anything I should do differently?
Last edited by Domoberry on Monday 12 August 2024 12:43, edited 2 times in total.
User avatar
gizmocuz
Posts: 2536
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: 2024.7 update: custom icons not shown anymore (with workaround)

Post by gizmocuz »

You cannot add custom icons 'manually' ! And you should not need to.
When you add them the 'normal' way, there are stored inside the database, so when you update, backup, restore, they are present again
Quality outlives Quantity!
User avatar
Domoberry
Posts: 121
Joined: Tuesday 30 May 2017 19:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Contact:

Re: 2024.7 update: custom icons not shown anymore (with workaround)

Post by Domoberry »

Thanks @gizmocuz, that makes sense.
I will relook into why the 'normal' way to add icons is failing in my case.
Please note that the 'manual' method is actually described in https://www.domoticz.com/wiki/Custom_ic ... binterface at the end of that wiki page: "Editing the icon description file". [note August 13th: the wiki has been updated, this section was removed]

Update:
failing custom icon upload: if I select a zip file in setup/more options/custom icons and click upload, nothing seems to happen. I'm using Edge on Win10. In the past, I have used this feature with success.
There is an older (2 jan 2020) post https://www.domoticz.com/forum/viewtopic.php?t=30754 describing the same problem, others chime in with the same issue, again others mention all ok. The post suggests to use a known good zip file:
plug.zip
(7.55 KiB) Downloaded 41 times
As well as suggestions to clear the browser cache and more. I cannot derive an obvious conclusion from the post. There are also two related dz github issues (2925 and 3316).
In my case I cannot upload this plug.zip file either, tried using another browser (Chrome) and clearing its cache (settings / privacy security / delete browsing data / advanced / <select all> / delete data), no succes.
Any suggestion as to what I'm doing wrong?
Last edited by Domoberry on Tuesday 13 August 2024 14:19, edited 1 time in total.
zicht
Posts: 272
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: 2024.7 update: custom icons not shown anymore (with workaround)

Post by zicht »

Try this : https://domoticz-icon.aurelien-loyer.fr/
Myabe by creating one and compair with your file you can find what goes wrong.
Used this 2 weeks ago with succes.
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
User avatar
FireWizard
Posts: 1886
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: 2024.7 update: custom icons not shown anymore (with workaround)

Post by FireWizard »

Hi,

Be aware that this tool generates icon files with a resolution of
50 x 50 pixels. This causes extra white lines.
You should rescale them to 48 x 48 pixels.

Regards
User avatar
Domoberry
Posts: 121
Joined: Tuesday 30 May 2017 19:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Contact:

Re: 2024.7 update: custom icons not shown anymore (with workaround)

Post by Domoberry »

thanks for the feedback!
Please note that the test-file "plug.zip" I used (posted above) was 'known-good" icon file I picked up from a earlier discussion to reduce the change of a problem in the zip file content.
Nevertheless (I might do something wrong :) ) I unzipped that file and used its 'on' and 'off' pictures with the tool on the website you mentioned. Unfortunately, the resulting zip did not work either. I have attached it:
domoticz_custom_icon_testplug.zip
(7.42 KiB) Downloaded 52 times
What I found strange is that in that newly created zip the picture which should be 16x16 is actually 0 bits in size (and the on and off files are indeed 50x50 instead of 48x48). Hence I used another set of source 'on' and 'off' pictures which are notably larger (around 425x425), but also those resulted in a zip with the supposed 16x16 file is a 0 bit (empty) one. slightly confused... [update August 13th: the tool is not working correctly indeed]
Could someone please check if it is possible to upload the file plug.zip (see few posts back) into Domoticz custom icons?
Last edited by Domoberry on Tuesday 13 August 2024 14:21, edited 1 time in total.
User avatar
HansieNL
Posts: 964
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: 2024.7 update: custom icons not shown anymore (with workaround)

Post by HansieNL »

Domoberry wrote: Saturday 10 August 2024 11:47 Could someone please check if it is possible to upload the file plug.zip (see few posts back) into Domoticz custom icons?
Just uploaded plug.zip to Domoticz Arm 32bit (Raspberry/Cubie/...) 2024.7.16157 without a problem.
Blah blah blah
User avatar
FireWizard
Posts: 1886
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: 2024.7 update: custom icons not shown anymore (with workaround)

Post by FireWizard »

Hi @Domoberry,

Just uploaded to Raspberry Pi 1B with Domoticz 2024.7


Screenshot_custom_icon.png
Screenshot_custom_icon.png (30.24 KiB) Viewed 1872 times

Screenshot_custom_icon2.png
Screenshot_custom_icon2.png (38.74 KiB) Viewed 1872 times

Regards
User avatar
Domoberry
Posts: 121
Joined: Tuesday 30 May 2017 19:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Contact:

Re: 2024.7 update: custom icons not shown anymore (with workaround)

Post by Domoberry »

Thanks a lot for testing, appreciated!
So, an issue with my setup!
Some further digging:
- I do not see anything related appearing in setup/log.
- Starting from the known-good 'plug.zip', I intentionally created a wrong 'plugwrong.zip', in which I messed up the first argument in icon.txt (changed 'plug' to 'XYXplug'. Believe it represents the icon file name). An attempt to upload this plugwrong.zip yields a red UI message from Domoticz:

Error uploading Iconset: Icon File: XYZplug48_Off.png is not present

which seems a logical error message. I carefully conclude that in my case the zip file is picked up and processed by Domoticz, so no issue with browser (Edge) settings on my Win10 pc.

Just double checking: when I try to edit the icon of an existing switch, I cannot select the 'Plug' icon (2nd argument in icon.txt is the name, it is 'Plug' and I assume it should show up alphabetically:
240810 Plug not present.png
240810 Plug not present.png (29.31 KiB) Viewed 1864 times
Also, I would expect it to show up in the Custom Icons screen:
Plug not present in custom icons.png
Plug not present in custom icons.png (126.87 KiB) Viewed 1864 times
Pleae note that I have added several other icons 'manually' in the past (copy the 3 png files and edit switch_icons.txt), which is not the way to go. These icons do not show up in this Custom Icons screen.

Any suggestion for a further step?
User avatar
HansieNL
Posts: 964
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: 2024.7 update: custom icons not shown anymore (with workaround)

Post by HansieNL »

If you run from SD-card you maybe can install OS and Domoticz on other card and see if uploading works.
Blah blah blah
zicht
Posts: 272
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: 2024.7 update: custom icons not shown anymore (with workaround)

Post by zicht »

Domoberry wrote: Saturday 10 August 2024 11:47 I have attached it:
domoticz_custom_icon_testplug.zip
What I found strange is that in that newly created zip the picture which should be 16x16 is actually 0 bits in size (and the on and off files are indeed 50x50 instead of 48x48).
I uploaded the file in my system and it works correctly (despite the omissions you mention above).
You have to search a bit because its named "Button testplug". (you can adjust the name on the customised iconspage in domoticz, after the import)
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
User avatar
Domoberry
Posts: 121
Joined: Tuesday 30 May 2017 19:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Contact:

Re: 2024.7 update: custom icons not shown anymore (with workaround)

Post by Domoberry »

Thanks @HansieNL, unfortunately, I do not have a sandbox RPI to experiment with, yet just creating another Domoticz SD-card would be a good option. I think the result will confirm the Custom Icon Upload on that freshly installed Domoticz will be OK as with other users.

@zicht, thanks for the remark. I have actually been testing with 'plug.zip' (name: "Plug") as well as with 'domoticz_custom_icon_testplug.zip' (name: "Button testplug"). I double checked but neither were found with the Custom Icons overview, nor as optional icon when editing a switch for example, and also not as corresponding png files in /home/pi/domoticz/www/images.

Is there perhaps an internal Domoticz log file where one could follow the results of an attempted icon upload?

Update 1:
Using the webbased https://alpha.sqliteviewer.app/ I can view the Domoticz database (in fact I was looking at a database backup).
Table CustomImages seems to contain - as the table name suggests - the custom images and related metadata. Some icons appear multiple times, probably as a result of my previous attempts. Using an sqlite editor, could I 'clean up' that table hoping the root cause in my case is inconsistencies in that table?
Update 2:
Sorry, adding more confusion: viewing the database, I noted that last couple of Custum Icon attempts *did* make it into the Domoticz database, but did not make it into the Domoticz UI. Here is for example 'testplug', the last record in the table CustomImages:
240911 testplug DID end up in the database.png
240911 testplug DID end up in the database.png (11.15 KiB) Viewed 1789 times
User avatar
Domoberry
Posts: 121
Joined: Tuesday 30 May 2017 19:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Contact:

Re: Custom icons do not shown anymore / custom icons upload fails

Post by Domoberry »

I might have found the solution (in my case), I'm able to upload icons again.
Disclaimer: these are my findings and certainly not based on an in-depth Root Cause Analysis and related knwoledge ;)
In summary:
As mentioned by others, also in this post, 'manually' uploading Custom Icons (as is suggested as alternative in the wiki https://www.domoticz.com/wiki/Custom_ic ... binterface) is not a good practice. In that case, the icons nor the meta data are stored in the domoticz database. Although these icons might initially work, after for example an update of Domoticz, they will not show up again (workaround: save /home/pi/domoticz/www/switch_icons.txt and restore it after the update).
In my case, for some time already Custom Icons upload did not work anymore: Nothing happens, no error message, domoticz.db (table: CustomImages) did get updated though.
By manually applying some changes to the domoticz.db table CustomImages - in my case - Custom Icons upload would function as intended again.
I noted that the Custom Images records in that table, from a certain record onwards, did not show up anymore. I deleted all records in that Table from that point onwards. Thereafter, I was able to upload Custom Images as per normal.
The record in the table from which point onwards things failed, happened to have a value NULL for the small 16x16 icon. This could be coincidence, I did not verify that (perhaps some other glitch in that Tabel caused the problem). That NULL entry was the result of uploading a Custom Icon zip file with an 'empty' 16x16 png file (size = 0). Currently the icon tool https://domoticz-icon.aurelien-loyer.fr/ creates such empty file as part of the zip (I'm reasonably sure that previously this tool created zip's with the small file present as 16 x 16 png).
To edit domoticz.db, I used a Windows version of this tool https://sqlitebrowser.org/. There are many other tools for the same, also tools running on RPI. I just picked one.
High level: stop domoticz -> download domoticz.db -> store it as backup -> edit a copy of domoticz.db -> upload edited domoticz.db -> start domoticz. Making a backup copy of domoticz.db is important.
Comments appreciated!
User avatar
HansieNL
Posts: 964
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Custom icons do not shown anymore / custom icons upload fails

Post by HansieNL »

Strange thing is the bug is already reported in 2016 https://github.com/AurelienLoyer/domoti ... r/issues/1 :o :shock:
Blah blah blah
User avatar
gizmocuz
Posts: 2536
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Custom icons do not shown anymore / custom icons upload fails

Post by gizmocuz »

Thanks for reporting, I removed that section from the Wiki.

I did see the github issue, but maybe the original user removed his/her account and the posts with it, resulting in a vague report now.

Maybe the issue is that if you use a zip file with no 16x16 image, that there is a NULL entry being added to the database.
Quality outlives Quantity!
User avatar
Domoberry
Posts: 121
Joined: Tuesday 30 May 2017 19:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Contact:

Re: Custom icons do not shown anymore / custom icons upload fails

Post by Domoberry »

Thanks for updating the Wiki.
Maybe the issue is that if you use a zip file with no 16x16 image, that there is a NULL entry being added to the database.
I can confirm I noted a NULL entry in the CustomImages table (field IconSmall, data type BLOB) of domoticz.db after uploading a Custom Icon zip-file with a 0-byte 'small/16x16' image as generated by the web tool.
My guess is that such NULL entry causes some havoc for Domoticz, because I found that all Custom Icons uploaded up to the record with mentioned NULL worked OK. Furthermore, after I deleted all records in the CustomImages table from the first record with a NULL onwards, CustomIcon upload was working as per normal. Perhaps just adding the missing 16x16 would also do the job, never tried.
User avatar
gizmocuz
Posts: 2536
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Custom icons do not shown anymore / custom icons upload fails

Post by gizmocuz »

Thanks for reporting!

The problem is in CSQLHelper::InsertCustomIconFromZipFile, this should check first if the icons are there and have a size

But this problem also needs to be checked in 'CWebServer::ReloadCustomSwitchIcons()', this function seems to 'return' instead of keep loading the next icon when a problem is found
Quality outlives Quantity!
User avatar
Domoberry
Posts: 121
Joined: Tuesday 30 May 2017 19:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Contact:

Re: Custom icons do not shown anymore / custom icons upload fails

Post by Domoberry »

Thanks for the RCA!
User avatar
gizmocuz
Posts: 2536
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Custom icons do not shown anymore / custom icons upload fails

Post by gizmocuz »

There was also another possible issue that has to do with the name of the custom icon (and the output file written to disk)
If the name got invalid characters (for the filename), like * / etc, the file could not be written to disk, and internally it stopped loading remaining custom icons

Should not be solved in beta 16182
Quality outlives Quantity!
User avatar
RonkA
Posts: 115
Joined: Tuesday 14 June 2022 12:57
Target OS: NAS (Synology & others)
Domoticz version: 2025.1
Location: Harlingen
Contact:

Re: Custom icons do not shown anymore / custom icons upload fails

Post by RonkA »

Hate to revive an older thread, but i also have trouble uploading a new icon on my Docker driven Domoticz.
As i was searching and trying to learn how to tackle this i noticed:
Version 2025.1 (May 5th 2025)
..
- Implemented: More default icons
First it didn't land wat this could implicate but after some digging i noticed one of my older, not currently used, custom icons had been replaced.
The icon in question is a custom icon i created called 'domoticz_custom_icon_Inverter.zip' ,a picture of my Solar-Edge inverter, but the icon that's being shown is not mine anymore. It looks like some sort of Victron gizmo..
Below a screenshot of the 'new' Inverter button and mine 'old' inverter button..
icon-problem.PNG
icon-problem.PNG (230.13 KiB) Viewed 263 times
I removed the conflicting icon from the custom icons so now it's gone but the original problem remains..
All my icons have the zero bytes png-files and this has never been a problem and al still working fine.
I don't know if the problem is because now there was a icon that had all 3 png-images correct so a flag is been set to now discard all other new icons with a 'issue' or if this is because of the update to 2025.1..
Because my Domoticz is running in a Docker-container i don't know how to overcome this problem as being done on Raspberry-pi installments.
SolarEdge ModbusTCP - Kaku - Synology NAS - Watermeter - ESPEasy - DS18b20
Work in progress = Life in general..
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest