Tagging a MainUI rule only possible via the API-Explorer?

I might be missing some obvious points, but I am only able to tag a rule (with “Schedule”) via the API-Explorer. I tagged other rules before, however I don’t recall this necessary sidestep.

System running OH 3.3 Release Build.
Logged in as Admin on MainUI

Just tried, Add Tag, enter „Schedule“, press enter and the tag is shown….

Thanks for that one, of course it works (as before). However I had to move to a real computer, not a mobile device. Maybe an external keyboard for the tablet would have worked as well, can’t tell because I don’t have one.

I tried on my iPhone and it worked :wink:

1 Like

In thiis case it seems to bean android problem (checked with Chrome and the buildin Samsung browser). The “enter” button (which is labeled “Weiter” [ german for continue]) is probably not sending the expected keycode.

1 Like

I had never tried this before from the android app, but I can confirm that at least on version 2.20.0 of the app, the tag text does not get properly sent. Sounds like it might be worth filing a issue.

1 Like

What do you use the tags for?

The tags are searchable from the search box at the top of the page so the tags are very handy for helping reduce a long list of rules to a short sub-set when looking for something.

In my case, I use them for a couple of things. I have a system of tags that show the general function of the rule, e.g., Lighting or Presence etc. I then also use tags to give me a quick idea of what kind of action the rule has. For example all my rules that use scripts written with the JSScripting add-on are tagged JSs. This was very handy when I recently took the time to convert all my old nashorn scripts to JSscripting. All my nashorn scripts were tagged with Nash, so I could just type that into the search box and see a list of which rules I hadn’t updated yet.

Other uses for tags on rules:

  • There are hints that rules might become incorporated into the semantic model. In the UI now you can apply semantic tags to rules as well as your own arbitrary tags.

  • Tags control where a rule appears. If you have a rule that consists of a single Script Action and nothing else, when it’s tagged with “Script” it will appear under Scripts in MainUI instead of under Rules. If the rule has a time based trigger and has the tag “Schedule” it will appear on the calendar under Schedule.

  • If you access the RuleRegistry, you can get rules by tag. That can be useful for situations like, for example, disabling all the lighting rules when you are away and the like. Just like adding an Item to a Group, you can add a tag to a rule and iterate through the list retrieved from the registry. I don’t know if jRuby exposes the RuleRegistry and I’m pretty sure that JS Scripting does not so this would be a relatively advanced capability for most users.

  • External scripts that query the REST API could use tags to group related stuff, like Items, Things, and Rules.

Something I’ve been thinking about pursuing but haven’t for now because of time constraints was seeing if we could get the tags added to the events from Items, Things, and Rules. Then adding a filter to the event stream in the Developer Sidebar to show events with a given tag. It’s a big deal though because it needs changes to core as well as the UI and it might have a big impact on performance. It’s not clear the benefits justify the expense. But that would be another use for tags.

At a minimum I’d like to see the search in the Pinned Objects tab to be tag aware so we can search for a tag and get all the Things, Items, and Rules that are related to each other.