I have a problem depending a notification in a rule. Every morning I will receive a message with the actual measures outdoor temperature from one of my temperature sensors (WEATHER1Aussen_Temperature.state).
The item (WEATHER1Aussen_Temperature; number) is configured with paper ui. My problem is, that the measured temperatures from the sensors are in the following format, e.g.: 12.9000000000000003552713678800500929355621337890625. Exactly with this format I receive my notification. Is it possible to configure the output format for the item value in the sendNotification command?
rule "Aktuelle Temperatur 7 Uhr"
Time cron "0 0 7 1/1 * ? *"
logInfo("rules", "Die aktuelle Außentemperatur beträgt " +WEATHER1Aussen_Temperature.state+ " °C")
sendNotification("firstname.lastname@example.org","Die aktuelle Außentemperatur beträgt " +WEATHER1Aussen_Temperature.state+ " °C")
So the idea is first to say to openHAB that the state object we have is of DecimalType (and not e.g. a DateTimeType,OnOffType and so on). Next we have to convert that Eclipse Smart Home Object (!) to something Java understands. And that is then done by the method .floatValue() which is a method of DecimalType and which returns a float value, which can then used to do everthing you can do with a float value