PaperUI - State Presentation

I have just created an HTTP thing, channels and items in PaperUI, however, the values I retrieved have decimal points that are of no significance so I would like to round the numbers to zero decimal points.
Rossko suggested in another thread that I use State Presentation but I can’t see where I would apply this in PaperUI. I guess it has to be in the item but I can’t see where.

Everything else I have is in files and I think I’ll have to change these to files to make it easier.
I thought the idea of GUIs was to make it easier.

Please tell me where in that link it gives any help with items created in PaperUI.

PaperUI is an admin UI, it is not meant as the UI for ordinary users, hence there is no built-in way to customise the state presentation in the the control section.

I understood PaperUI is the GUI method of creating things, items etc. and is supposed to make it easier than using files.
What admin are you supposed to do in PaperUI?

Exactly that and installing addons.
When linking an item to a channel the admin would like to know if the link is working, for that reason all channels that are linked to an item do appear automatically in the control section, nothing more nothing less.

@lesterb Your original question in another thread was with regards to HABPanel. Assuming you used a dummy widget to display your number, edit that widget and in Format add the following:

%.0f

That will effectively only show an integer. Change the zero to a 1 to show one decimal place, 2 to show two decimal places…

2 Likes

Thanks hafniumzinc. That does it for HABPanel but I’d also like to display the results in ClassicUI.
I haven’t tried yet but I guess I can add the items to my sitemap file and use the same format.

Correct, add it to the label of the item:

Text item=MyItem label="My label [%.0f]"

I just added the items to my sitemap and when I came back here I found you had replied with exactly what I had done.
Thanks for you help, it is much appreciated.

Sorry for the unnecessary lecture about PaperUI, reading only this thread my understanding was you were trying to configure the state presentation ON PaperUI.

To clarify a bit,

If you specify a [state presentation] in your actual Item definition label, that will become it’s default display type.
I don’t think PaperUI uses that, who cares because it’s an admin toolbox etc.

In HABmin you can choose to use that default format, or override it and do your own thing in the widget as described by @hafniumzinc

In sitemap UI’s like BasicUI, you can choose to use that default format, or override it and do your own thing by specifying [presentation] in the widget as also described in the Text widget example.

Thanks Jurgen, I was expecting to put the [state presentation] in the item created in PaperUI because all of my other items are in files and I have {state presentation] in them.
As I’ve said before, every time I try something different in openHAB I learn a lot more thanks to the helpful people in this forum.
Now that I have completed my first venture into HTTP I’ll look at extracting further details from my energy monitor. This time it won’t be as easy as extracting values from a json file.
Thanks also to Rossko and hafniumzinc for your help.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.