Help needed for Could not invoke method: java.time.ZonedDateTime.plusSeconds(long)

I am calcualtiing the time for a sunrise animation with this lines:

var int steptime = 1
        if (number_durationsunrisesimulationgroup10.state != NULL && number_durationsunrisesimulationgroup10.state != UNDEF){
            steptime = (((number_durationsunrisesimulationgroup10.state as DecimalType) * 60)/47).intValue
        } else {
            steptime = 1
        logInfo("Sunrise simulation group10 step", steptime.toString())
        createTimer(now.plusSeconds((steptime*1)), [ | group_groundfloor_livingroom_color_light.sendCommand("13,96,10")])

But I get this error:

script execution of rule with UID 'hue-8' failed: An error occurred during the script execution: Could not invoke method: java.time.ZonedDateTime.plusSeconds(long) on instance: 2021-04-19T22:30:55.070172+02:00[Europe/Berlin] in hue

can you help me solve this issue??

First of all simplify. Why multiple steptime by 1? That’s a noop but in this case in Rules DSL all mathematically operations generate a BigDecimal Object. now.plusSeconds requires a long.

So first get rid of the useless multiplication. If that works, and if you need to have some multiplcation there, put a .longValue after the closing paren. (steptime*1).longValue