Hi, I just tested, and it turns on and then it turns off immediately after a second. So it is good it can turn on and off.   local hc = fibaro jT = json.decode(hc.getGlobalVariable("HomeTable"))    local light = {jT.Bathroom.bathroomlight} local motion = jT.Bathroom.motion local lux = tonumber(hc.getValue(jT.Bathroomt.lux, "value")) local luxmin = 500   count = 0 function checkLights()   if #light > 0 then     for i