Activate/Disable Scenes based on Sunset/Sunrise

Is it possible to configure the Vera3 to only execute scenes at certain times of the day? I want to have my lights turn on if a PIN is entered while it is dark out but not if the sun is up.

I searched the forums as well as played with the schedules but it seems to me that the schedules will only trigger the scene but not enable/disable it.

Any help would be greatly appreciated.

By default, Vera’s GUI permits OR conditions for scenes, such as if sensor or lock or time then action, but it cannot perform AND conditions, such as pin code AND schedule then action. For AND logic you must extend Vera’s capabilities by writing some code or using a plugin.

There are a few ways to do what you want. The most basic method is to use the a single line of LUUP code in your scene, return luup.is_night() == true. This will cause the scene to execute only between sunset and sunrise.

@RexBeckett recently did an excellent writeup on conditional scene execution using LUA/LUUP.

If writing code is not your cup of tea, the use of a plugin such as the Programmable Logic Event Generator(PLEG) allows tremendous functionality without the need to know LUA.

A very simple way to do is to add the following like to the luup code area in the trgger.

return luup.is_night()

This will return true if it is night time and return false if it is day time.

Thanks for the help! It seems to be working quite well.

Or look at the following for more general solutions to your question:

http://forum.micasaverde.com/index.php/topic,18679.0.html
or
http://forum.micasaverde.com/index.php/topic,21603.0.html