HomeGenie Forum
Automation Program Plugins and Wizard Scripting => Help => Topic started by: DutchHans on January 10, 2015, 05:15:08 PM
-
Hello all,
I want to activate a motionsensor to turn on lights and switch them off again after 2 minutes. But I only wat that after sunset and before sunrise.
I read about the Cron expression and tried the following in triggercode in the wizard:
Scheduler.CronEvent
equals
@sunset-* 23 * * *:* 0 * * *-@sunrise
But it doesn't work, am I missing something?
Can anyone help me with this...please
Thanks and cheers.
Hans
-
There are 2 options. You can use the Smart Lights script that is built in and is located in the Lights automation group. Alternately, you could use the Advanced Smart Lights script that I have posted in the App Contributions sub forum. I have just updated the code recently so it requires less modules. Go to the last post to find the most up to date version.
http://www.homegenie.it/forum/index.php?topic=241.msg3454#msg3454 (http://www.homegenie.it/forum/index.php?topic=241.msg3454#msg3454)
The primary difference between these two codes is that mine has more capabilities (though you may not need them) and uses jkutils for sunrise/sunset. Gene's version uses a luminescence sensor to determine day/night.
-
Hi,
Thank you for your quick response.. I've installed your advanced version, but where can I set the sunset/sunrise option?.
Is there something as a manual, help file or examples? ..
Thank you in advance...
Hans
-
The script uses jkutils to determine sunrise/sunset. As long as you have it set up, the script will use the following values:
jkUtils.SolarAltitude.Morning.Sunrise.Start
jkUtils.SolarAltitude.Evening.Sunset.End
This is the equivalent of using the following cron events:
@SolarAltitude_Morning_Sunrise_Start
@SolarAltitude_Evening_Sunset_End
If you want to know when the motion will trigger lights to com on, check what your SolarAltitude widget shows.