Selection with MAP-File

Text item=Radio_Station label="Sender [MAP(radioStation.map):%s]" {
Selection item=Radio_Station label="Sender" mappings=[0=off, 1=HR3, 2=SWR3, 3=FFH]

How can I use the MAP-File (like the Text-Line) in a Selection-Line?

I don’t think you can. If you could outline what you are trying to achive you might get a better answer.

I need the map-table in both lines and would like to define and maintain it once at one place.
So I’m looking for a instruction like maybe: Selection … mappings=MAP(radioStation.map)

No, afaik that is not possible. See here:
http://docs.openhab.org/configuration/sitemaps.html#mappings
Why do you need this? What is your goal? There is probably another way to Rome…

Hi Harry,

any solution for this in the meantime?

I have the same issue I think.
Have a number item whose state is mapped with a map transformation to some text. Works perfect.
But to use a selection I have to hard code the same text for all the 10+ different numbers in the sitemap again.

Of course this is possible, but to use the already existing map file for the selection would be much more easy to maintain and also lead to cleaner sitemap code.

Appreciate any hints.

Thx
Sebastian

2 Likes

Any innovative solution identified for MAP option ? pls suggest if any .

I wanted to do the same a while ago. In my case I had a generic rule which could then load the map file, and use the names to find associated groups. So by allowing this I could simply have one generic rule and one map file for each room to make some sweet lighting scenes, however this is still not possible in Openhab. So we just need to wait for this feature…