The knob component comes from GitHub - kramer99/vue-knob-control: A rotary knob control for Vue.js . You can see in that doc there is a value-display-function option that will convert the displayed value. If you’re using any of the 3.4 releases then your widgets should be able to use the arrow function syntax to define a function that satisfies this property.
Start here Creating Personal Widgets | openHAB . There are some explanations of how most of these components are derived and some links to the docs page and f7 pages that cover what you’re looking for.
Hey Justin, since the update to OpenHAB 4.0.0 this solution doesn‘t work anymore. Do you have an idea? I use the OpenHAB docker on qnap. Switching back to 3.4 the dipsplayValueFunction works again but i think this isn‘t a good way
The source widget underlying the oh-knob was changed for OH4. The new widget, as far as I know, doesn’t have, doesn’t have an equivalent function for modifying the displayed value. You might need to put in a feature request in the UI repository to get a property added to the oh-knob component that appends the desired text.
In the meantime, there is an awkward css fix. If you use the stylesheet property on the knob or knob card, then you can add an after pseudoclass and use that to add your text.
Bit dirty but it works, great!
In a quiet minute i can make the request, is a useful feature in my opinion.
Many thanks for the quick reply and explanation.
Yes, you would use almost exactly the same stylesheet only without the ::after pseudoclass.
Depending on how the new knob component is constructed, you may need to add !important to the declarations you are making so that they do not get overridden when the knob gets drawn.
Could you please point out where I have gotten it wrong.
Also, at the risk of sounding redundant , has there been any change to the oh-knob that allows color gradient? or maybe oh-gauge? Thx much!