How to define metadata with subkeys?

Hi folks,

does anybody know, how I can define metadata with subkeys in my item files? With the helper libraries for openHAB Scripted Automation its not a big deal, but in an item file I was not able to do so. I also like to know if or how I can define the metadata without the value and just the config if possible in an item file.

Here is an Item configured with meta data to do what I want it to do in an item file.

Dimmer Dining_fan "Dining Fan" { ga="Fan" [ speeds="0=off:zero,1=slow:low:one:on,2=medium:two,3=high:three:100", lang="en", ordered=true, roomHint="Dining" ], channel="mqtt:topic:myMQTTBroker:fan1:fanspeed" }

Thx for your example, but that’s not what I wanted. You have no subkeys just plain key-value-pairs. Seems I can’t defined what I want to define in an item file. In the example “Area Triggers and Actions” of the helper libraries for openHAB Scripted Automation I found the following text:

It is possible to add simple Metadata to Items through .items files, but this is very limited and does not support the hierarchical key structures used here.

Did you see the script to add metadata.

Yes, I saw it and I will do something similar.