I recently created my first OpenHAB setup and have the following model:
While everything is functioning well, I am encountering an issue: no badge is appearing on the Locations tab. I have spent several hours trying to understand Semantic Classes and Semantic Properties, as I believe they are crucial to resolving this issue, but I have not had any success. My setup appears to be similar to the one described in Badges not showing in location view, yet the badge is still not displayed on the Entry card. What might I be doing wrong?
Additionally, I have noticed the frequent mention of tags in the documentation and comments. Should I be adding tags to any of my items?
I am using OpenHAB version 4.2.2.
Thank you very much for any assistance you can provide!
Semantic Class is Switch?
Semantic Property is Light?
Yes for both.
Can you show your Model Code?
I’d love to, but unfortunately I don’t know where it resides. This page suggests .items files located in the $OPENHAB_CONF/items folder, but that folder (/etc/openhab/items in my Linux system) is empty, and no *.items file found in /etc/openhab or /var/lib/openhab (OPENHAB_CONF or OPENHAB_USERDATA).
The semantic model is nothing more than a series of group items (locations, and equipment) and regular items (everything else) that have been automatically assigned special tags when you configure the items as part of building the model. This means you could try and configure your model manually by adding the tags directly to the items yourself, but that is a recipe for disaster. You shouldn’t have to configure any of the semantic tags manually.
Your model appears properly configured from the screen shot you have shown. Under the item Label Power you see Switch(Light) that is the semantic class (Switch) and property (Light) so you are correct they are properly configured.
Those locations are only for items that you have configured using text file configuration. If you do not fully understand the semantic model concepts then there is no way you successfully configured these items via text file and I am assuming that you created these items using one of the various UI methods.
In that case, the configurations for those items are stored in a different location, but the way to share those configurations would be to navigate to the item’s details page. Press the edit button at the top and then select the code tab. That will give you the YAML text representation of the item’s configuration suitable for sharing in a forum post like this
``` <-Use 3 backticks to start a code fence block
Paste:
Your: yaml code here
``` <-close the code fence with 3 more backtics
You’ll need to check that you haven’t accidentally disabled badges or specifically light badges for the location card in question.
From the Overview screen press the edit page button (pencil icon in the upper right). Then click on the appropriate card item from the list under the locations tab to open up the configuration dialog for that location. At the bottom of that dialog make sure that Disable badges is off and that the list of Enabled badges is either blank (for all badges) or includes Lights On as one of the options.
Thank you, @JustinG . I knew about not disabling badges: those 2 controls seem to be the only ones to control badge display. So their state was: off for Disable badges and nothing selected on Enabled badges (but I also played with selecting Lights On, etc. It never worked.).
Excellent. Yes, you are correct, those are the only settings that control badges on the card.
I suspect that what’s going on here is pretty subtle (and not something that you have done wrong!), and may be a symptom of an error that has start to appear occasionally. So, tacking this down could be very helpful.
Can you describe (if you recall) exactly how you created the Switch item. I mean: which UI screen and option you used (e.g., add item from the items list or create points from thing from the Model view, etc.)?
For both your switch item and your Light equipment item, please go to the item detail page and click Add metadata and Enter custom namespace. In the input that pops up put semantics. That will open a new page with some additional yaml. Post that yaml here. Don’t save any changes to that page, just close it with the cancel button in the top left corner.
Could you please describe how you created the Switch item, if you recall? Specifically, which UI screen and options did you use (e.g., adding an item from the items list or creating points from the Model view, etc.)?
Unfortunately, I forgot the exact steps, so I deleted the item and attempted to recreate it. In the process, I noticed some unusual behavior, which led me to remove and recreate items, channels, etc., in order to achieve the desired outcome. At one point, I encountered a warning about “orphan links” or something similar, and I was presented with a list of four such orphaned items. After deleting them, the badge appeared immediately!
I cannot recall the sequence of steps I took, nor do I know what caused the orphan links or how to detect them. Perhaps it is worth investigating further. Nevertheless, I appreciate your guidance, as I was able to resolve the issue by trying to replicate the process.