Skip to content

Conversation

andrewfg
Copy link
Contributor

@andrewfg andrewfg commented Apr 21, 2025

Background

Relates to #18567

I wrote a Java application to scan all Channel-Type xml files and based on the xml attributes and values to auto-magically create Point and Property tags and write the modified files back to disk.

GenerateChannelTags.zip

Run the program by the command line below:

java GenerateChannelTags.java -binding ahawastecollection -root c:\git\openhab-addons -interactive true

Where the command line parameters are as follows..

  • -root <path> looks for xml files in this folder and all sub-folders
  • -binding <bindingid> runs the application for just one binding (default: all bindings)
  • -interactive <boolean> runs the application interactively (default: false)

I used the program to generate tags on all 502 bindings. This generated about 4`000 point & property tag pairs. So about 1'100 lines of Java code saved about 10'000 lines of hand written xml.

Signed-off-by: Andrew Fiddian-Green software@whitebear.ch

Moved to Sub Pull Requests

After having run this automatic tagging application, I moved the addons into the several smaller PRs, in which I have manually reviewed and corrected (curated) the tags as follows:

Note: I will close this PR once the individual PRs above have been completed

Current Status

The above mentioned PRs (will) have added the following number of Point+Property tags to the OH bindings:

  • Prior to these PRs the tag coverage was under 3% (390/13055 binding:channel-type combinations) had been tagged.
  • The already merged PRs increase the coverage to 23% (3139/13503 binding:channel-type combinations).
  • The yet to be merged PRs will increase the coverage to 34% (~4700/13503 binding:channel-type combinations).
  • Note that the system-channel-type coverage is 8% (1885/23258 binding:channel combinations) and these have also newly been tagged.
  • Furthermore in other PRs the coverage of Equipment tags has reached 74% (1578/2112 binding:thing-type combinations).
  • Note also that new in 5.0 some addons (hue, hdpowerview, zwave, zwavejs, zigbee to name a few) are applying Point+Property and Equipment tags not statically via the the thing-type and channel-type xml files but rather dynamically at run-time via the java code. It is therefore hard to exactly quantify the statistics, but the above figures will certainly be effectively higher.

Tag Usage Statistics

TagAnalysis.txt

@andrewfg andrewfg added the work in progress A PR that is not yet ready to be merged label Apr 21, 2025
@andrewfg andrewfg self-assigned this Apr 21, 2025
@andrewfg andrewfg requested a review from soenkekueper as a code owner April 21, 2025 18:40
@andrewfg
Copy link
Contributor Author

Pinging @jimtng @ccutrer @mlobstein @lolodomo for info :)

@andrewfg andrewfg changed the title Autogenenerate Point and Property tags Auto-Genenerate Point and Property tags Apr 22, 2025
@holgerfriedrich holgerfriedrich added the rebuild Triggers Jenkins PR build label Jul 7, 2025
@github-actions github-actions bot removed the rebuild Triggers Jenkins PR build label Jul 7, 2025
@andrewfg
Copy link
Contributor Author

andrewfg commented Jul 9, 2025

@lsiepel (for info) please see the TagAnalysis.txt file in the initial post at the top of this thread.

@andrewfg
Copy link
Contributor Author

@kaikreuzer when you are preparing the release notes for OH 5.0 you may be interested in the Current Status paragraph at the top of this thread. (I will keep these statistics updated). Hopefully we can merge the three missing PRs so that the statistic reaches 34% .. although even the 23% figure is still quite an achievement.

Note: the coverage will (shall) never be 100% because tags are only applied to non advanced channel-types.

@kaikreuzer
Copy link
Member

@andrewfg The release notes will be auto-generated based on the titles of the PR; mentioning this effort specifically might be done in the release blog post, though.

@lolodomo
Copy link
Contributor

@andrewfg The release notes will be auto-generated based on the titles of the PR; mentioning this effort specifically might be done in the release blog post, though.

And you could even write it @andrewfg as you were the leader on that work ;)

@andrewfg
Copy link
Contributor Author

andrewfg commented Jul 11, 2025

And you could even write it

@lolodomo following is my proposal (assuming #18816 is merged)..


We have done a lot of work concerning Semantic Tags as follows..

  • Clarified and extended the rules and documentation for the use of semantic tags.
  • Added several new Equipment, Point, and Property tag constants to meet developer requests.
  • Created developer tools so that only correct semantic tags can be applied when bindings are added or modified.
  • Improved the UI for the user to visualize and apply semantic tags to Items.
  • Increased the number of Point+Property tag default values from under 3% to 40% of all binding channel types (or 81% of non- advanced channel types).
  • Increased the number of Equipment tag default values from zero to 74% of all binding thing types.
  • Some bindings now apply Equipment and Point+Property tag default values dynamically depending on the actual attributes of Things and Channels in the Inbox. This increases the tag coverage percentages above.

@lsiepel
Copy link
Contributor

lsiepel commented Jul 11, 2025

  • Clarified and extended the rules and documentation for the use of semantic tags.
  • Improved the UI for visualizing and applying semantic tags to Items.
  • Increased the number of Point+Property tag default values from under

Just a mere 34%.. pff i dream about tags, seen so many.

@andrewfg
Copy link
Contributor Author

andrewfg commented Jul 11, 2025

Just a mere 34%.. pff i dream about tags, seen so many.

LOL. The main reason that it is a mere 34% is that in general I intentionally only applied tags to non- advanced channel types. There are quite a few advanced channel types which have fairly esoteric applications and are thus not tagged. So in other words, the coverage of non- advanced channel-types is certainly higher. (I get this statistic for you later..)

EDIT of the 13503 channel types there are 6741 advanced i.e. 49% .. so practically speaking for non esoteric channel-types the penetration rate is almost double the 23% / 34% ..

@lsiepel
Copy link
Contributor

lsiepel commented Jul 11, 2025

oh and let's not forget the dynamic created tags. are not counted.

Nice statistics though, think we might need to look at those advanced channels, i wonder what is going on. Possibly many obsolete ones.

@lsiepel
Copy link
Contributor

lsiepel commented Jul 12, 2025

Removed the labels from the 'child' PR's so they will not show up in the release notes. This 'main' PR with all its centralised details and information will be included.

@andrewfg
Copy link
Contributor Author

Ok. I will update the statistics based on the code freeze release candidate.

@andrewfg andrewfg changed the title Add auto generated tags to addons Add Point and Property tags to addons Jul 12, 2025
@lsiepel lsiepel merged commit 35d4158 into openhab:main Jul 12, 2025
2 of 4 checks passed
@lsiepel lsiepel removed the awaiting other PR Depends on another PR label Jul 12, 2025
@lsiepel lsiepel added this to the 5.0 milestone Jul 12, 2025
@andrewfg
Copy link
Contributor Author

@lsiepel many thanks for your great efforts in helping to get these PRs through.

phenix1990 pushed a commit to phenix1990/openhab-addons that referenced this pull request Jul 31, 2025
* cherry pick approved addons from openhab#18585

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
phenix1990 pushed a commit to phenix1990/openhab-addons that referenced this pull request Jul 31, 2025
* [all] auto tagger

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Aug 6, 2025
* cherry pick approved addons from openhab#18585

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Paul Smedley <paul@smedley.id.au>
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Aug 6, 2025
* [all] auto tagger

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Paul Smedley <paul@smedley.id.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature for an existing add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.