Yes, you need yo go into the /icons/classic
folder and find the contact-open.png
and the contact-closed.png
Copy them and name the copies contact-on.png
and contact-off.png
Where do i find the classic icon folder?
See previous post
but it is empty at my pi?
On my phone right now.
I’ll send them to you later
you can also grab them from here: https://www.openhab.org/docs/configuration/iconsets/classic/#icons
right click on the image, save as
to get the closed and open “flavors” just modify the URL
or directly in your rPi:
cd /etc/openhab2/icons/classic/
wget "https://www.openhab.org/iconsets/classic/contact-open.png"
wget "https://www.openhab.org/iconsets/classic/contact-closed.png"
cp contact-open.png contact-on.png
cp contact-closed.png contact-off.png
Thanks. I can never remember where to find them.
Bookmarked!
but symbol is not changed…how do i say openhab to use it?
Try changing the name from contact-on.png to contact_on do the same for the contact off.
Per the doc’s:
Example filenames:
- Good:
myswitch.svg
,power_meter.png
,error23.svg
- Bad:
PC_Display.svg
,power-meter.png
,tür⇔.svg
EDIT: @Dim pointed out that the doc’s also mention this:
"Some icons are dynamically selected by openHAB depending on the Item’s state. For example, a “switch” icon may appear to be green when the Item is “ON” and red when the item is “OFF. Behind the scenes, openHAB is actually selecting two different icon files depending upon the Item state - switch-on
or switch-off
. A third default icon file, switch
, is required as well. This icon file matches when none of the other icon files match the Item state (e.g. when the Item is in an undefined state).”
So the original naming above should work.
If your still having issues, this shouldn’t be required but, maybe try adding the icon on your sitemap opposed to the item.
Still not working so how do I mention it in my sitemap
As I mentioned above this shouldn’t be necessary but to add the icon on the sitemap use this:
Text item=Kabuff_Tuer_Offen icon="contact-on"
try to use a personalized name for the icon in the Item definition and rename the svgs also
maybe? OH2 doesn’t like that you are using one of the “built-in” names for the icon
That was going to be my next suggestion.
As Dim mentioned, try changing the name by simply adding my to the first part of the name like mycontact-on.png for the file and use mycontact-on in either the item or sitemap.
@milo what are you using as a UI, BasicUI?
If all your icons are .png (bitmap) type then a change to the UI config may be needed. This is done in PaperUI > Confgiuration > Services > UI > Basic UI > Icon Format. Select bitmap for .png and vector for .svg
Note: If your using both types and all are located in /etc/openhab2/icons/classic then no change is needed.
OK so if i write…
<windowcontact>
as icon then I need three icons as *.PNG
Like windowcontact.png, windowcontact_on.png, windowcontact_off.png
Correct?
Yes, that should work.
Also see my post above about the possibility of needing to change BasicUI config via PaperUI to use bitmap (.png) only.
I have done everything as described but the change of the icon is not working…what do I wrong? Can I see it somehow in the log?
Please post the current Item and sitemap file your using.
Nearly. Use hyphen - , not underscore _
windowcontact.png, windowcontact-on.png, windowcontact-off.png
I used the hyphen no everything works
Is there a door symbol open closed as well?