Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change icon in adapter view #2232

Open
averlon opened this issue Oct 12, 2024 · 20 comments
Open

change icon in adapter view #2232

averlon opened this issue Oct 12, 2024 · 20 comments
Labels
enhancement New feature or request

Comments

@averlon
Copy link

averlon commented Oct 12, 2024

I would like to change the icon/image of a device in the adapter-view.

I have an image stored in /opt/iobroker/iobroker-data/files/zigbee.admin/img

I have changed the icon in the object data:

{ "type": "device", "common": { "name": "MOE_Test_1", "type": "TS0001_switch_module", "icon": "img/o_moes_p_zigbee_switch_mini_01.png", ... }

This helped in the object-view, but not in the adapter-view.

Is there any way to change the icon?

@asgothian
Copy link
Collaborator

did you perform an adapter upload ?

@averlon
Copy link
Author

averlon commented Oct 13, 2024

did you perform an adapter upload ?

No!

@asgothian
Copy link
Collaborator

why not ?

@averlon
Copy link
Author

averlon commented Oct 13, 2024

O.K.!

  1. Would this be a solution to solve the issue?
  2. howto? - or even better, what would I have to do to change the icon?

@asgothian
Copy link
Collaborator

The admin requires certain assets to be copied to a specific location. Upload does that. There are 2 sensible ways of doing it:

  • on the console, enter iobroker upload zigbee
  • from the admin, put the admin in expert mode, and the from the adapter tile select upload.

A

@averlon
Copy link
Author

averlon commented Oct 14, 2024

We war still not on the same page!

The zigbee-adapter works. It shows icons/images for all devices.

But the images shown don't fit to the devices.

So I downloaded images from the supplier of the devices and uploaded the images to the files directory "img" of zigbee.admin.

Now - and that's the point of the issue - I would like to change the image in the view of the zigbee adapter.

As stated, I can change the image in the object adapter. This changes the image in the object-adapter view, but still not in the zigebee-adapter view.

So I would like to know how to change the icon/image in the zigbee-adapter view.

@asgothian
Copy link
Collaborator

asgothian commented Oct 14, 2024 via email

@averlon
Copy link
Author

averlon commented Oct 14, 2024

That will not help since, as far as I have seen, most of the devices I use from different suppliers use the same image.

So I would like to change this issue to a Feature Request!

@asgothian asgothian added the enhancement New feature or request label Oct 14, 2024
@asgothian
Copy link
Collaborator

asgothian commented Oct 14, 2024

That will not help since, as far as I have seen, most of the devices I use from different suppliers use the same image.

So I would like to change this issue to a Feature Request!

Are you certain they use the exact same image ? If so, they should be recognized by the adapter as the exact same device, making your feature request next to impossible to fill. The file name of the image is linked to the device ID reported by the device.

A.

@Apollon77
Copy link
Contributor

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

@averlon
Copy link
Author

averlon commented Oct 14, 2024

yes, I am sure:

This:
grafik

is in Fact a Moes Switch:
grafik

This:
grafik

is in Fact an Aubess Switch:
grafik

This:
grafik

is a Girier-Switch. And this icon/image is used for the MOES and the GIRIER Switches. The Aubess-Switches have a different icon as you can see, although they have the same functionality.
The only difference of these switches are a) dimensions, and b) 8A or 16A

@averlon
Copy link
Author

averlon commented Oct 14, 2024

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

Sure, I did it via the admin-files GUI, not on system level!
The image is known, since I can change it in the object-view. The selected image is then shown in the object-view, but not in the zigbee-view.

@asgothian
Copy link
Collaborator

Please check the device info page for the affected devices. Most important info:
Model
ModelZigbee
manufacturer

as reported by the device.

Please also follow the link behind the model and obtain the image file name of the image linked there.

A.

@averlon
Copy link
Author

averlon commented Oct 15, 2024

you mean, as an example?
grafik

The link to follow: https://www.zigbee2mqtt.io/devices/WHD02.html

The filename of the image: https://www.zigbee2mqtt.io/images/devices/WHD02.png

@asgothian
Copy link
Collaborator

asgothian commented Oct 15, 2024

Yes, like that.

The above example will be automatically fixed when moving to the updated zigbee adapter, as the error was present in zigbee2mqtt.io.

What should be possible:

  • locate the file WHD02.png (should be in /opt/iobroker/node-modules/iobroker.zigbee/admin/img
  • replace the image preset there with the new image
  • perform an adapter upload (in the console iobroker upload) to swap out the image

Alternatively, you can install the current test branch 1.10.10 from https://github.com/asgothian/ioBroker.zigbee/tarball/MapTest

Note that there are a few caveats:

  • please create a backup of your zigbee data folder before updating - in case of issues returning to a previous version
  • please stop the adapter before performing the upgrade
  • Install must be done via the iobroker interface
Screenshot 2024-10-15 at 10 30 56

This will fix the image in cases where the zigbee-herdsman-converters previously linked old images. It does NOT offer the option to manually replace the images.

A.

@averlon
Copy link
Author

averlon commented Oct 15, 2024

I will give it at try, but I doubt, the procedure will fix the issue! I will see.

Based on my experience, zigbee2mqtt has for several manufacturers the same image. I searched arround a bit in the products they support.

So overwriting the WHD02.png with a new file will change all images of products which use this filename. As stated, if I am not wrong, several switches of different manufacturers use this image!

WHD02 was only an example I used. Most Swtiches have the model "TS0001_switch_module". But since they all use the same model, they have the same image. But they look in fact different!

But I will try!

@asgothian
Copy link
Collaborator

asgothian commented Oct 15, 2024

You are most likely correct, but updating on the zigbee2mqtt.io side is the only sensible way of doing this. Adding our own means of adding device images generates additional work which we do not see feasible to handle as we cannot test this properly - most of the developers do not have the devices.

So if there is a set of devices where zigbee2mqtt.io is using a wrong image, the correct way to fix this is to request the image to be changed there. This change will then trickle down to the iobroker.zigbee Adapter as well.

A.
Note: With TuYa - it even gets worse. Some devices report as the same device, have the same functionality, but live in different hardware, and as such would require different images for something which cannot be identified from the zigbee network data.

@averlon
Copy link
Author

averlon commented Oct 15, 2024

...most of the developers do not have the devices.

What devices do you have? Such switches are widely used!

grafik

The 1Channes device looks in reality much the same as the Wall switch model!

But I see your point!

@asgothian
Copy link
Collaborator

asgothian commented Oct 15, 2024

I have next to no TuYa compatible devices. Nor do I use any of these wall switch devices, as there is not enough room behind the switches to include them, and I simply do not trust these small devices. During testing, I had more than one blow up on me. I cannot speak for other developers. But keep in mind that as of writing this, zigbee2mqtt.io supports 3819 devices. With the test branch linked above, the zigbee Adapter supports all of those. It is a given that not all devices are present at the developers, given that the number of active developers on the zigbee Adapter is <10, and neither of us has the resources to just buy stuff to have hanging around.

As to the example pictures - if you have a TMZ02 module, you should be able to request an image change on that model, as it clearly uses the same image as the WHD02.

As with the TMZ02L - I cannot tell wether this one is correct or not. It seems to be wrong, but based on a hunch, the developers at zigbee2mqtt.io will not replace the image either.

A.

@averlon
Copy link
Author

averlon commented Oct 15, 2024

...as there is not enough room behind the switches to include them

Beside the issue: I had the same problem with space in the wallbox. A Friend has a 3d-printer and we designed some spacer to put between the wallbox and the Rocker.

untitled

We have created one with 6mm and one with 12mm. This normally works!

We think about to sell them since many houses may have the problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants