Is it possible to use a MAP transformation in the label for an item in a sitemap, but for the actual item label, and not the item value?
Obviously, not a big deal, but if I’m defining friendly names in one place, it would be nice to keep that just in the MAP, and not a number of different files.
I have a device_names.map file, with:
item1 = Item 1 Friendly Name
In a sitemap, for an item, the following fails to transform, I just get the string ‘MAP(…’ as the label:
Default item=item1_Battery label=“MAP(device_names.map):item1 [%.0f %%]”
This does transform, but since it is between the [], it is in the ‘value’ position:
Default item=item1_Battery label="[MAP(device_names.map):item1]"
Note that a transform in the label can only transform the state of the Item, not the Item’s name. And it cannot transform any arbitrary string or value. It can only transform the state.
If you want a friendly name for your Item, well, that is what the part before the [ ] in the label is for.
Switch item1_Battery label="Item 1 Friendly Name [%s]"