OH 2.2 (arm) 'reschedule' is not a member of 'org.eclipse.smarthome.model.script.internal.actions.TimerImpl

2018-05-10 17:31:14.084 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Study door open and/or garage movement and night time': 'reschedule' is not a member of 'org.eclipse.smarthome.model.script.internal.actions.TimerImpl'; line 78, column 5, length 50

Moving to a new odroid based system, and noticed this in my logs. This was previously running on a 2.1 system on windows.

Using the following call:

carport_light_timer.reschedule(now.plusMinutes(5))```

This hasn't been depreciated?

Please show the complete rule :slight_smile:

rule "Study door open and/or garage movement and night time"
when
        Item alarm_zone_studyreed received update OPEN or
                Item alarm_zone_garage received update or
                Item unifi_Ugluk_Online changed or
                Item unifi_Yumyum_Online changed

then
        //Item alarm_arm_disarm received update OFF or
    logInfo("CarportLights","Command Called")
    logInfo("CarportLights","Weather_dayNight = " + weather_daynight.state)
    if (weather_daynight.state !== NULL)
    {
        logInfo("Lights","Day/Night initialised: " +  weather_daynight.state)
        if (weather_daynight.state == OFF)
        {
            logInfo("CarportLights","It's not yet sunrise, and alarm turned off - turn light on for 5 mins")
            zwave_switch_carport_lights.sendCommand(ON)
                        logInfo("CarportLights","Sent Carport lights their command")
                        if (carport_light_timer === null ) {
                                carport_light_timer = createTimer(now.plusMinutes(5))
                                [|
                                        logInfo("Lights","Carport Light Timer Ended")
                                        zwave_switch_carport_lights.sendCommand(OFF)
                                        carport_light_timer = null
                                ]
                        } else {
                                logInfo("Lights",String::format("Existing timer, rescheduled for %s",now.plusMinutes(5)))
                                carport_light_timer.reschedule(now.plusMinutes(5))
                        }
                        logInfo("CarportLights","End of rule")
        }

        logInfo("Lights","Day/Night initialised: " +  weather_daynight.state)
        if (weather_daynight.state == OFF)
        {
            logInfo("CarportLights","It's not yet sunrise, and alarm turned off - turn light on for 5 mins")
            zwave_switch_carport_lights.sendCommand(ON)
                        logInfo("CarportLights","Sent Carport lights their command")
                        if (carport_light_timer === null ) {
                                carport_light_timer = createTimer(now.plusMinutes(5))
                                [|
                                        logInfo("Lights","Carport Light Timer Ended")
                                        zwave_switch_carport_lights.sendCommand(OFF)
                                        carport_light_timer = null
                                ]
                        } else {
                                logInfo("Lights",String::format("Existing timer, rescheduled for %s",now.plusMinutes(5)))
                                carport_light_timer.reschedule(now.plusMinutes(5))
                        }
                        logInfo("CarportLights","End of rule")
        }
        else
            logInfo("CarportLights","Its not night time")
     }
     else
        logInfo("CarportLights","Weather_daynight has not been initialised")
end

Did you initialize carport_light_timer as Timer?

var Timer carport_light_timer = nulll

Should be be at the beginning of the rules file (outside of rules).

Doesnt this do it?

No, you have to define the var outside of the rule. Otherwise, the var is only valid while the rule is running (which is about 0.1 seconds)

Does that mean I want that whole createTimer line at the top of my rule rule (including the plusminutes?) I think I’ve always done it the way I posted and it’s worked.

Unless something about 2.2 is different.

Declare the timer at the top of the rule file

var Timer carport_light_timer = null

Leave the rule itself as it is
Now the timer is available for the whole rule file including the timer Lambda where the reschedule is called from

I do have that, though I just declare as var, not var timer.

Will that fix the reschedule problem?

Try it and see…
It should

Timer with a capital T
var Timer carport_light_timer = null