Use the Exec actions:
For a Dimmer rule:
val int timeoutMills = 3 * 600 // 60000 divided by 100 dim levels
var int dimLevel = 1
var Timer timer = null
rule "Slowly Dim Up"
when
Item Outlet2_Switch changed to ON
then
if (timer === null) {
timer = createTimer(now.plusSeconds(0), [ | //Starts immediately
Light1_Dimmer.sendCommand(dimLevel)
if (dimLevel == 100) {
timer = null // cancel timer
} else {
dimLevel = dimLevel + 1
timer.reschedule(now.plusMillis(timeoutMills)) // reschedule timer is 3 * 600 mills
}
])
}
end
Or
Have a go and let us know how you get on