I am trying to display current power usage on a knob widget but need to format the value to round the decimals like you can on a dummy widget. Is this possible?
The knob widget as a min and max value
If you set the step as 1 then no decimal
I am using it as a knob to show power consumption so it’s read only and not adjustable
What is your item definition?
The Item is:
Group:Number:SUM gCurrentPower “Using Power [%.0f W]”
I get this:
I assume I am not formatting the raw group item, only the default for a sitemap.
You are formatting the group item. The formatting for sitemap happens in the sitemap.
Did you try to set the steps in the knob config?
Try setting the steps to 1. Does it work?
Then I don’t know, I am out of ideas…
Use a proxy item with a rounded value maybe…
Or look in to knob source and make your own widget:
Yeah that was my other option if I couldn’t work out how
Thanks for your suggestions
How did you get the color in the scale? Could you show the other tabs for the widget configuration? I’ve tried every combination but never get colors.
BTW, I also get decimals. This may be a bug, but would be a good feature request to add format to the Knob widget.
You can do a feature request on the habpanel github
I know… but I didn’t want to duplicate efforts if the OP was headed that direction… and feature requests are like potato chips, and I’ve got to keg some beer tonight!
can you help with how to do a github request? ive never done one - is there a guide somewhere?
I opened an issue for us here… https://github.com/openhab/org.openhab.ui.habpanel/issues/306
Ran into this one before : Knob widget decimal precision issue
Setting the step to .1 seems to keep the results to a single decimal at least. Not perfect, but better than nothing.