Newby question on scene triggers

Hi all,

I hope I’m posting this in the right topic, if not please move to wherever is appropriate.

I just got my first Vera (2) and am trying to get to grips with how it all works and what the possibilities are.
I’m starting to find my way a bit now and have run into something that I don’t understand how to do.
There are several varieties, but what it boils down to is this:
I can set a sensor to trigger a scene and for instance switch on a light when motion is detected by a sensor, but I don’t want to switch the light on when it’s not dark.
This means that the logic would be:
Is it dark? No → End
Yes → Is there movement? Yes → Light on
No → End

I can’t seem to figure out how to do this (I do have a sensor to determine if it’s light and one to determine motion)

Hope you guys can help me get my head around multi-variable triggers like the above, if it needs more clarification please let me know.

Thanks in advance for the help.

Answered many times:
See:
[url=http://forum.micasaverde.com/index.php/topic,13802.0.html]http://forum.micasaverde.com/index.php/topic,13802.0.html[/url]

The Program Logic Plugins require UI5.

If you want to do this in LUA code add the following to the LUUP of your motion trigger for your scene:

return luup.is_night()

Using a scene, this is easily accomplished with a refactoring of your logic:

Is there a movement ?
Yes →
Is it dark?
No → exit scene
Yes → Light on

Specifically:

[ol][li]Make a scene to turn on the light[/li]
[li]Trigger this with a PIR movement detection event (or whatever)[/li]
[li]Add Luup code to the scene: [tt]return (some logical expression which is true if dark)[/tt][/li][/ol]

Your ‘is dark’ expression could be as simple as checking if it is night time, or, as you say, a threshold on a light level sensor. If it’s false, then the scene is aborted without turning on the light.

I have no doubt that Richard will be along to tell how to do it in PLEG, but these instructions here are the fundamentals of Vera scenes and triggers, which it’s always good to know.

DARN!

Richard beat me to it! :slight_smile:

Thanks for all the answers guys, I’ll go and see what they mean now.