-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[OmniLink] Add semantic tags to channels #11100
Conversation
Hi @ecdye , have not yet played with adding semantic tags to the thing definition xml yet, definitely peaked my interest! After looking up the documentation, it seems to be limited right now to a small number of tags, not sure if the documentation is up to date, but curious where the tags you are using come from? The docs at https://next.openhab.org/docs/developer/bindings/thing-xml.html#default-tags states: "Please note that only tags from a pre-defined tag library should be used. This library is still in development., and only a very small set of tags are defined so far:"
|
Yeah, i figured the docs might be out of date and some precedence was being set elsewhere, thanks for pointing out those PRs. |
No problem, a user pointed it out to me on the forums and asked if I was willing to implement this because many of us have large numbers of lights and other devices that can be a pain to manually tag one at a time. |
This Is controversial. Please read the PRs I submitted, @kaikreuzer does not like the current approach consisting in adding tags on many channels. |
@digitaldan I don't know if they are documented, but here is how I find them... http://www.pcmus.com/openhab/semantic.png Why add them? See this picture of my locations and note the Exclaimation mark, this is what appears when an item is marked as an Alarm and it's state turns ON. The temperature shows up when 'Measurement' and 'Temperature' is tagged and these are POINTS directly in the location, must not be under an equipment. 'Control' and 'Light' gives the locations a number of how many lights are turned ON in that location.. etc. http://www.pcmus.com/openhab/locations.png Note that this only takes effect if you create the items AFTER the binding is already updated and the user is offered the ability to change the tags when the items are created. Personally I believe the framework could be made to not need the tags added for some use cases, unless it increases the complexity of the core too much then it is probably easier to leave it to tags as a binding maintainer will have better grasp on what is a good set of tags. One example is a channel that uses Number:Temperature and also marked as read only, if there are no binding tags should the core treat it as 'Measurement' and 'Temperature' ? My opinion in this case is yes. Another example is a color channel in the WLED binding. These led light strips can have a primary color and second color selected and then the light will alternate between these two colors. The fact that the color item has an ON state is wrong as the light can be turned OFF, so you really don't want the sematic labels showing that a room has a light left on then the light is OFF. Marking every color item as a 'Control' for a 'Light' in this case is wrong. I have had to work this out myself, I have not seen any guidance on the topic anywhere. |
bundles/org.openhab.binding.omnilink/src/main/resources/OH-INF/thing/thermostat.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.omnilink/src/main/resources/OH-INF/thing/unit.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.omnilink/src/main/resources/OH-INF/thing/unit.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.omnilink/src/main/resources/OH-INF/thing/unit.xml
Outdated
Show resolved
Hide resolved
Any updates on this PR? What needs to be done before it can be merged? |
Bump |
@lolodomo Has there been any update on if this is going to be the accepted approach or not? If it is not, then can you point me to what is so I can update the PR. |
Unfortunately, this approach was more or less rejected without any concrete alternative. |
@lolodomo A follow up question, if by all technicality this works as of right now's there any problem with implementing it as is until a better solution has been created/decided. @kaikreuzer Your input would be welcome as well. Personally I believe that for the moment we should at the very least allow this sort of workaround to make the user experience better until a better solution is made. Especially because even advanced users like myself don't take the time to create very custom pages in the webUI. Just imagine the beginner user who is trying to add these items and then never finds them because the were not tagged properly in the model. I personally see the overview tabs / semantics tabs as very powerful if used correctly for all users which could make openHAB easier to get into for the average user as they have understandable and readily available access to their devices directly from the home page without having to go manually create a sitemap which IMHO is actually a very daunting task for a brand new home automation user. |
Let me add an example that might make this choice less obvious, or at least add something more to think about. In the Miele@home binding there are temperature channels for an oven - a target temperature and a measured temperature. Both are read-only since the API doesn't allow setting the target temperature, unfortunately. So in this case it would be wrong to treat it as a measurement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few generic comments added as I don't know this binding.
bundles/org.openhab.binding.omnilink/src/main/resources/OH-INF/thing/bridge.xml
Outdated
Show resolved
Hide resolved
...g.omnilink/src/main/java/org/openhab/binding/omnilink/internal/OmnilinkBindingConstants.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.omnilink/src/main/resources/OH-INF/thing/audio-zone.xml
Outdated
Show resolved
Hide resolved
@jlaur : for your information,, @kaikreuzer is generally against this approach consisting in adding semantics on a lot of channels. So before merging, maybe you should have his agreement. I imagine he agrees only when the semantic is obvious for the channel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that I never commented here.
I just had to recap myself on the semantic tags. I think my main concerns where tags, which weren't 100% obvious that they are correct like in this or that case.
Seeing the issues that users have with manually tagging items through the Main UI right now, I would agree that it is absolutely fine and welcome to add tags in the obvious situations - like I consider those in that PR.
So from my side it can be merged, once @jlaur's comments are addressed.
This is a breaking change for users using UI to setup things/channels. Replacing the channel type of a channel is a breaking change. They will have to delete and create again the concerned things. It just means that a new entry is expected in the file update,ps1 in the distro repo after the merge. |
Please see #11668 (comment) |
My feeling here is that we are EXACTLY in the case of the hue binding where existing channel types were replaced by system channel types. This lead to many complaints in the community forum (do a search) because users did not see anymore their channels (in the thing UI) until they remove and create again the thing (meaning all channel links have to be redone). I am not discouraging this change, I am even in favour of this change. I just want that we alert the users. One time again, this change is fully transparent for any user like me who relies on config files. |
I don't know the details of that case. But I tested (while working in 3.2) that changing channel type id while preserving channel id and item type does not cause any problems after openHAB has been restarted. If this scenario is the same as you have bad feelings about, I can only encourage you to try it out also for certainty. |
Yes, I should probably just to convince myself. Did your test match exactly this case ? |
Signed-off-by: Ethan Dye <[email protected]>
Signed-off-by: Ethan Dye <[email protected]>
Signed-off-by: Ethan Dye <[email protected]>
Signed-off-by: Ethan Dye <[email protected]>
Signed-off-by: Ethan Dye <[email protected]>
Force pushed to bring branch up to date with head. |
Signed-off-by: Ethan Dye <[email protected]>
Signed-off-by: Ethan Dye <[email protected]>
@ecdye - please update resources/OH-INF/i18n/omnilink.properties according to new keys in XML files. |
My test was exactly the case of changing channel type id while preserving channel id and item type. This worked in 3.2 (didn't test earlier versions) after restarting openHAB. I still don't know the exact Hue case, so can't compare. But the concern raised for this PR seems to match what I previously verified not being a problem. |
Signed-off-by: Ethan Dye <[email protected]>
@jlaur Fixed, I think we are ready to merge. |
bundles/org.openhab.binding.omnilink/src/main/resources/OH-INF/thing/lock.xml
Outdated
Show resolved
Hide resolved
Signed-off-by: Ethan Dye <[email protected]>
@jlaur : what is your status ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good!
Looks good to me also.
I didn't verify everything, but it seems correct. Since migrated to using system channel types, the labels/descriptions had to be moved from custom channel types to channels directly, which meant also changed i18n keys. |
I let you the lead to merge this PR. |
@ecdye : please keep an eye on the community forum, in case users complain about channels having disappeared. |
* Add semantic tags to channels * Use system channels where possible Signed-off-by: Ethan Dye <[email protected]> Signed-off-by: Nick Waterton <[email protected]>
* Add semantic tags to channels * Use system channels where possible Signed-off-by: Ethan Dye <[email protected]>
* Add semantic tags to channels * Use system channels where possible Signed-off-by: Ethan Dye <[email protected]>
* Add semantic tags to channels * Use system channels where possible Signed-off-by: Ethan Dye <[email protected]> Signed-off-by: Andras Uhrin <[email protected]>
* Add semantic tags to channels * Use system channels where possible Signed-off-by: Ethan Dye <[email protected]>
Signed-off-by: Ethan Dye [email protected]