I have a sitemap that works however the groups icons are not updating as I expect them to when one of the items in the group changes. Visual Studio Code shows status updating properly from On to Off and Vise Versa. I read the openhab docs but it doesnt pinpoint that should be different from regular items that are working.
It is defined as a switch because I need it to turn on and off as the items in the group get updated. That part is working as expected. When I turn on and off devices, the group is updating properly. The text in my sitemap is also updating properly.
In my sitemap I have it defined as a text field because I don’t want the switch to show up. I don’t want to lock and unlock the doors from there, I simply want it to show the status on the outside of the sitemap and when I click it, it shows me all the items that are part of the glock group.
I am expecting that door lock to look unlocked…
instead I see this…
Notice the text changes but no icon change
Once I click on the line It takes me to the frame with all the door locks, where I can open, close and see more info…
Dynamic icons need the text to match the part after the hyphen in the name. If the icons are named on and off you may need a map transformation. The other option would be to rename the icons. I don’t remember the folder in the openhab install to find the icons off the top of my head. I believe the help docs have the names when you hover over them. I believe this may be the issue.
ok I think you are on to something. I was using Locked and Unlocked and had tried On and Off but not the correct open and closed as the lock icons indicate “lock-open” and “lock-closed” when I hover over them. Thanks for pointing that out!
I have my lock.map file doing this now. It still not working though
Try these in your : {conf}\icons\classic folder. Rename to unlocked and locked. See if it works. If not search here for groups on sitemaps and icons. I read something last night, its possible some of this does not function as expected. But lets try one last thing first.
I downloaded the images and placed them in the direction, they have read permission for everyone and we’re named locked.svg and unlocked.svg respectively.
I misspoke, I had the correct idea, but the wrong names for the icons.
I had lock-on and lock-off and it works great. I suggest putting a 3rd icon name lock and using an icon that is not a lock. This will let you know which of the 3 is being chosen.
@Thedannymullen I went ahead and renamed the icons as @rlkoshak mentioned. it didn’t work so I went ahead and also added the open and closed versions because that’s the name I see when I hover over the icons https://docs.openhab.org/addons/iconsets/classic/readme.html. I agree with Rich that it should be On and Off based on the switch. In this case I needed to add the on and off icons instead of the open and closed since the default icons are opened and closed. I understand that the open and closed icons are extra since those would already be in the default configs of openhab and not actually used by what I am trying to do here. Is my logic correct there?
Here are my current icons and their locations… (note again the open and closed here should really be deleted but I just added them to test)
Thanks for pointing out the thing about the map files I was confused about that, but am actually happy that it works that way as it provides more flexibility I think.
I restarted OH just in case but still I find that it does not update the icon. The text that is driven by the item(s) is updating correctly according to the lock.map file.
That did the trick!!! I had to clear cache after making all the changes. Thank you so much! I now have a good understanding of how this works! Can’t wait to update my config so that all my icons are dynamic!