Skip to content

Configuration: Predefine useTags #1774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

andrewfg
Copy link
Contributor

Depends on openhab/openhab-core#4913

Signed-off-by: Andrew Fiddian-Green [email protected]

Signed-off-by: Andrew Fiddian-Green <[email protected]>
@andrewfg andrewfg requested a review from a team as a code owner July 24, 2025 19:10
andrewfg added 3 commits July 25, 2025 09:29
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
@andrewfg andrewfg changed the title Configuration: Predefine alwaysUseTags Configuration: Predefine useTags Jul 25, 2025
@andrewfg
Copy link
Contributor Author

@rkoshak / @lolodomo / @jimtng in 4913 it was asked if useTags can be the default for new users and not (a breaking change) for existing ones. I think this file is installed on new installations but will not overwrite existing ones. So I think if this file has useTags=true then it would fulfil your requirements. Or?? => WDYT?

@mherwege
Copy link
Contributor

I think this file is installed on new installations but will not overwrite existing ones.

Are you sure about this? Apt may overwrite this when it was not changed by the user (and show a conflict but not overwrite when it has). So I would be very careful with this.
I am not a big fan of enabling this by default as the outcome will always be somewhat unpredictable. There is no full documentation of the default tags being applied for each channel (except in the code). There may be tags applied to some items you do not want to be tagged. There may be items linked to multiple channels leading to unpredictable results (I know it is logged). I for sure will make sure it is disabled. As I understand it, this setting also has an impact on managed (UI) configurations. It would be very surprising to suddenly get semantic tags not defined on the item but still being applied for a full UI based configuration for items without semantic tags. This goes against the principle of proposing tags at configuration time and then setting it (or not) on the item.

@lolodomo
Copy link
Contributor

The change looks good, the parameter is commented and so default will be used

To avoid any change of behaviour for existing OH instances, I finally believe it is better to consider it disabled by default.
Power users like me will enabled it because we know the impact and want it.

@andrewfg
Copy link
Contributor Author

Ok. So I will leave this PR as is.

Signed-off-by: Andrew Fiddian-Green <[email protected]>
@andrewfg andrewfg requested a review from jimtng July 29, 2025 09:25
@@ -289,4 +289,4 @@

# If enabled, the ItemChannelLink Registry will always try to apply any tags from linked Channels to the respective Items
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe say here "...try to apply any tags from the first linked Channel of the respective Item" ?

I am not really sure how to word it more precisely. The general idea is that only the first link (with tags) gets to apply its tags, not all the links of the item.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or perhaps leave it as is, and provide a more detailed explanation in the docs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provide a more detailed explanation in the docs

=> openhab/openhab-docs#2529

Signed-off-by: Andrew Fiddian-Green <[email protected]>
@rkoshak
Copy link
Contributor

rkoshak commented Jul 29, 2025

Are you sure about this? Apt may overwrite this when it was not changed by the user (and show a conflict but not overwrite when it has). So I would be very careful with this.

That's the part I'm unsure of also. I didn't think apt/yum replaced this file after the first install but I don't know that I would know if it did so for files I've never changed.

It also occurs to me that if it were uncommented, that would take precedence over a change to this parameter made through the UI so UI users wouldn't be able to change it without editing the file later.

Commented out is the way to go.

@andrewfg
Copy link
Contributor Author

take precedence over a change to this parameter made through the UI

Our assumption is that we are dealing with power users who are fluent with text files, so there is no code that would allow this to be changed via the UI.

@rkoshak
Copy link
Contributor

rkoshak commented Jul 29, 2025

Our assumption is that we are dealing with power users who are fluent with text files, so there is no code that would allow this to be changed via the UI.

Right, but if it is uncommented by default it would change the behavior for all users with no way to change it back short of editing the file. That's my point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants