more G-Labs products

Author Topic: Wizard Scheduler.CronEvent between sunset and sunrise  (Read 1897 times)

January 10, 2015, 05:15:08 PM
Read 1897 times

DutchHans

  • **
  • Information
  • Jr. Member
  • Posts: 39
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


January 10, 2015, 09:34:00 PM
Reply #1

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
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

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.

January 10, 2015, 09:47:02 PM
Reply #2

DutchHans

  • **
  • Information
  • Jr. Member
  • Posts: 39
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

January 10, 2015, 11:37:09 PM
Reply #3

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
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.