String Item with mapped values

With openhab it was possible to create selections in a sitemap with the mapping configuration for a string item, example:
Selection item=vac_actionRoom mappings=["Bureau"="Bureau","Hal"="Hal","Berging"="Berging"]

This is handy, however the downside here is that only your sitemap know what possible values there are. Habpanel or the new Pages in OH3 have no clue what possible values there available.
I thought it wasn’t possible to define the possible mappings on the item itself only the sitemap.

But now I discovered that some items that are connected to a thing have this option.
Example:

String vac_actionControl  "Stofzuiger Acties"  <smoke>   (gVac,gVacCommand)  {channel="miio:vacuum:robot_vacuum:actions#control" }
String vac_actionRoom "Kamer Stofzuigen" <smoke> (gVac,gVacCommand) {expire="5s,NULL"}
Number vac_fanCommand     "Fan Command"      <fan> (gVac,gVacCommand)   {channel="miio:vacuum:robot_vacuum:actions#fan" }

The item vac_actionRoom is my custom string item, and as you can see the other are a number or a string item connected to a thing through channel.

In a page I created a group popup which result in this:
image

How does the 2 other items from the thing have a selection menu ? How can I implement this with my custom Item ?

Look into Item metadata, state options.

Thank you so much!

Following configuration was the solution:

String vac_actionRoom "Kamer Stofzuigen" <smoke> (gVac,gVacCommand) {stateDescription=""[options="Bureau=Bureau, Hal=Hal, Berging=Berging"]}
1 Like