more G-Labs products

Author Topic: The New Scheduler  (Read 3549 times)

July 19, 2016, 03:37:38 PM
Read 3549 times

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Hello,  I am on the latest beta (525 I think) and playing with the new scheduler which is pretty nice.

Does anyone know more about the java code that can be put into the Script section?  I know there are a few pre-set examples but I'd like to go beyond those just a bit... and I am not sure of the syntax and available constructs etc.

Just checking to see if anyone has pushed the limits more on that.

Thanks!!

July 22, 2016, 12:20:01 AM
Reply #1

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
For example,   I'd like to be able to turn on the lights every 10 minutes between sunset and sunrise and turn OFF the lights every 10 minutes between sunrise and sunset.

I've done this sort of thing with a program (somewhat successfully) but am wondering if anyone has insite on how to do it with the new scheduler maybe...

July 22, 2016, 05:26:18 PM
Reply #2

mchias13

  • **
  • Information
  • Jr. Member
  • Posts: 45
I would think this would work for what you want.  You need to create two separate schedules.  Then go to your light setup and tell it the ON and OFF schedules.

For lights on:
(@Sunset > @Sunrise) ; (0/10 * * * *)

For lights off:
(@Sunrise > @Sunset) ; (0/10 * * * *)


Gene added a good bit of explanation here: http://genielabs.github.io/HomeGenie/scheduler.html

July 23, 2016, 02:34:02 AM
Reply #3

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Yes...  WHY didn't I think of that?  I was trying to do the anding with 0/10 a different way...  I bet your way will work great!  Thanks!

July 25, 2016, 06:08:27 PM
Reply #4

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Yes this works.  I must say I am pretty happy with the new scheduler!  A very nice improvement!!!

July 25, 2016, 10:36:43 PM
Reply #5

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
If the new scheduler is working out well, are there any other changes that I should consider prior to updating?  I'm thinking I should flash a backup and try updating to see the new setup, but potentially breaking my working install keeps me from jumping.   8)

July 25, 2016, 11:03:32 PM
Reply #6

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
I've seen some strange issues with the scheduler GUI where it seems to forget what lights/switches I had selected... this only seems to happen when I open the gui to change something... and if you just double check that the proper modules are selected before you close the scheduler gui it seems to be just fine.

That is the only bug I've come across so far but YMMV!!

July 27, 2016, 02:13:47 AM
Reply #7

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
One thing I've noticed on the RPI. Switching screens between different groups causes the icons on the next group to disappear. Just returns the group name and nothing else. I solve this by restarting the service.

July 29, 2016, 05:00:56 AM
Reply #8

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
OK-   looking for an idea.

I am using R525 which I think is about the latest.  It has the new scheduler.

I am using X10 and to make it reliable enough I have OVER DESIGNED my DUSK to DAWN timer such that it sends an A1-ON command EVERY 10 minutes between DUSK and DAWN.

Now it works great EXCEPT when my wife wants to watch a movie... in this case... she wants to shut some of those A1 lights off temporarily but my timer just turns them back on every 10 minutes!   :)  Ha... not happy wife.

So I am wondering if anyone has an idea for temporarily suspending this timer code if a flag is set somewhere...  is this what a "Virtual Module" would be for?

I guess if so... I would need to figure out how to access the state of a virtual module from within the JAVA code of the timer script.

Any ideas?

Thanks!!

July 29, 2016, 05:43:47 AM
Reply #9

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I have override code in the Advanced Smart Lights code using other modules.  It's complicated and C#, but it might help.

July 30, 2016, 12:15:44 PM
Reply #10

Peter1977

  • *
  • Information
  • Newbie
  • Posts: 24
Are there more options available then only "Sunrise" and "Sunset"?

In the older Sheduler with SolarAltitude there were many options to choose from (eg. evening.goldenhour.start, evening.goldenhour.end, night.start, etc etc)

Is there a list available ?

July 30, 2016, 09:02:37 PM
Reply #11

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
you can now do  @sunset+30    for a 30 minute offset.  SO NICE!

Here is what I have for sending an ON command every 20 minutes between sunset and sunrise

 ( (@SolarTimes.Sunset)  > (@SolarTimes.Sunrise ) ) ; (0/20 * * * *)

July 31, 2016, 11:19:00 AM
Reply #12

Peter1977

  • *
  • Information
  • Newbie
  • Posts: 24
Is there a list available with all SolarTimes.* variables?

So far I see there is: SolarTimes.Sunset, SolarTimes.Sunrise, SolarTimes.SolarNoon.

July 31, 2016, 06:53:44 PM
Reply #13

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
I haven't seen it published.   I think we'd have to look through the code to decipher it yet.  I assume you want more than just a certain offset in minutes then right?

July 31, 2016, 07:15:45 PM
Reply #14

Peter1977

  • *
  • Information
  • Newbie
  • Posts: 24
yes, i liked the options for goldenhour, etc

Also I don't know if its posible now to see how cloudy it is or if it's raining
« Last Edit: August 01, 2016, 05:07:33 PM by Peter1977 »