Hey guys,
I need help with formatting a number in rules.
That is what I have:
var Number sumRainToday = Rain_Rain.sumSince(parse(now.toString("yyyy-MM-dd'T'")))
var Number sumRainYesterday = (Rain_Rain.sumSince(parse(now.minusDays(1).toString("yyyy-MM-dd'T'"))) as Number) - (sumRainToday as Number)
var Number sumRainThisWeek = Rain_Rain.sumSince(parse(now.minusDays(now.getDayOfWeek - 1).toString("yyyy-MM-dd'T'")))
var Number sumRainLastWeek = (Rain_Rain.sumSince(parse(now.minusDays(now.getDayOfWeek + 6).toString("yyyy-MM-dd'T'"))) as Number) - (sumRainThisWeek as Number)
sendLogNotification("OH Test:\nRain: "
+ "\nRegen heute: " + String.format("%.1f", sumRainToday) + " mm/h"
+ "\nRegen gestern: " + String.format("%.1f", sumRainYesterday) + " mm/h"
+ "\nRegen diese Woche: " + String.format("%.1f", sumRainThisWeek) + " mm/h"
+ "\nRegen letzte Woche: " + String.format("%.1f", sumRainLastWeek) + " mm/h"
)
I got this error:
Rule 'Test': f != org.eclipse.smarthome.core.library.types.DecimalType
How can I solved this problem?