[SOLVED] In sitemaps, how to create a view having item name and item value

I have an item:
Contact ZONE2_STATUS "Mudroom ext. door, Z2" <door> (DSCAlarmZones, FrontFoyer, DSCAlarmDoorWindow) {channel="dscalarm:zone:EnvisalinkBridge:zone2:zone_status"}
Now I am making a sitemap to display its value. So I have line like
Text item=ZONE1_STATUS label=“Z1 status [%s]” icon=“door”
and this displays "Z1 Status OPEN (or CLOSED)

For my next line I have:
Text item=ZONE2_STATUS icon=“door”
This displays Mudroom ext door (Z2)
but has no value.
So I am asking 'How do you display the content of an item name-value pair?
I would like the output to be
Mudroom ext door (Z2) OPEN

How do you do that?

How do you display the name-value of a name value pair.

I have 100 or so Things and several hundred items.

It would be unreasonable to expect me to type all this ‘discovered’ information in two times over. The names would never match!

  • Platform information:
    • Hardware:64-bit 12-core Intel
    • OS: W10
    • Java Runtime Environment: 1.8.0_192
    • openHAB version: 2.4.0

Change your item definition to:

Contact ZONE2_STATUS "Mudroom ext. door (Z2) [%s]" <door> (DSCAlarmZones, FrontFoyer, DSCAlarmDoorWindow) {channel="dscalarm:zone:EnvisalinkBridge:zone2:zone_status"}

And your sitemap:

Text item=ZONE2_STATUS

No need for the icon as you have already definined it in the item <door>
The parameters detailed in the item definition according to: https://www.openhab.org/docs/configuration/items.html#item-definition-and-syntax
Will be displayed in the sitemap as defined when you only specifify the item in the sitemap element.

You can override the item definition paramaters by adding label=... or icon=... in the sitemap element
As explained there: https://www.openhab.org/docs/configuration/sitemaps.html#element-types

Thank you!
Ideally, I would like to use the nices-names from discovery, but as I understand, that is not possible. I must retype the discovered items.
I know about the overide as that is what most example seem to show. I need to define nice-names as few times as possible as there are so many of them. So reusing the item nice-name definition in sitemaps works well. Then item=ZONE2_STATUS is really used as an id in layout structures and nice-name can be freely changed with out breaking the implementation.

I think! (one week on OpenHab)

Yes you do.
I recommend against using the names automatically generated by auto discovery
If possible change the things names to something YOU understand, like mudroomdoor_z2 for the thing
and maybe MudRoom_Door_Z2 for the contact items

Having a structured approach to naming you items will allow you to write more efficient rules

See: Who has got some clever ideas for item naming schemes?

And then:
Design Pattern: Associated Items from design patterns:
Design Pattern: What is a Design Pattern and How Do I Use Them