I’ve got a knx temperature sensor to gives a very detailled temperature…
But I now want to fill the logs with a more ‘readable’ value. The sitemap is working great with the item label.
Item:
Number SCH_BURO1_TEMP "Temperatuur [%.2f C]" <temperature> { knx="3/2/0" }
In the events.log:
2018-11-22 16:28:30.393 [ome.event.ItemCommandEvent] - Item 'SCH_BURO1_TEMP' received command 18.730000000000000426325641456060111522674560546875
2018-11-22 16:29:30.393 [ome.event.ItemCommandEvent] - Item 'SCH_BURO1_TEMP' received command 18.69000000000000127897692436818033456802681640625
2018-11-22 16:37:30.393 [ome.event.ItemCommandEvent] - Item 'SCH_BURO1_TEMP' received command 18.69
Now following part of my rule:
logInfo("HVAC_Bureel", "HVAC113: Temperature is " + SCH_BURO1_TEMP.state )
gives me:
2018-11-22 16:43:30.370 [INFO ] [e.smarthome.model.script.HVAC_Bureel] - HVAC123: Temperature is 18.690000000000001278976924368180334568023681640625
2018-11-22 16:44:30.367 [INFO ] [e.smarthome.model.script.HVAC_Bureel] - HVAC123: Temperature is 18.71000000000000085265128291212022304534912109375
2018-11-22 16:45:30.364 [INFO ] [e.smarthome.model.script.HVAC_Bureel] - HVAC123: Temperatuue is 18.660000000000000142108547152020037174224853515625
I would like to see in my logs only the value with 2 decimals after the comma.
I tried several things form the forum, but the closed thing gave me 8 decimals.
Any suggestion/tip what I should do best?