Page 1 of 1

Twilight: sunrise/sunset and dusk/dawn plugin.

Posted: Wed Sep 23, 2009 7:54 pm
by CoderX
Hi,

I wrote my first plugin for EventGhost, EventGhost is perfect for my home automation projects (actually it is the best program I found until now). I needed a plug-in that can switch my lights at sunrise and sunset, so I wrote one.

Everything can be found here:

http://sites.google.com/site/eventghost ... s/twilight

~CoderX

Re: Twilight: sunrise/sunset and dusk/dawn plugin.

Posted: Wed Sep 23, 2009 8:26 pm
by Bartman
did you find the eg.scheduler class? I think it is easier to use and more resource friendly than creating you own thread.

Re: Twilight: sunrise/sunset and dusk/dawn plugin.

Posted: Thu Sep 24, 2009 8:16 am
by CoderX
Hi,

I need to calculate the sunrise/set and twilight times once a day. So if the plugin starts I have to calculate the values and schedule the calculation for the next day. All sun events can also be scheduled. Something for the next release.

~CoderX

Re: Twilight: sunrise/sunset and dusk/dawn plugin.

Posted: Thu Sep 24, 2009 9:08 am
by Pako
Perhaps you overlooked the fact, that such a plugin already exists.
Pako

Re: Twilight: sunrise/sunset and dusk/dawn plugin.

Posted: Thu Sep 24, 2009 9:24 am
by CoderX
Yes, I know this plugin, the problem that I have with it is that to much functionality is combined. I would brake it up in a scheduler, sun event generator and holiday event generator plugin. then the user can decide how these plugins interact with each other.

CoderX

Re: Twilight: sunrise/sunset and dusk/dawn plugin.

Posted: Fri Sep 25, 2009 8:56 am
by riro
Great stuff! Will try this asap.

If I did talk any Phyton I would have done this a long time ago... I like the approach, a small focused plugin.

Re: Twilight: sunrise/sunset and dusk/dawn plugin.

Posted: Mon Oct 05, 2009 1:49 am
by manxam
Your plugin is excellent and is exactly what I was looking for. I did notice a problem with it though: Your dusk and dawn are backwards as is the picture on your website. Dusk is the period after sunset before full night and dawn is the period after full night before sunrise.

Cheers!

Re: Twilight: sunrise/sunset and dusk/dawn plugin.

Posted: Mon Oct 05, 2009 9:52 am
by CoderX
Thank you Manxam,
manxam wrote:Your dusk and dawn are backwards
Oeps, you are right, I mixed them up, download the corrected 0.0.2 version here:

http://sites.google.com/site/eventghost ... s/twilight

~CoderX

Re: Twilight: sunrise/sunset and dusk/dawn plugin.

Posted: Thu Oct 15, 2009 2:10 am
by arturmaj
Thanks CoderX.
I have a suggestion, could you add an offset function. I could use it to turn my lights one hour before sunset or turn them of 2 hours after sunrise.

Re: Twilight: sunrise/sunset and dusk/dawn plugin.

Posted: Tue Feb 09, 2010 7:11 am
by 22hn
I totally agree with arturmaj, an offset function would be great...!

My problem is that when the sunrise event triggers, it's still kind of dark inside my house so I wouldn't mind the lights being on for half an hour longer in the morning...

Maybe 2 or 3 configurable offsets that could trigger events like:

Twilight.offset1.sunrise / Twilight.offset1.sunset
Twilight.offset2.sunrise / Twilight.offset2.sunset

A negative offset (like -30) could trigger sunset 30 minutes earlier and sunrise 30 minutes later...

Otherwise, a great plugin!