Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Twilight: sunrise/sunset and dusk/dawn plugin.

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
CoderX
Posts: 9
Joined: Sun Sep 20, 2009 6:53 pm

Twilight: sunrise/sunset and dusk/dawn plugin.

Post 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
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

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

Post 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.
CoderX
Posts: 9
Joined: Sun Sep 20, 2009 6:53 pm

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

Post 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
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

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

Post by Pako »

Perhaps you overlooked the fact, that such a plugin already exists.
Pako
CoderX
Posts: 9
Joined: Sun Sep 20, 2009 6:53 pm

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

Post 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
User avatar
riro
Posts: 8
Joined: Thu Jan 08, 2009 4:35 pm
Location: Sweden
Contact:

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

Post 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.
manxam
Posts: 10
Joined: Thu Sep 03, 2009 4:11 am

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

Post 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!
CoderX
Posts: 9
Joined: Sun Sep 20, 2009 6:53 pm

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

Post 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
arturmaj
Posts: 23
Joined: Sun Apr 19, 2009 4:55 pm

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

Post 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.
22hn
Posts: 10
Joined: Tue Jan 19, 2010 9:56 pm

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

Post 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!
Post Reply