Multiple device conditions in 1 scene

Dear users,

I’m a beginner at vera and have a couple of sensors and switches.
I have a vera edge controller, 4 tkbhome wall mount switches, 1 door sensor and 1 fibaro 3 in 1 sensor.
I’m also a beginner with lua coding but i can’t find an answer on my following question:

There is a door sensor on the front door, light switch and light sensor in hallway.
I have managed to put the lights on if the door sensor is “open” and turn off after 10sec. if the sensor is “closed”.
This scene runs from 20:00 till 07:00.

Now i want to use my light sensor instead of the time trigger.
So the new scene would be : If the light is < 20lux and the door sensor is open (1) then turn the light on.
In php language or other language you can say: if (lightsensor < 20lux && doorsensor == 1) turn light on.
How can i script this in lua code ?

I hope someone can help me with the code.

Thanks in advance,

Ilker

There’s a sticky topic in this subforum (Conditional Scene Execution) which will give you lots of ideas.

Also check out the Program Logic plugin.