HomeGenie Forum

General Category => Troubleshooting and Support => Topic started by: naps1saps on October 29, 2016, 10:15:19 PM

Title: No Sunset Sunrise Program?
Post by: naps1saps on October 29, 2016, 10:15:19 PM
Trying to get a switch to go on/off @ sunrise sunset and read to use the sunrise sunset program.  I don't have one in my install.  Found an HGX file on Gene's server for a program but it has an object reference error (won't tell me which object is erroring...)

http://www.generoso.info/homegenie/downloads/apps/Sunrise_Sunset_Lights_Control.hgx (http://www.generoso.info/homegenie/downloads/apps/Sunrise_Sunset_Lights_Control.hgx)

I don't really have time to mess around with stuff right now to make something work from scratch so any help would be appreciated.  Running the latest version.
Title: Re: No Sunset Sunrise Program?
Post by: kevinvinv on October 30, 2016, 05:31:06 AM
You have to use the scheduler...   configure | scheduler

Take it from me... if you are short on time...  dont start this project.  There is just NO WAY it is going to go quickly.
Title: Re: No Sunset Sunrise Program?
Post by: kevinvinv on October 30, 2016, 05:42:14 AM
Here is what I put in for the custom cron expression
 ( (@SolarTimes.Sunrise)  > (@SolarTimes.Sunset ) ) ; (2/20 * * * *)

Turns the lights on EVERY 20 minutes between Sunset and Sunrise

In the Modules Tab I select which modules to turn on.off

In the script section... this
// turn off all selected modules
$$.boundModules.off();



Title: Re: No Sunset Sunrise Program?
Post by: naps1saps on November 01, 2016, 04:15:20 AM
I figured it was removed to use scheduler now but the interface is not very intuitive.
I have one switch to turn on/off

I created a new event in scheduler with the what kevininv suggested.
How do I mark the switch to use this event?  I don't see a scheduler option in the module.

There is a schedule on/off option and it seems like you can put a cron expression in there.  What would one be for sunrise and one for sunset?
Title: Re: No Sunset Sunrise Program?
Post by: kevinvinv on November 01, 2016, 04:24:20 AM
You dont mark the switch to use the event anymore- instead you tell the event which switches to control.

In the scheduler dialog where you set up the cron expression etc... there should be a button called "modules" or something like that... click it and then select the module you want to control with that schedule event.
Title: Re: No Sunset Sunrise Program?
Post by: kevinvinv on November 01, 2016, 04:25:32 AM
This is the cron expression to use for sunset to sunrise
 ( (@SolarTimes.Sunrise)  > (@SolarTimes.Sunset ) )
Title: Re: No Sunset Sunrise Program?
Post by: naps1saps on November 01, 2016, 04:30:53 AM
You dont mark the switch to use the event anymore- instead you tell the event which switches to control.

In the scheduler dialog where you set up the cron expression etc... there should be a button called "modules" or something like that... click it and then select the module you want to control with that schedule event.

I think you might be on a different version or my install is messed up.
I have 1.1 r497

I added a screenshot.

In the Schedule on/off it looks like I can put a cron expression there with @Sunrise and @Sunset according to another thread.
Title: Re: No Sunset Sunrise Program?
Post by: naps1saps on November 01, 2016, 04:36:45 AM
I tried a test cron in scheduler and attached @test in the schedule on/off in the module and it worked.

Looks like I'm on an old version but the update manager is not finding any available updates...  Any suggestions?  I'd really like to not have to re-do my system again.
Title: Re: No Sunset Sunrise Program?
Post by: kevinvinv on November 01, 2016, 12:17:16 PM
Yeah I am on version 525.

I think in general if you just download from scratch you can restore your backup into the new version... but I do believe that I may have had to re-do a few things when I did that.

This home automation stuff can e a major time sink...   no arguments about that!
Title: Re: No Sunset Sunrise Program?
Post by: naps1saps on November 01, 2016, 08:03:41 PM
I bit the bullet, no restore from backup... sigh

Now I'm even more confused with r525.  If i try to create a new event all I get is the cron wizard and can't input a custom cron or a name and it doesn't even save.  Editing Outdoor.On gives me the same wizard and it doesn't have any info in it to actually edit.  WHYYYY????

The picture is what I get when I click on Outdoor.On or click new event.
Title: Re: No Sunset Sunrise Program?
Post by: naps1saps on November 02, 2016, 01:35:58 AM
Nevermind.  I backed up, reset, and restored which fixed it.  I'm getting the correct window popping up now.  Even computer techs have random nonsense issues.

*EDIT*
Nevermind nevermind... Seems there is a bug when you change ports.  It works until I change to the port I run my HG on.  Off to post a bug...

*EDIT EDIT*
Nevermind nevermind nevermind... Cache issue with the browser -_____-  Clearing the cache did not clear the cache fully but clicking refresh on the browser did the trick.  SOOOOO ANNOYING!  Guess it pays to be a computer tech.
Title: Re: No Sunset Sunrise Program?
Post by: kevinvinv on November 02, 2016, 02:51:14 AM
AH,  glad to hear you figured it out.  I was just logging in to my HG setup to remember how the screen's go for the scheduler.  Looks like you got it figured out then!  Great!!
Title: Re: No Sunset Sunrise Program?
Post by: naps1saps on November 03, 2016, 06:06:34 AM
Also had to set the long/lat in settings to get the sunset/sunrise algorithm to work otherwise it doesn't work.
Title: Re: No Sunset Sunrise Program?
Post by: jmcgee on November 17, 2016, 12:20:35 AM
I am trying to set a schedule for Outdoor Christmas lights and want to use sunset (or offset) as on time on every day between  Nov 27 and Jan .  This on 525.

I thought I'd start by using the sunrise to sunset as mentioned here.  I entered that in custom cron schedule.  I see it gets replaced by actual times when I reopen it. I tried to set the Zwave module that has the lights, but it only has a check box for lights, but not individual modules.  What am I missing?
Title: Re: No Sunset Sunrise Program?
Post by: dani on November 17, 2016, 09:31:02 AM
Normally in the right part you will find the list of modules to check.
Make sure that your kind of module is light and not switch.
You can check Switch in the left side to see if your switchs appear.
Title: Re: No Sunset Sunrise Program?
Post by: jmcgee on November 17, 2016, 07:41:45 PM
Thanks Dani, indeed it was in Switches, not Lights.  So I picked that and the correct module.  Now, how does it know what to do to the switch?  Where do I tell it to turn it on, turn it off, dim it. etc.
Title: Re: No Sunset Sunrise Program?
Post by: jmcgee on November 18, 2016, 01:28:06 AM
More info. I was fumbling around and realized a package called scheduled on/off was not installed.  I installed it and for some time saw it listed when I edited module. 

but now it is not there.   I went to configure/Programs/Scheduling and it is listed with red button.   I click on it and see this:

Program.Status = "Stopped"
Thu Nov 17 2016 18:25:36 GMT-0600 (CST)

Runtime.Error = "CR: Input string was not in a correct format."
Thu Nov 17 2016 18:25:36 GMT-0600 (CST)
Title: Re: No Sunset Sunrise Program?
Post by: dani on November 18, 2016, 11:38:14 AM
For this question :
http://www.homegenie.it/forum/index.php?topic=1833.msg11148#msg11148 (http://www.homegenie.it/forum/index.php?topic=1833.msg11148#msg11148)
After you have selected the modules click on Script and then open the list box [Add code snippet] to open the default list of code.

For the Runtime error I don't know. Which version of HG are you using. Normaly with the default installation we don't need to install any  more program.
Title: Re: No Sunset Sunrise Program?
Post by: dani on November 18, 2016, 11:48:38 AM
Ok, I found what you did. But with the new scheduler you don't need to install that program. I think it's better to uninstall. Otherwise try to recompile it.
Title: Re: No Sunset Sunrise Program?
Post by: bkenobi on November 18, 2016, 04:52:59 PM
The old scheduler is different and I don't have experience with the new one.  The old one was utilized by setting up "scheduled on/off" as you found.  When you had it installed and enabled, there was a tab on each compatible module that would let you enter a cron expression for both the on and off activity.  The new scheduler is different and should be much better overall.  I need to update, but since I have a very reliable setup that hasn't needed touching in months I'm hesitant to change anything.
Title: Re: No Sunset Sunrise Program?
Post by: jmcgee on November 19, 2016, 02:51:04 PM
Ok, almost there.  For some reason the sunset and sunrise in scheduler are not the sunrise and sunset times Wunderground widget has.  Where do they get their time?



Title: Re: No Sunset Sunrise Program?
Post by: jmcgee on November 19, 2016, 05:53:29 PM
I'll add I found that latitude and longitude were incorrect in Maintenance, location.  Entered correct numbers, hit set and it showed my location.   Restarted homegenie service but scheduler still showing wrong time.
Title: Re: No Sunset Sunrise Program?
Post by: jmcgee on November 20, 2016, 04:04:51 PM
I stumbled around some more, read some more, and figured it out.

(@SolarTimes.Sunset+10 )

This is showing I think 10 minutes after sunset at the correct time when I hover over it in calendar view.
No idea what the difference between @Sunset and @Solartime.Sunset is.

A wiki would be a GREAT thing.
Title: Re: No Sunset Sunrise Program?
Post by: bkenobi on November 21, 2016, 04:31:44 PM
The Weather Underground uses what WU publishes for the sunrise/sunset times given the latitude/longitude you supply.  HG calculates it's own times based on it's algorithm.  If you look at the jkUtils Solar Altitude app, you will see that there are a number of calculations for sunrise/sunset based on who you ask.  Civil is different than maritime which is different than...  The difference is when the sun is officially up/down.  If you use the angle when the sun has officially reached the horizon, that will be different than if you look at first light (well below the horizon).

TL;DR different sources of sunrise/sunset time will never match.  Pick one and go with it as they will all be within 10 minutes of each other and good enough for the most part.  If you want something based on light, maybe invest in a luminescence sensor.
Title: Re: No Sunset Sunrise Program?
Post by: jmcgee on November 21, 2016, 05:33:34 PM
Thanks. The problem was the home genie calculated sunset was hours off from WU. And I had correct lat long in settings.
Title: Re: No Sunset Sunrise Program?
Post by: bkenobi on November 22, 2016, 04:40:55 PM
That's not good.  I don't know what would drive that, but there should be at most a few minutes difference.  Definitely less than hours.  My guess would be that the lat/long is set for Italy by default.  Perhaps you need to change that in your setup to get your location.
Title: Re: No Sunset Sunrise Program?
Post by: jmcgee on November 22, 2016, 07:26:53 PM
No like I said, they are correct coordinates.  Put them into Google maps and went right to my house.
Title: Re: No Sunset Sunrise Program?
Post by: nolio on November 22, 2016, 08:41:29 PM

SunSet/SunRise is (was) create by the EarthTool program. But the website (used by this program) doesn't seems to work fine now :
But "SolarAltitude" created by the program "jkUtils - Solar Altitude" have real value (and no need to have internet connection ;)).
Title: Re: No Sunset Sunrise Program?
Post by: jmcgee on November 22, 2016, 09:05:04 PM
Thank you for explanation of where sunrise sunset gets time. I like the no Internet solution of solar. Altitude.
Title: Re: No Sunset Sunrise Program?
Post by: bkenobi on November 23, 2016, 03:34:30 AM
That's why I'm using Solar Altitude.  I have an internet connection, but I don't want to rely on it to have my lights work correctly.