There are no other options presented. This is a configuration issue, not a bug. OH is flexible enough to permit you to âshoot yourself in the footâ because it assumes you know what you are doing.
Itâs the same for all browsers⊠Refreshing also doesnât change anything.
I can switch on the switch by clicking on âONâ, but âONâ will never get highlighted.
This is a Switch widget in a UI. It need not be associated with a Switch type Item, and is commonly used with Number or String types. When mappings are used, it may take into account one or ten different recognizable states.
No, you can just use one Mapping and, in this case, when you press the button it will send the ON command to the Item. I use this for my garage door openers as the control mimics a momentary push button.
@andreas_furrer68, honestly, Iâve noticed this behavior for about as long as Iâve been using OH. I never gave it much attention as it never was a problem for me. But an Issue should probably be filed.
It used to work like you expected in the old version of the Ios App. You could use a switch item and show it as a single mapped button that would be shown as on if the switch had the mapped state. But one of the app developers told me that that actually was the bug.
I think the misunderstanding is that werenât expecting the button to turn off when we pressed it again. So not like a momentary push button. Instead we were expecting the button the to behave just the same with one mapping as with 2 or 10 mappings. Meaning it is highlighted when the corresponding item is in the state that the button in the sitemap is mapped to. I donât understand why it should behave differently when there is one mapping versus 2 or more. Which is how the Ios App used to behave. Now itâs kind of counter intuitive when a mapping gets highlighted to the corresponding item state but only for 2 or more mappings but the behavior with a single mapping is inconsistenct.
Johannes
We had the discussion before. There is several use cases were one has a switch item that only ever gets switched to one state in the ui by the user and there is no point in switching it off as it either switches itself off or gets switched when another item gets switched through a rule or nothing happens at all. So there is a point in having the possibility to have a button In a ui that is kind of one way and only gives the possibility to switch something to one state but not manually to another. But the user might want to know if it is still switched to the mapped state or if it changed state. So yes there is use cases where you donât want to show a two way switch although the underlying item has multiple states. I would have thought that use cases like this ard what mappings are for. And I come back to my consistency argument as it just isnât the expected highlight behavior if you use mappings otherwise.
Johannes
I understand your intention, but the underlying UI element does not work that way.
To achieve what you want, you will have to use the visibility attribute. Just make two switches with one mapping, switch visibility depending on item state and ignore interaction for one of them.