openhab-core: Transformations ignored, when state description options are available
I’m using openHAB 3.1.0.M3 on docker.
When defining an item with a transformation to change the displayed name, the main UI ignores the user supplied transformation and gives precedence to the “State Description” options.
In the example snippet below, taken from the REST call to rest/items/Kinderzimmer2_Sicherheit_Fensterkontakt, the options are set by the homematic ip binding and therefore cannot be changed or deleted.
...
"state": "CLOSED",
"transformedState": "geschlossen",
"stateDescription": {
"pattern": "MAP(de-default.map):%s",
"readOnly": true,
"options": [
{
"value": "CLOSED",
"label": "Window status: locked"
},
{
"value": "TILTED",
"label": "Window status: tilted"
},
{
"value": "OPEN",
"label": "Window status: open"
}
]
}
...
Item state in main UI is displayed as Window status: locked instead of the transformed state geschlossen.
The following map file was used:
TILTED=gekippt
CLOSED=geschlossen
OPEN=geöffnet
=-
For MAP transformations a workaround would be to type in the mapping from the mapping file into the options field of the state description. Configuration for the state description then looks then something like this:
value: " "
config:
options: TILTED=gekippt,CLOSED=geschlossen,OPEN=geöffnet,=-
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 16 (10 by maintainers)
Commits related to this issue
- SseItemStatesEvent displayState: priority to transform over options Fix #2283 This PR is fixing two things in the computation of the displayState: - If a transformation is present in the state patte... — committed to lolodomo/openhab-core by lolodomo 3 years ago
- SseItemStatesEvent displayState: priority to transform over options Fix #2283 This PR is fixing two things in the computation of the displayState: - If a transformation is present in the state patte... — committed to lolodomo/openhab-core by lolodomo 3 years ago
- SseItemStatesEvent displayState: priority to transform over options Fix #2283 This PR is fixing two things in the computation of the displayState: - If a transformation is present in the state patte... — committed to lolodomo/openhab-core by lolodomo 3 years ago
- SseItemStatesEvent displayState: priority to transform over options (#4193) Fix #2283 Fix #4050 This PR is fixing two things in the computation of the displayState: - If a transformation is pres... — committed to openhab/openhab-core by lolodomo 3 years ago
Yes but only if there is no transformation.