Invalid combination of semantic tags

Hello,

As I’m using the MyLight binding that I created, I added new things and then automatically added new Items for those things with all default values.
This lead to the appearance of a health issue:

Clearly, there is something wrong with the way I setup default values in the binding and I want to fix that.
But from the error message, it’s not clear to me what’s wrong in the item definition which is represented like this by MainUI:

Also, the code is this:

version: 1
items:
  MyLight__Battery_Charge_level:
    type: Number
    dimension: Dimensionless
    label: MyLight - Charge level
    icon: Battery
    unit: '%'
    groups:
      - MyLight__Battery
    tags:
      - Energy
      - Measurement
      - StateOfCharge
    metadata:
      stateDescription:
        value: ' '
        config:
          pattern: '%.1f %%'

I believe it’s because there are three tags, but it’s not clear which of Energy or StateOfCharge is to be removed.

It is not because you have three tags as much as it is that you have two property tags. Each point should only be described by a single property (e.g., you can’t really have an item that is a temperature value and a presence value at the same time).

In this case, it looks to me like StateOfCharge is what you are looking for since this is a percent battery charge item. A point with the Energy property is really going to be expected to be a number item with the energy dimension and an actual energy unit (most frequently probably kWh).

Under Developer Tools there is a relatively new (introduced in 5.0 IIRC) Semantic Tags editor. This is where you can add custom semantic tags. But it’s also a great place to see the list of all current semantic tags and how they are organized.

There was a big reworking of the semantic tags between OH 4 and OH 5. Most of the breaking changes were addressed with the upgradeTool but I think the way you upgraded skipped that. This might be one of those cases where a tag that used to be a Point was moved to a Property (I can’t remember if Energy was one that moved).

Jumping off of @JustinG’s explanation of the actual problem here, the purpose of the tags might be relevant here and it would explain why Energy was moved (if indeed that was the case, it’s been over a year so :person_shrugging: ).

  • Location: physical location in your home, only applied to Groups
  • Equipment: the type of device, usually applied to Groups but can be applied to regualr Items if the Equipment only has one data member (rare)
  • Point: applied to the individual Items that actually report or do stuff. The tag indicates what the Item does or what kind of thing it reports. This is the smallest category of tags and it could be even smaller I think. So for an Item that represents a sensor reading the Point tag would usually be a “measurement”.
  • Property: applied to the individual Items that actually report or do stuff. The tag indicates what type of property is reported or controlled by the Item.

The last bullet explains why he recommends eliminating the Energy tag for this and I agree. The most specific pair of tags which indicates what this Item represents is Measurement, StateOfCharge. Measurement, Energy wouldn’t really be wrong and I think that would have been the only option before the semantic tags were overhauled. But StateOfCharge is more specific to batteries which makes it the better choice.

But it is a problem to have three semantic tags too. I don’t want that to get lost. Locations and Equipment can have only one semantic tag. Points can have one Point tag and optionally one Properties tag. I don’t think a Point Item can have a Property tag without a Point but could be wrong about that. But if that’s the case, the Point Item can have one Point tag, one Property tag, or both one Point tag and one Property tag. But it cannot have more than two semantic tags.