[SOLVED] Wrong temperature values

Hi Guys,

i have a Problem with my temperature values comming from knx.

I am running on OH 2.3 with the knx binding 1.12.0

On my bus monitor the temp value 21,1 is send, but in the OH Log the value looks like this.
But it also sometimes work - as you can also see in the log.

2018-10-09 14:41:12.366 [ome.event.ItemCommandEvent] - Item 'Temperatur_1' received command 21.199999999999999289457264239899814128875732421875
2018-10-09 14:41:12.434 [vent.ItemStateChangedEvent] - Temperatur_1 changed from NULL to 21.199999999999999289457264239899814128875732421875
2018-10-09 14:42:30.855 [ome.event.ItemCommandEvent] - Item 'Temperature_2' received command 22
2018-10-09 14:42:30.870 [vent.ItemStateChangedEvent] - Temperature_2 changed from NULL to 22

The items are configured as number.

Number	Temperatur_1 	"Raumtemperatur [[%.2f °C]"	<temperature>	(CH_1)		{knx="9.001:3/0/0"}

I reinstalled the binding, but Nothing changed.

what could that be?

best regards

As it’s a float value, this is normal behavior :slight_smile: at the UI the value should be written with 2 decimals.

Agreed, same behavior also with Modbus Floats. They are send as a full Float32 but I only display them with two digits after zero.

That´s my Problem.

That very long temperature is also shown on Habpanel.

I tried ist with %.2f, %.1f and %f but Nothing worked.

But i did´t change anything, i think that the Problems persists after the binding update or OH Update.

i think i had that long temperture values not at the beginning.

In OH i am using a dummy item to Show the Temperatur.

best regards

There is an error in your label:

"Raumtemperatur [%.2f °C]"

Only one [ is needed

That was a copy paste mistake - sorry. My items config is correct.

But what i don´t understand is, my knx switch sends a temparature value 21,1 and in the OH logs the same value Looks like this:

2018-10-09 14:41:12.366 [ome.event.ItemCommandEvent] - Item 'Temperatur_1' received command 21.199999999999999289457264239899814128875732421875

I have this Problem also with lux values.
I looks like that all affected values are comma separatet.

what could that be?

i found a Workaround, my values are still to long.

But if you check on, that the dummy item from Habpanel sould use the Server formart, the %.1f Format works.

Thanks for help.

best regards

Can you post your workaround and mark the thread as solved, thanks

You have to set the format that you want in the itmes config.

Number	Temperatur_1 	"Raumtemperatur [%.2f °C]"	<temperature>	(CH_1)		{knx="9.001:3/0/0"}

%.1f stands for 1 decimal place after the comma, %2f for two and so on…

If you set the Server format on the dummy widget in your habpanelconfig, the format out of the items config is used.