Netatmo Item Binding and Decimal

openhab2
Tags: #<Tag:0x00007fd313c44288>

(Thomas) #1

Hello,

i use netatmo for weather.
My item looks like

Number:Temperature Netatmo_wz_Temperature         "Temperature [%.1f %unit%]"          <temperature>      { channel = "netatmo:NAMain:2312dcff:70ee502ea39a:Temperature" }

But in my Habpanel the items shows a big number.

How can i solve my Problem?
I have try the " | number:0" or “’%.01f’ | sprintf:” but nothink works for me.

Iam new to openhab.
Thanks


(Vincent Regaud) #2
Number:Temperature Netatmo_wz_Temperature         "Temperature [%.1f °C]"          <temperature>      { channel = "netatmo:NAMain:2312dcff:70ee502ea39a:Temperature" }

(Harry) #3

Check/change the HABPanel-settings


hc_297


(Thomas) #4

Its a custom Widget

				<div class="main">{{itemValue('Netatmo_wz_Temperature')}}</div>

and | number:1 at the end dosnt work


(Harry) #5

I checked your code and it works fine.
What OS, oH- and java-version do you use?


(Thomas) #6

Okay, i use Openhabian with oh2.3 and a pi 3+ b
In PaperUI it works fine and in ClassicUi too.

2018-06-26%2011_35_16-Paper%20UI


(Harry) #7

Please post your complete widget code.


(Thomas) #8
	<div class="bigDash">
		<div class="top">
			<div class="icon on"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/squidink.svg#thermometer-3"></use></svg></div>
			<div class="value">
				<div class="main">{{itemValue('Netatmo_wz_Temperature')}}</div>
				<div class="sub">&#176C</div>
			</div>
		</div>

(treesink) #9

I have exact the same issue. I use the netatmo widget.


(Thomas) #10

I think its the Number:Temperature.
Without the :Temperature its dosnt work but it think its now a number and i can use | number:1


(Thomas) #11

IDk whats wrong.


(Thomas) #12

Maybee i need to try the V1 Binding


(Mikael Gustafsson) #13

I posted a solution to this a few days ago.
https://community.openhab.org/t/sprintf-with-new-numbers/47405


(Thomas) #14

Thanks i give it a try.
How looks your Item?


(Mikael Gustafsson) #15

I’m not at home right now, but my items are very basic. E.g my outside temperature is of type number with dimension temperature.


(Thomas) #16

You are so awesome

{{'%.1f' | sprintf:itemValue('KChe_Temperatur').split(' ')[0]}}

Work for me