ioBroker / ioBroker.zigbee

Zigbee communcation with Hue, Xiaomi, Lighttify... via TI CC2xxx USB stick
MIT License
313 stars 190 forks source link

icon not displayed #2233

Open fonebone42 opened 2 weeks ago

fonebone42 commented 2 weeks ago

I have 4 devices who's icons are not displayed in the Objects: image

it looks like the PNG files do exist but the web server returns a 404 when trying to access them:

image

They might be missing in _./iobroker-data/files/zigbee.admin/data.json where I could find all other images listed just not the ones missing ones ... I'm not the expert in how iobroker works internally, so this is just a guess :-)

P.S. I'm using the ZigBee Adapter v1.10.9

asgothian commented 2 weeks ago

Please check the sizes of the images. If they are too big they often cannot be displayed

fonebone42 commented 2 weeks ago

this is not a size problem, if you try to access the image directly via the browser then you get this error

https://iobroker.home:8081/adapter/zigbee/img/8719514440937-8719514440999.png (10kB) image

where images that are larger in file size do work e.g.,

https://iobroker.home:8081/adapter/zigbee/img/tuya_TS0042.png (140kB)

both images exist in the same directly image

Apollon77 commented 2 weeks ago

How did you added the file? Please DO NOT just copy it in on filesystem because then this file is unknown and ignored. User Adm -> Files to upload it

fonebone42 commented 2 weeks ago

no, the images were already there so didn't need to add them and in the object view in Admin they are used if you inspect the html in the browser image

Apollon77 commented 2 weeks ago

If thy are not in the _data.json then they got there somehow aside the normal process.

try "iob file sync" ... that should sync the _data.json with the existing files again

fonebone42 commented 2 weeks ago
$ iob file sync
1 file(s) successfully synchronized with ioBroker storage

The following notifications happened during sync:
- Added 1 Files in Directory "zigbee.admin"

but did not solve the problem and the images did still not get added to the zigbee adapter _data.json (bit the file has new modification timestamp)

fonebone42 commented 2 weeks ago

I think I found the problem ... the images were not in the right directory I found them in /opt/iobroker/node_modules/iobroker.zigbee/admin/img but they were not in /opt/iobroker/iobroker-data/files/zigbee.admin/img from the web server picked them up.

playing with iob file sync brought me onto the solution...thanks for the tip

I think there files do just not get copied to the correct directory during installation of the adapter

I did a diff of the 2 directories and exactly the 4 files I listed above were missing so after copying them and an iob file sync all looks ok again

fonebone42 commented 2 weeks ago

I've done some more investigation since I couldn't find the four images here in GitHub and found something interesting. I was wondering why there were just four images missing the the correct directory and why I had all of them in use ... isn't that a bit strange?

So I checked the ZigBee adapter instance settings where the icons had been displayed correctly already before I made the manual fix above image ... and I noticed that the image URL that was used there is pointing to "https://www.zigbee2mqtt.io/ instead of a locally stored image ... all others use local images. image

So my hypothesis is that 1.10.9 automatically downloads these images in cases where there is no local one into /opt/iobroker/node_modules/iobroker.zigbee/admin/img but forgets to also copy them into /opt/iobroker/iobroker-data/files/zigbee.admin/img

This is actually a very nice feature but probably not quite finished yet so it would be great to have this completed in the next release.

fonebone42 commented 3 days ago

I just upgraded to 1.10.10 and I found the following in the logs

image

which seems to back my hypothesis. After the upgrade the icons in the object tree have disappeared again so I needed to apply the manual fix again:

cd /opt/iobroker/node_modules/iobroker.zigbee/admin/img
cp 8719514440937-8719514440999.png 929002398602.png 9290024426.png SWV.png /opt/iobroker/iobroker-data/files/zigbee.admin/img
iob stop
iob file sync
iob start

to make them reappear

Please automate this if images get automatically downloaded from zigbee2mqtt.