more G-Labs products

Author Topic: sunset + Offset?  (Read 3109 times)

December 29, 2015, 02:50:21 PM
Read 3109 times

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Hi All,

New user here.  I managed to get HG installed on Linux, connected to a CM15 and configured with a couple X10 modules.   I was pretty excited when the lights turned on and off via the computer!  Very cool!!!

I've seen some threads asking about this but wasn't sure of the conclusion,   I'd like to have some events happen at sunset and sunset+1minute and sunset+2minjtes.    Is this doable at this point?

THanks!!!!

December 30, 2015, 01:29:41 AM
Reply #1

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
There is no way to simply use a statement like
Code: [Select]
@sunset+2in the scheduled events APP.  You have 2 options.
1) Define a new event time based on sunset
2) Enable jkUtils Solar Altitude APP and pick one of the various sunset times that is slightly later than your current sunset time.

December 30, 2015, 04:09:04 PM
Reply #2

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
thanks!   I'll see if I can figure that out.  Thanks again!

January 03, 2016, 07:02:43 AM
Reply #3

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Hello,

So I am trying to work with Solar Altitude and get sunrise/sunset to work.   I put in my attitude and longitude for Erie CO  as 40.0404 N    and   105.0394 W     and get some pretty wacky results for sunrise and sunset times etc...

Can you offer advice on the syntax for the lat/long strings?   I must be doing something dumb.

Thanks!

January 03, 2016, 08:21:40 AM
Reply #4

nolio

  • *****
  • Information
  • Global Moderator
  • Posts: 544
Hi,
The 2 fields "Longitude" and "latitude" to fill in solar altitude can be determined by Jkutil openweather.org or by google maps.
Bye

January 03, 2016, 05:35:10 PM
Reply #5

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I don't remember, but you might need to reset the app after changing the values.  Also, don't use cardinal directions in the code.  You want to use the following for Erie, CO:
latitude = 40.040369
longitude = -105.057659

January 03, 2016, 09:29:17 PM
Reply #6

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
ah, yes... MUCH better.   Can you tell me HOW I should have known to make the Long  -105?    I'd like to understand how to do this myself.

Next question then,   I assume that all these "variables" are now available to the scheduler?   For example  JKutils.SolarAltitide.Morning.Sunrise.End

Do I use this DIRECTLY in a cron or the scheduler as   @JKutils.Solar....     or how do I access this?

If there is some documentation I am missing... pls advise and THANKS!!!

January 04, 2016, 01:38:21 AM
Reply #7

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Easy, you just know  ;)

I have done a few projects with GPS in the past and knew that west is negative and east is positive (same with north and south).  There are some other conversions that are necessary for certain situations with minutes to degrees as well as cardinal directions and +/-.  They can be tricky for a new person, so I'd just suggest looking for an online guide if you want to know more.

Go to the Scheduler item under the configure menu to see what the cron name should be.  Your example would be "@Morning.Sunrise.End".

January 04, 2016, 01:43:48 AM
Reply #8

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
OK Thanks.   And how would I know that it is @Morning.Sunrise.End  ?   Is that seen somewhere in the UI or ?

Just want to learn how to find my own answers better!   :)

Thanks again!

January 04, 2016, 02:02:26 AM
Reply #9

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Like I said, look at Configure->Scheduler.  It shows all the cron events that are available.  You can add more in there if you want, but the ones under SolarAltitude are automatically updated by the jkUtils program.

January 04, 2016, 03:28:04 AM
Reply #10

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
OK i got it.

One last question for today then.

Can I edit the crontab manually or do I need to use the Scheduler GUI?   I cant figure out how the scheduler guy actually works....   

I want to have one module from Dusk to Dawn and the other from  Dusk to 10:30pm

Cant see how to schedule different modules to different schedules ...

Sheesh... need some kind of manual or example I guess...  :)

January 04, 2016, 04:31:00 PM
Reply #11

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
HG does have documentation linked off the main page.  To get to the scheduler documentation, you'd follow:

www.homegine.it
DOCS & SUPPORT (top right)
Event Scheduler (left column)

http://www.homegenie.it/docs/scheduler.php (direct link)

This shows the basics of how to create a cron event and how to use it for a module.  If you want to do more than a single event (e.g., turn on at 5am and dusk), you can use AND (:) and OR (;) as well as parenthesis to make more complex events.

If you want to create your own fixed event (same time/date/day of week/etc), you can manually create a cron event in the Scheduled Events section of HG.  If you want to do something that changes based on the day or whatnot, you will need to write some code (or modify something that already exists).  In that case, refer to the jkUtils SolarAltitude for a really good example.

January 04, 2016, 04:44:54 PM
Reply #12

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Thanks.  I've read through the doc's you mentioned numerous times but it isnt helping much.

First problem is that it mentions using a "Wizard"  (the second picture) and doesnt say how to bring up that wizard.  I have been unable to find it in the gui.

I just want one X10 module  A1  to come on at dusk and go off at Dawn...   

I tried putting the proper @sunset stuff in the module itself under the scheduled on/off section and that doesnt seem to work... so I still am at a loss...

January 04, 2016, 06:37:48 PM
Reply #13

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
There are 2 things you are referring to I believe.

You can create a cron event in the Scheduled Events section as the guide shows.  I'm not at my HG setup now so I can't get exact steps but it looks reasonably good in the guide.

Secondly, to utilize any of these events, you have to use the Scheduled ON/OFF APP or write some of your own code (C#, JS, Wizard script, etc).  The easiest way is to use the existing Scheduled ON/OFF APP.  Go to a module and click the gear icon in the upper right corner.  Select "Scheduled ON/OFF" from the drop down.  Enter a valid cron expression as described in the guide I liked before.  Select "control device on a given schedule" check box.  Click update.

The Scheduled ON/OFF APP is simply a C# script that is provided by Gene.  If you want to do something more/different, you can either write your own in any available language or modify something that already exists.

January 05, 2016, 05:14:00 AM
Reply #14

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
OK thanks.  No offense to you or anyone but this could be A LOT easier.

Here are the problems I encountered:

The "enable scheduled on/off" checkbox is nearly invisible until you check it... I did not know it was a check box at all

I typed in a string for "Turn on"  and "Turn Off"  instead of clicking the calendar button....   

I finally got my first scheduled event to post... at least that is something.


Thanks again!!