Skip to content
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

Add dynamic creation of semantic tags #3519

Merged
merged 1 commit into from
Apr 14, 2023
Merged

Conversation

jimtng
Copy link
Contributor

@jimtng jimtng commented Apr 2, 2023

Add the ability to dynamically add new semantic tags

For example, to add a new tag called MainBedroom with Bedroom as the parent:
SemanticTags.add("MainBedroom", Bedroom.class) or
SemanticTags.add("MainBedroom", "Bedroom")

The new tags can then be used in items and rules.

A text file in the following format can be easily loaded and parsed with a simple rule on startup in any scripting language.

NewTag(Label,Synonym1,Synonym2): ParentTag A long description can go here
SecretRoom: Room
SwimmingPool: Location
Motion: Status
Color: Property
Brightness: Property

or go full YAML... the syntax is up to the rule writer.

Currently the MainUI can recognise and display the added tags:

image

However, because MainUI uses a static list of tags (loaded from a file), it doesn't list the new tags in the tag selection dialog. More work is needed to provide a REST end point which the MainUI can then query rather than having to duplicate the list of tags in a static file like it currently does.

image

@jimtng jimtng requested a review from a team as a code owner April 2, 2023 07:23
@jimtng jimtng mentioned this pull request Apr 2, 2023
65 tasks
@jimtng jimtng force-pushed the semantics-add branch 4 times, most recently from 6dc968e to c5b9bab Compare April 2, 2023 10:29
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-4-0-wishlist/142388/455

@rkoshak
Copy link

rkoshak commented Apr 2, 2023

Does this break HABot? That's where the semantic model came from in the first place.

@jimtng
Copy link
Contributor Author

jimtng commented Apr 2, 2023

Does this break HABot? That's where the semantic model came from in the first place.

This merely lets you add more tags, not delete/alter existing ones. I don't see how it would break anything, although to be sure it would need to be tested by someone familiar with habot.

@rkoshak
Copy link

rkoshak commented Apr 2, 2023

My concern with HABot is it actually uses the semantic model to parse arbitrary text to understand the intent. Each semantic tag has a specific meaning to HABot. My worry is that arbitrarily adding them could potentially confuse HABot's human language processor if the new tags are not properly integrated into the ontology.

@jimtng
Copy link
Contributor Author

jimtng commented Apr 2, 2023

My concern with HABot is it actually uses the semantic model to parse arbitrary text to understand the intent. Each semantic tag has a specific meaning to HABot. My worry is that arbitrarily adding them could potentially confuse HABot's human language processor if the new tags are not properly integrated into the ontology.

While I haven't looked closely into HABot:

  • Adding more tags can most likely help it improve, if the intention of adding / tweaking was to improve it
  • The onus is on each individual user who added more tags to know that it may affect things.
  • For the rest of us who don't use habot, it is of zero concern, meanwhile the benefit for better organisation is tremendous to the rest (items / rules structure). So many people, myself included, have been begging to have this ability for years.

I can understand that adding new tags to openhab-core requires a serious consideration because it will impact everyone. That's why it's so difficult so far.

That's the beauty of this. What you add, only affects you, and you can easily undo it by restarting openhab. It is not persistent. You'll have to run a rule on OH start up every time to add your set of tags.

@rkoshak
Copy link

rkoshak commented Apr 2, 2023

Only if adding the tags actually works and doesn't break it. It would even be OK if the added tags are simply ignored by HABot. But based on past experiences working with ontologies (granted that was a decade ago), it's almost never as simple as just adding a new tag and away we go.

The onus is on each individual user who added more tags to know that it may affect things
For the rest of us who don't use habot, it is of zero concern, meanwhile the benefit for better organisation is tremendous to the rest (items / rules structure). So many people, myself included, have been begging to have this ability for years.

I don't think it's right to add a feature that can render a preexisting feature inoperable with the only mitigation being "well, you should have been more careful".

And while breaking HABot is of zero concern to you, it's not to me and everyone else who uses HABot (see https://community.openhab.org/t/self-hosted-notifications-with-nextcloud-talk/144090 for just one use case).

"I want it really badly" isn't justification for breaking things IMO.

@ghys, I hate to tag you but you are the resident expert on the ontology and developer of HABot. Are my concerns out of line and there really is no issue here, or does this have the potential to break HABot as I fear?

@J-N-K
Copy link
Member

J-N-K commented Apr 2, 2023

OTOH, using "it'll break something" can't be the reason for not going forward. It seems that HABot is not maintained anymore, so it should not be the reason to stop development in other areas.

That aside: I don't care at all, I don't use semantic tags.

@jimtng
Copy link
Contributor Author

jimtng commented Apr 2, 2023

While I understand your concern regarding its potential impact to habot, I don't understand why it shouldn't be added because of it. This doesn't do anything unless deliberately used.

I am sure there are many other things that fall in the similar category. One that instantly came to mind is sudo rm -rf /. One can type gibberish in a script, or drag and drop random blocks in blockly. Just because the rm command or the -rf option can potentially do damage, doesn't mean people shouldn't have it. These are extreme examples, of course. Being able to add more semantic tags is far from extreme.

On the contrary, those who want to add additional tags want to do so because they care about organisation and structure. This is not to say that those who don't, don't care about organisation.

@rkoshak
Copy link

rkoshak commented Apr 2, 2023

I'm not saying not to develop this. I would like to be able to add new semantic tags too.

What I am saying is let's make sure that we understand the impacts to other parts of OH and mitigate those impacts as much as possible.

"I don't use it so who cares" is a pretty hostile attitude towards the end users. That's in fact the exact stated reason for why a number of OH users abandoned HomeAssistant in favor of OH. Things break without warning because the developers don't care how it impacts the end users. I'd hate to see us heading in the same direction.

And if this does break HABot and if HABot is truly abandoned than let's just remove it (which would be a shame because one of the most magical things with OH is the ability to tell it to do stuff using natural language) rather than setting up a bunch of land mines for end users to find which blows it up. And this one will be found right away because those who use HABot are definitely going to want to use these new custom defined tags too.

Again, to summarize, I'm not saying "no don't do it!" I'm not even saying "no don't do it if it breaks HABot!" I am saying lets spend maybe just a couple of minutes or so to find out how it impacts HABot and if it does, how to mitigate any problems it may cause so end users don't just wake up one day and find HABot doesn't work because they added a custom semantic tag. I really don't think that's too much to ask.

@jimtng
Copy link
Contributor Author

jimtng commented Apr 2, 2023

I am saying lets spend maybe just a couple of minutes or so to find out how it impacts HABot and if it does, how to mitigate any problems it may cause so end users don't just wake up one day and find HABot doesn't work because they added a custom semantic tag.

Thanks for clarifying. Unfortunately I am not familiar with habot. The last time I "played" with it was uhm... when I first came across openhab in 2017-18 maybe. Waiting to hear from @ghys but would you also be able to test?

@J-N-K
Copy link
Member

J-N-K commented Apr 2, 2023

@rkoshak You should know that I always try to keep things as backward compatible as possible and to have smooth migration path when this is not possible. "Thing that break without warning" is really something that should be avoided and I don't think it is common in openHAB to have that. We have made a big step forward in avoiding such situations with #3330, especially for UI users.

What I wanted to express is: I don't use HABot and I don't use semantic tags. I have no preference for "not extending tags in favor of HABot" or "extending tags and dropping HABot".

Regarding the maintenance state: HABot can't be build on current Apple machines since more than two years because of outdated NodeJS (which also brings a ton of outdated dependencies).

@jimtng
Copy link
Contributor Author

jimtng commented Apr 2, 2023

I am saying lets spend maybe just a couple of minutes or so to find out how it impacts HABot

@rkoshak I was just thinking, is there a similar concern each time a new tag is added, or removed from the official list of tags in core? If so, is there a process in place to verify / test / check against habot? Perhaps we can utilise the same process.

@rkoshak
Copy link

rkoshak commented Apr 2, 2023

Waiting to hear from @ghys but would you also be able to test?

Yes as long as I don't have to build. I don't have a dev environment and I understand it's a heavy lift to do so.

But the test should be relatively simple I would think:

  1. make a query/command to HABot for something semantically tagged using the built in tags and verify that works as expected
  2. add a custom semantic tag
  3. repeat 1
  4. add the custom tag to an Item
  5. repeat 1
  6. create a query to HABot for the new custom tag

Obviously watch the logs for errors.

I think that would show if ti breaks and whether the new tag is available to HABot (which is less of a concern to me than steps 1-5 failing for some reason).

@rkoshak You should know that I always try to keep things as backward compatible as possible and to have smooth migration path when this is not possible.

I know you do and greatly appreciate that. It just seemed in this particular case that breaking HABot didn't rise to a level where it was even considered. I am happy that isn't the case.

Regarding the maintenance state: HABot can't be build on current Apple machines since more than two years because of outdated NodeJS (which also brings a ton of outdated dependencies).

I'd really hate to lose it but if it's slowly dying out maybe now's the time to just remove it.

@rkoshak I was just thinking, is there a similar concern each time a new tag is added, or removed from the official list of tags in core? If so, is there a process in place to verify / test / check against habot? Perhaps we can utilise the same process.

That's a really good question and I don't know the answer to it. I'll see if I can dig up an old PR that added a new tag. It's been a good while since the last tag was added but I seem to recall that it was more than just adding the tag.

@jimtng
Copy link
Contributor Author

jimtng commented Apr 3, 2023

Testing

Thanks for wanting to test.

  1. Make a copy of this file somewhere like ~/ or in openhab/conf/ runtime/system/org/openhab/core/bundles/org.openhab.core.semantics/4.0.0-SNAPSHOT/org.openhab.core.semantics-4.0.0-SNAPSHOT.jar

  2. Put this file in place of the above. This file is actually a .jar file. I appended .zip to the name so I can upload it here. Don't unzip it, just remove the extension off the end.
    org.openhab.core.semantics-4.0.0-SNAPSHOT.jar.zip

  3. Stop openhab

  4. rm -rf ~/userdata/cache/org.eclipse.osgi/ ~/userdata/tmp/* (assuming ~ = the openhab's main directory, otherwise adjust accordingly

  5. Start openhab

Then proceed with your tests that you've outlined.

In order to add a tag, use jsscripting or jruby. I'm not familiar with how to do this in jsscripting, so here's a jruby version:

org.openhab.core.semantics.SemanticTags.add("YourCustomTag", "ExistingParent")

# or:
org.openhab.core.semantics.SemanticTags.add("YourCustomTag", "ExistingParent", "Custom Label", "Synonym1,Synonym2", "Description")

Existing parent can be Property, Location, Equipment, Point, or any one of the other valid tags, e.g. Indoor, Room, Door, Control, Light, etc.

It won't let you use an invalid parent tag nor an invalid tag name, etc.
PS Currently you must enter the synonyms with no spaces around the commas. While writing this, I thought I should clean up the input.

The only way to remove the custom tags is by making sure your script doesn't run (e.g. comment them out) then restart openhab.

I'd really hate to lose it but if it's slowly dying out maybe now's the time to just remove it.

I think HABot is really cool. I just really haven't had the "time" to play with it / use it. It would be a shame to kill it. It probably just needs some TLC?

@rkoshak
Copy link

rkoshak commented Apr 3, 2023

org.openhab.core.semantics.SemanticTags

Given the name I'm guess that you are working with the actual Java Class here? In that case it's pretty straight forward. I just need to use Java.type to import it and the calls should be the same.

I'm currently upgrading to the latest snapshot. When that's done I'll give it a go.

Test results:
I first did a query and a command to HABot before going through the steps it patch the jar file per instructions above (paths were different because I'm running in Docker but I know the intent and how to translate) just to get a control before running the test.

The timing of the restart was a little off but it makes sense because we didn't clear the whole cache. But I saw a bunch of errors from Zigbee and my rules which I usually see in cases where there was a cache clearing so I restarted again to get a clean start before running the steps.

  1. worked as expected, same responses as the control.
  2. I used the ~Scratchpad~ with the following code:
var SemanticTags = Java.type('org.openhab.core.semantics.SemanticTags');
SemanticTags.add("Foo", "Light", "Foo tag", "FooBar,FooBarBaz", "New custom test tag");

This failed with:

2023-04-03 10:10:09.376 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'scratchpad' failed: java.lang.Exception: java.lang.NoClassDefFoundError: org/openhab/core/semantics/model/property/Light

I changed the parent tag to something more generic, "Property" and got the same error.

I tried the simpler call and this too failed with the NoClassDefFoundError.

So I'm stuck at step 2 until I get more direction. The good news is the add method seems to be there. It's just not working for me.

@jimtng
Copy link
Contributor Author

jimtng commented Apr 3, 2023

@rkoshak Thanks for testing. Please try this updated jar (also just .zip ext added, not actually zipped)
org.openhab.core.semantics-4.0.0-SNAPSHOT.jar.zip

The cache + tmp needs to be cleared again after replacing the jar.

@rkoshak
Copy link

rkoshak commented Apr 3, 2023

OK, let the testing resume!

I installed the new jar file pre instructions.

  1. worked as expected.
  2. No error in the rule so I'm assuming it worked
var SemanticTags = Java.type('org.openhab.core.semantics.SemanticTags');
SemanticTags.add("Foo", "Point");
SemanticTags.add('FooBar", "Property");
  1. worked as expected, so we have confirmation that the new tag doesn't break HABot. Now to see if HABot can see the new tag.
  2. I created a new Point Item through the model screen. The "Foo" tag was not listed as an option in the UI which is unsurprising. So I manually added the tags as regular old tags. I gave it the "Foo" point tag and "FooBar" property tag. I placed it into an existing "Lightbulb" Equipment which is the same equipment I've been using for the "control" tests.
  3. and 6.
    a. The good news is it sees the Point tag but it doesn't see/understand the Property tag. I can ask it to "what's the Foo in the living room" and it finds the Item. However, if I ask "what's the FooBar in the living room" it says it can't find it.
    b. When I say "show me the lights" the Foo Item appears along with all the other lights. That is probably because of the Equipment it belongs to more than anything else.

In summary, merely creating the custom tags does not break HABot. However, it appears that more needs to be done to make HABot aware of custom Property tags. I didn't test Equipment nor Location yet but given that the custom Point worked, I expect those will work too. I'll test that though as well as testing what happens if I use something like "Light" as the parent Point tag.

@rkoshak
Copy link

rkoshak commented Apr 4, 2023

Try calling it Foobar not FooBar.

Neither "Foobar" nor "foobar" worked but "foo bar" did work. So it uses camelcase to determine where spaces should go? This is kind of exciting! It looks like it might work after all, but we will have to document pretty closely how it works when using camelcase like that.

Also, can habot understand it when you used an existing property tag in the same manner eg LightTemperature or even a single word property?

Yes, all the built in tags work. But you are right, the tag is "LivingRoom" but in the query I have to use "living room". Interestingly it doesn't seem to use the Item label in the query. The Item I have tagged with "LivingRoom" is labeled "Family Room" and HABot can't find it. But that's a concern for a different issue. It just cost me a bit of time thinking it wasn't working when it was and my query was wrong.

I created a single word "Dog" tag with "Property" as the parent and applied that to my test Item and "show the dog in the living room" worked.

So maybe it is working after all and the problem was I used a multiword tag and didn't know it.

Question, I've made a couple of assumptions:

  1. when restarting OH these tags go away, at least for now
  2. if I call to add a custom tag that already exists, it changes it; for example, if I wanted to change my "Dog" tag to use "Light" as it's parent I can just update and run my script again

1 is understandable at the current state of the PR. If my assumption is wrong, as it appears to be, 2 needs to throw an exception (similar to how it does when trying to use a tag that doesn't start with a capital) or at least a warning log statement if it's really just ignoring the change.

If my assumption for 2 was correct, after changing the "Dog" tag to inherit from "Light" I was unable to query for and get it to show up along side all the other Items tagged with "Light". However, looking at the Item seems to indicate that it never changed:

image

The class still shows Property_Dog, not Light_Dog.

Creating a new "Cat" tag that inherits from Light shows:

image

And indeed queries for lights now show the test Item as expected.

Tl;dr, it seems all the problems I've encountered are my own and not the code. This is awesome!

@jimtng
Copy link
Contributor Author

jimtng commented Apr 4, 2023

At its current incarnation, you cannot re-add an existing tag. It checks against existing tags (built-in or otherwise) and will simply return null and do nothing.

It is documented that it returns null in this case, but I see that a warning logger is probably needed as well.

CamelCase tagname generates Camel Case label, IF you haven't specified a label when calling add, i.e. just using two arguments to add. This is also documented.

@jimtng
Copy link
Contributor Author

jimtng commented Apr 5, 2023

It is documented that it returns null in this case, but I see that a warning logger is probably needed as well.

@rkoshak I go back and forth about this, but I prefer not to issue a warning log. Instead let the caller handle it. The method will return null to indicate this, so if the caller wants to issue warning they can do so themselves. This gives people the freedom to choose the behaviour rather than forcing it on them.

if (Semantics.add("newtag", "parent") == null) {
  logger.warn("Adding failed - newtag already exists")
}

@rkoshak
Copy link

rkoshak commented Apr 5, 2023

This is also documented.

Just to be clear though, by documented I mean the behavior needs to be described in the OH docs, not just in the code. End users are not going to go read comments in the code nor refer to the JavaDocs for the most part. Because this is a completely new capability from the end user's perspective, nothing about creating new semantic tags appears anywhere in the user guide.

It probably also makes sense that the code that adds/removes?/modifies? semantic tags be exposed as an Action if we are thinking this is something a user may want to do from a rule. I'm thinking that is probably not the best idea and tags should only really be manipulated through the REST API/UI/Karaf Console, but I don't always see all the use cases.

Instead let the caller handle it.

As long as the caller isn't a rule I think I'm OK with that, so long as it's clearly documented at the level of the caller (e.g. if at the REST API it should be clear in the swagger docs what indicates success, ignored, or problem).

@ghys
Copy link
Member

ghys commented Apr 5, 2023

Again, to summarize, I'm not saying "no don't do it!" I'm not even saying "no don't do it if it breaks HABot!" I am saying lets spend maybe just a couple of minutes or so to find out how it impacts HABot and if it does, how to mitigate any problems it may cause so end users don't just wake up one day and find HABot doesn't work because they added a custom semantic tag. I really don't think that's too much to ask.

I agree fully with this. The request to let users expand the semantic model seems to come every other year or so, including when the feature was discussed at the time when it was merely in the plans (eclipse-archived/smarthome#1093) and had yet to be implemented - until now I guess.

If HABot hasn't received much attention, this isn't because it's not maintained anymore, it's rather because "it works" and I moved on to other things - but I would be sad if it broke for no good reason. As the author I'll admit I rarely use the dedicated HABot UI these days but I still regularly use the text box on the main UI home page, mainly to recall controls from keywords ("kettle", "kitchen lights"...) that I haven't properly put on a page so they're accessible easily, and would be 3 to 4 clicks away if browsing through the semantics cards on the other tabs of the home page.

HABot is kind of test-driven, there are extensive tests to exercise the bundled skills in every language HABot supports - you can see the output about 3/4 of the way in the build logs (https://ci.openhab.org/job/openHAB-WebUI/611/consoleText)

----
"change the corridor lights to 70%"
{0.9491474334451203=[set-value], 0.022335667955037122=[get-status], 0.01294666887947513=[deactivate-object], 0.010717567115524455=[activate-object], 0.001731931115492209=[get-history-last-changes], 0.0012824703029145064=[get-history-monthly], 7.640074801369204E-4=[get-history-daily], 4.94159508736749E-4=[get-history-weekly], 3.533538500641698E-4=[get-history-hourly], 2.2674034749846687E-4=[create-rule]}
Intent [name=set-value, entities={location=corridor, value=70%, object=lights}]
----

If those didn't pass, for any reason, then the web UI builds would fail. I would expect any author of a change that has an impact in this area to own up to the regression they introduced and strive to fix it themselves ;)

@ghys
Copy link
Member

ghys commented Apr 5, 2023

In summary, merely creating the custom tags does not break HABot. However, it appears that more needs to be done to make HABot aware of custom Property tags. I didn't test Equipment nor Location yet but given that the custom Point worked, I expect those will work too. I'll test that though as well as testing what happens if I use something like "Light" as the parent Point tag.

And I'm grateful to @rkoshak for doing all this testing! Having some more Properties added could indeed cause HABot to behave slightly differently (because its training would be different) and could have an impact on the tests, this would be solved with some more training material.

@rkoshak
Copy link

rkoshak commented Apr 5, 2023

Having some more Properties added could indeed cause HABot to behave slightly differently

I've still a bunch of tests to do but it does appear that my initial assessment was caused by using "FooBar" as the Property tag and querying HABot for "foobar" (single word). Once I got that working HABot was able to see and return the Item and control it based on the "foo bar" tag. And it worked with "dog" and "cat" too as single word tags. I made "cat" have "light" as the parent and HABot even recognized "cat" as a light which was really cool.

It seems like HABot might be treating these new tags as synonyms perhaps? It would be interesting to custom build a whole hierarchy and see how far it goes. If I add a tag that has "cat" as a parent, will that tag be recognized as a "cat" and a "light"?

@ghys
Copy link
Member

ghys commented Apr 6, 2023

It's hard to say, but there is some code to feed any "attributes" available (meaning, tags & synonyms including those by the user) to the trainer to improve the recognition of those entities.

https://github.com/openhab/openhab-webui/blob/6cbc0a021811412d0d86fa0f2a103ae054a0a211/bundles/org.openhab.ui.habot/src/main/java/org/openhab/ui/habot/nlp/internal/OpenNLPInterpreter.java#L135-L156

If OpenNLP is involved at all (remember, it isn't if you just state the label of an item in which case it will merely return a card with the item's members if it's a Group), then any deviation in the training might lead to different results.

The outcome of these tests can be relied upon because the set of training is predetermined, but in practice it isn't because of the code above.

HABot is no ChatGPT, of course, but the basic principle remains the same: the more you train it, the better it becomes.
The balance to find is to give it sufficient training so it is useful, but not too much so it still runs on Raspberry Pis.

@J-N-K J-N-K added the enhancement An enhancement or new feature of the Core label Apr 10, 2023
@J-N-K
Copy link
Member

J-N-K commented Apr 13, 2023

If those didn't pass, for any reason, then the web UI builds would fail. I would expect any author of a change that has an impact in this area to own up to the regression they introduced and strive to fix it themselves ;)

@jimtng Did you check if web still builds with this changes? I can't test that because as I said above: HABot can't be build on Apple Silicon processors.

@rkoshak @ghys If the build is ok, is there anything that prevents this from being reviewed and merged?

@rkoshak
Copy link

rkoshak commented Apr 13, 2023

I'm good. There are still some tests I want to run just to find the limits of what works and what doesn't but I've been able to confirm:

  • custom tags do not break HABot
  • HABot surprisingly can see and recognize the custom tags
  • HABot can see and use the custom tags logically based on the parent tag (e.g. if the new tag uses "Light" as the parent, HABot will recognize that tag as a light)

There should be no surprises for the end users unless they really go deep and create some big new hierarchy of tags (I still don't know what will happen in that case).

So as far as I'm concerned it's all good and I'm looking forward to adding some custom tags. :-D

@jimtng
Copy link
Contributor Author

jimtng commented Apr 14, 2023

@jimtng Did you check if web still builds with this changes? I can't test that because as I said above: HABot can't be build on Apple Silicon processors.

I'm not sure how to do this, but I've built the entire openhab-core repo and openhab-webui repo on linux on the same machine but I didn't combine them into a running instance. Does that count, or is there a special step to verify? I've never done a full distro build.

Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@J-N-K
Copy link
Member

J-N-K commented Apr 14, 2023

That should work.

@lolodomo
Copy link
Contributor

Why do we need a script/rule to extend semantics? Until now, everything was doable through REST APIs. Why not in this case? The choice looks strange and unusable.
But I probably miss the good reason leading to this solution.

@jimtng
Copy link
Contributor Author

jimtng commented Apr 24, 2023

This API is needed as the primary mechanism to create the tags. Using a script is the easiest method to invoke this API.

REST interface to create the tag can be added later on + its corresponding MainUI user interface. Hence the two additional PRs linked to this to lay the ground work towards that:

#3559

openhab/openhab-webui#1850

Once those two are merged, then we could add the support to create the tags from the UI.

@lolodomo
Copy link
Contributor

What we need is a REST API to add/remove semantics tags. They need to be stored somewhere to survive a OH restart.
To be clear, being consistent with everything else in OH.

@jimtng
Copy link
Contributor Author

jimtng commented Apr 25, 2023

What we need is a REST API to add/remove semantics tags. They need to be stored somewhere to survive a OH restart. To be clear, being consistent with everything else in OH.

Yes, I understand and agree. There needs to be a semantic tag provider.

Removing semantic tags without restarting openhab would be great too.

ghys pushed a commit to openhab/openhab-webui that referenced this pull request Jun 28, 2023
)

Supersedes #1850.
Closes #1822.

Depends on openhab/openhab-core#3559 (already
merged now).
Adding custom semantic tags is now possible:
openhab/openhab-core#3519.

This PR loads the Semantic tags when MainUI is loaded the first time and
stores them in Vuex.
This allows the removal of the hard-coded Semantic tags and the
translations from the assets and therefore makes the initial JS smaller.

--
Signed-off-by: Florian Hotze <[email protected]>
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/ideas-and-discussion-what-features-do-you-want-in-openhab-5-0/160573/260

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 of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants