Hello,
I use ephemeris to calculate the next birtday in days
val String nextBirth = Ephemeris.getNextBankHoliday('/etc/openhab2/services/Birthdays.xml')
val long untilBirth = Ephemeris.getDaysUntil(nextBirth, '/etc/openhab2/services/Birthdays.xml')
And i wanna display it with
number_emphemeris_daysuntilnextbirthday.postUpdate(untilBirth)
Number number_emphemeris_daysuntilnextbirthday "Nächster Geburtstag in Tagen [%.0f]"
In general, don’t. There are very few situations where you need to explicitly cast anything in Rules DSL and when you try to do it yourself it often causes problems. The only time you need to and should mess with primitives is when you are calling something that requires a primitive (e.g. now.plusMinutes), in which case call .intValue on the Number. By default, Rules DSL will convert everything to a Number object for you. Let it.