[SOLVED] Automatically turn off a Relais/GPIO after x seconds

The expire binding minimum “pulse” is 1 second and the OP wants 500ms even though there is a 2s timer in the rule.

NO IMPORTS NEEDED

val relay2timeout = 500 // 500 ms
rule "RELAIS2 auto aus"
when
        Item RELAIS2 changed to ON
then
    createTimer(now.plusMillis(relay2timeout), | [
        RELAIS2.sendCommand(OFF)
    ])
end