[SOLVED] HabPanel Format in Dummy Widget

I am using the dummy widget to display e. g. temperatures to get things going before diving into serious configuration. I am trying top format a number with one digit after the decimal point, however, I can’t find a documentations what to put into the format field. I have been able to use dd, MM, yyy and EEE for formatting the date. Anybody who can help me with this?

@dim, @ysc, any other people knowledgeable about Habpanel? I just started using it myself to play around with and ran into the same issue. Are the formatting options documented anywhere?

Take a look at this old issue on Github.

And a link to the formating options

https://docs.angularjs.org/api/ng/filter/date

Hope it helps

1 Like

Mike,

That only deals with the formatting of date/time, which actually works very well. Unfortunately no update or documentation how to format numbers.

I have filtered my numbers in my item definitions (including adding °C to the value for example), but there are further formating options in angularJS, take a look at the following:

https://docs.angularjs.org/api/ng/filter

Edit: I am not sure that the above link is actually that helpful. The better approach may be to format your numbers in the item definition. See

http://docs.openhab.org/configuration/items.html

1 Like

Maybe this https://docs.angularjs.org/api/ng/filter/number helps?

I am doing that, but if I use the option “use server provided format” Habpanel shows nothing.

I am assuming that you are running openHAB 2.

Here are my settings

And the item definition

Number temp_supply "Supply Temperature [%.1f °C]" <temperature> (temperature , GF_Mancave) { mqtt =
"<[mqttService:myHouse/services/hvac/unit1/temp:state:default]" }

Following is the Dummy Widget for this item

I updated to the latest build and it finally worked with server side formatting!

2 Likes

Just to be thorough:
The dummy widget uses Angular’s date format if the item’s type is DateTime, and sprintf otherwise.

I am just wondering how to change the language of the Date-Time on Habpanel?
I am using format EEE and get “Sat” , so this is not in German like I have it on the normals Sitemap display in Basicui.

Wouldn’t this be best handled with the Language and Locale settings for OH at the global level?

Well, I set everything to DE, Browser, OH Local settings, but it has no effect at this line item. :fire: