Maybe this would help?
The use of ZonedDateTime will future proof things for OH3 (no more Joda Time).
import java.time.temporal.ChronoUnit// put this before any rules or global variables
rule "Sonoff: Shed_NLO_PIR timer"
when
Item Shed_NLO_PIR received update ON
then
val remainingTimeThreshold = 60// don't cast unless you absolutely have too
val seconds_since_last_update = (new DateTimeType(Shed_NLO_PIR_LUP.lastUpdate.toString)).zonedDateTime.until((new DateTimeType).zonedDateTime, ChronoUnit.SECONDS)
if (seconds_since_last_update < remainingTimeThreshold) {
logInfo("Sonoff.2.05", "Shed_NLO_PIR_LUP now - LUP....: {} sec", seconds_since_last_update)
}
end