I browsed around in a lot of posting, java doc, eclipse doc but did not found a solution for my problem
I have an item:
Number randmetimesettings
I want to use this item in the function
createTimer(now.plusSeconds(randmetimesettings))
But whatever I use there is an error in the log that type convertion is wrong
Not working:
createTimer(now.plusSeconds(randmetimesettings.state as Number))
createTimer(now.plusSeconds(randmetimesettings.state as Integer))
createTimer(now.plusSeconds(randmetimesettings as Integer))
createTimer(now.plusSeconds(randmetimesettings.intValue))
createTimer(now.plusSeconds(randmetimesettings.state.intValue))
I waned to parametrize timer length by a dummy (persistent) Number value, which can be set using the app. I spent several hours, incl. reading Rules - openHAB 2 - Empowering the Smart Home, however all the time same error messages. This rules language type casting is really strange and I have not found any documentation, than just mentined examples. Although I just needed to convert Item type Number to rules argument type Long.
This casting example solved the problem, thank you.