Automatic light dimming

I agree with @rossko57, I bet you have multiple instances of the rule running at the same time.

I’d rewrite your rule to be something more like:

Items
Put all your Presence Items into the same group. See the following for an example. I’ll call it gPresent.

import java.util.concurrent.locks.ReentrantLock

var ReentrantLock entranceLock = new ReentrantLock()

rule "Dimming UP: Entrance"
when
    Item ZwaveEye1Lux changed
then
    if(!entranceLock.isLocked) {
        try {
            if(ZwaveEye1Lux.state < LuxSetpoint.state &&
               Standard_ALD.state == ON &&
               gPresent.state == ON ){
                Thread::sleep(5000)
                Dimmer_1.sendCommand((Dimmer_1.state as Number) + 3)
                Dimmer_2.sendCommand((Dimmer_2.state as Number) + 3)
            }
        } 
        catch(Throwable t) { entranceLock.unlock }
        finally { entranceLock.unlock }
    }
end

The above will ignore any change to ZwaveEye1Lux while there is an instance of the rule running.

2 Likes