How to implement "Selection" feature known with sitemaps within pages

Has anybody an idea how I have to configure the “Selection” feature known wtih sitemaps within the pages environment? There are several widgets, however I have not discovered which one to use and to configure.

Use an oh-label Item and set the Action to “Command Options”. Fill in the list of value=label options in the Command Options field. When you click on the Item a sheet will side up from the bottom with all the labels in the list. Clicking on one will sent the corresponding value as a command to the Item.

@rlkoshak
Hi Rich

Thank you very much for your reply. It works like that, I get a pop-up with my definied options, i.e.
1=Comfort, 2=Standby, 3=Nacht, 4=Frost/Hitzeschutz. However, when I have choosen the value and pop up disappers, the number is shown in my item list and not the speaking word (e.g. Comfort). Could that be changed, so that the word is shown instead of the number?

My second question: Is it possible to integrate this in my textutal .items file? At the moment I have:

Number Betriebsart { channel=“knx:device:bridge:AKH_UG:UG_Wohnen_Heizung_Betriebsart”, listWidget=“oh-label-item”[action=“options”, actionOptions=“1=Comfort, 2=Standby, 3=Nacht, 4=Frost/Hitzeschutz” ] }

However, unfortunately this does not work . How would it need to be coded correctly?

Thank you in advance for your help

Well, you’ve defined the value as 1, 2, 3 and so on. So that’s the command that gets sent to the Item and that’s the state of the Item. If the Item state need to be the word, use that to the left side of the =. Comfort=Comfort.

Or if you do need the Item, then you need to use a Map transform to convert the number to a word. Set that in the State Description metadata’s Pattern field the same as you would an Item label. MAP(mapfile.map):%s where mapfile.map is the file where you defined the mappings between the number and the word.

Yes. It’s all Item metadata. Look at the code tab when you define the Item metadata. At the top of screen you’ll see something like Edit Item Metadata: stateDescription. That last part is the namespace. Then you’ll see a value and config. Those are all represented in the items file as

namespace="value"[config1="config1", config2="config2"]

given

the metadata would be

stateDescription=""[pattern=" ",readOnly=true]

or something like that. I don’t use .items files any more and am stepping back from supporting them here on the forum. I’d rather spend my time elsewhere right now and helping out with syntax errors in text configs is a huge time sink.

Hi Rich

Thank you very much for the answer. For the first point, I guess there will be a mapping needed. For the second point, I understand your point. However, with many items, I find it faster to do the configuration in a textual format, but maybe I have not found the trick how to do it fast in the main ui. In any case I tried to follow your guide, but came to the same result as already posted by me, which does not work.

Thank you for your help

I find that most of the time when people feel that, they are completely disregarding the time they spent debugging syntax errors and the like. I’m not convinced that text files actually are faster once that’s taken into account. I know they aren’t for me. They might be for some people but I doubt it. Especially when you need to add in managing the model and all this new Item metadata.

The fastest way to create Items in the UI is to “Create Equipment from Thing” or “Create Points from Thing”. You can create dozens of Items in just a few minutes that way.

If you want to duplicate an Item with only slight differences and you don’t want to make it a part of the model, querying for the Item using the REST API Docs and editing and posting the JSON through the REST API Docs to create the similar Item is also a pretty quick way to create lots of similar Items (or Things or Rules). For stuff that is not Items, you don’t have to use the REST API Docs at all. You can use the Code tab to copy/create/paste/edit.

When customizing Item’s appearance, the best thing to do is to create a Custom Widget (under Developer Tools) and then apply that one widget to all the Items that need to look like that. You can even set properties to customize the widgets a little for each time you use it.

What is the YAML that is generated in the Code tab when creating this via the UI? Can you share it? It should be able to be used to generate the Items file.

Hi Rich

Of course I don’t dare to disagree with you, since I’m much less elaborate with this system than you are, I’m just thankful that you guys take the time the help people out, who don’t understand the things so well. Btw: thank you for the hints how to more efficiently use main ui in configuring the system.

Regarding the topic: I finally managed to to resolve the issue:

  1. Mapping the state did the trick for the first issue (that was even expected for me)
  2. I had to change the “command options” part from within the “oh-label-item” metadata to the self standing Command options metadata (i.e. namespace “commandDescription”). The textual configuration worked then too. Btw: I also observed that when using the “command option” within “oh-label-item” that values were not really sent to knx, i.e. the status of the actor did not change (which I monitor with a seprate item). So in the end the only thing I don’t understand is why “Command options” lives at two different places and I also don’t understand the difference between the two; i only can say that the second approach works, whereas the first one doesn’t