noob question about some luup code

hey there developers ,
I’m very new to Luup code , just installed the fibaro motion + light + temp sensor today.

for starts I want to create a scene where the motion sensor will switch a light switch on unless there’s already light in that area.

so I’ve created a scene with motion trigger , now I need to add a Luup code that queries the light sensor for its lux value and add a condition for this scene to run only if lux is less than [SomeValue].

can someone please explain how do I add this condition?
also , where can I found some documentation and some tutorial or example code snippets?

Thanks

Try here first Conditional Scene Execution

Thanks very much , I’ve managed to add a light level condition.
what I didn’t manage to understand is where can I see a list of all services a device have?
for example , where can I find this info : urn:micasaverde-com:serviceId:LightSensor1 ?
What’s LightSensor1?

Thanks

If you look under the Advanced tab you can see the list of device variables. If you hover the cursor over any of the variable names, there will be a pop-up with the serviceId name.