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.

SunTracker - with moving ghost

Questions and comments specific to a particular plugin should go here.
Post Reply
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post by krambriw »

OK, I see, I could add that the plugin shall send an event with weather compensation as well. (normally it is each actions responsibility, you have individual settings for it where the weather and offset settings are used together in the calculation)

I believe we would also need settings for the weather compensation factor then???

Best regards, Walter
vuego
Experienced User
Posts: 69
Joined: Wed Jan 17, 2007 9:22 pm
Location: Sweden

Re: SunTracker - with moving ghost

Post by vuego »

Hmmm we should not make the configuration too complicated. I don't think there's need for another weather compensation setting.

Let me give an example. Let's say that the sun sets at 21:00 but it's cloudy and weather time compensation is set to 60 min (I'm only using one action).
Currently SunTracker would trigger an event at 20:00 but GetContentsOfVariable will return True until 21:00.

This is my main problem. If GetContentsOfVariable would return False at the same time as SunTracker trigger the On event, all would be fine.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post by krambriw »

Hi Vuego,
Below is a new beta version with a new action added (no configuration needed). Could you try it?

Use it as example in a python script like this:

Code: Select all

bSunStatus = eg.plugins.Suntracker.GetSunStatusWeatherCompensated(15)
print bSunStatus
Edit/correction:
15 is the number of minutes for the compensation, same as in the main actions (should be 0-60 min), same rules as well. Use the same number of minutes you used for your projector action you defined already

You might be right on time compensation during the summer. I guess I'll find out in a couple of months :)
How did this work out for you during this summer? Here at my house it seemed to be a good solution.

Best regards, Walter
__init__.py
(132.5 KiB) Downloaded 370 times
vuego
Experienced User
Posts: 69
Joined: Wed Jan 17, 2007 9:22 pm
Location: Sweden

Re: SunTracker - with moving ghost

Post by vuego »

Walter, you're the man!
This new action seems to work just as intended (I've just tried it today so far:)).

Regarding the summer settings I'm not really sure what it does. I haven't configured the Summer Season settings but my lights have gone on/off with -60, -30 or 0 minutes of weather compensation and I think it has worked out very well.

Thanks again :D
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post by krambriw »

Good to hear!

I have tried it as well and I think it works fine

In addition I found a small snag that still could allow that lights could go off or on due to late weather changes. I have now adjusted this as well and tried it for a couple of days. I have also tried to clean up the code, mainly to avoid duplicated code sections to ease maintenance

The new complete version is as usually in the first post

Best regards, Walter
jaaahaaa
Posts: 16
Joined: Mon May 24, 2010 3:10 pm

Re: SunTracker - with moving ghost

Post by jaaahaaa »

I've got some problems to set it up. I want my lights to turn off 1h after sunrise. Then in the evening I want them to turn on 1h before sundown. How do I set that up?

I'm a bit embarresed to ask but I did go through the readme :S
Thx for a cool plugin
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post by krambriw »

Hi, yes this is not so obvious how to set it up but you can do it in the following way as shown in the picture below

- We need to set a time for the function to start (I put in ON at 11 but if the sun is up, lights will not be turned on until later anyway) ;)
- With an offset of -60 minutes the lights will be turned ON one hour before sunset and stay ON until one hour after sunrise next day

(If you start to use weather data as well, that time setting compensation will start to work together with the offset setting dynamically depending on the weather conditions)

Best regards, Walter
Image3.jpg
jaaahaaa
Posts: 16
Joined: Mon May 24, 2010 3:10 pm

Re: SunTracker - with moving ghost

Post by jaaahaaa »

Thanks seems to work really neat now!
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post by krambriw »

Uploaded a modified version. I made some small bug fixes

# 2010-11-01 Fixed a bug in logging function daylight savings True/False
# 2010-08-30 Fixed a bug in the weather data compensation

(Just replace the __init__.py file if you have the previous version installed)

Best regards, Walter
vuego
Experienced User
Posts: 69
Joined: Wed Jan 17, 2007 9:22 pm
Location: Sweden

Re: SunTracker - with moving ghost

Post by vuego »

Hello Walter.
I'm using your latest version of SunTracker_09.11.2010 and I was wondering why my log keeps getting filled up with SunTracker: Daylight saving is FALSE and W. Europe Standard Time - Timezone every minute.

I haven't seen this behavior before. I've unchecked "Print normal loop information". Any ideas?
Attachments
daylighttimezone.png
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post by krambriw »

:oops:
I uploaded the wrong version (without the fix for that problem)....The correct version is there now

Best regards, Walter
dt1000
Posts: 27
Joined: Thu Apr 01, 2010 5:46 am

Re: SunTracker - with moving ghost

Post by dt1000 »

Quick question:
What is the "Sunstate" action supposed to do?

I assumed it would create an event with the sun state in it, but it doesn't seem to do anything...

Thanks,
Dan
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post by krambriw »

The idea was to allow you to use the current sun status from "outside" of the SunTracker plugin. Like in a script, where you can make a decision based on "if statements", what to do if the sun is up or down

To use the actions you can do like this example in a script

Code: Select all

bSunStatus = eg.plugins.Suntracker.GetContentsOfVariable()
print bSunStatus

bSunStatusWeatherCompensated = eg.plugins.Suntracker.GetSunStatusWeatherCompensated(15)
print bSunStatus
You will see that it prints True or False

The first alternative will give you an answer if the the sun is up (True) or down (False). The second shows basically the same but with weather compensation (15 minutes in this case) depending if it is cloudy, sunny, foggy etc. The weather compensation concept is described earlier in this thread

Best regards, Walter
piert
Experienced User
Posts: 321
Joined: Tue Jun 14, 2011 2:53 pm

Re: SunTracker - with moving ghost

Post by piert »

krambriw wrote: bSunStatus = eg.plugins.Suntracker.GetContentsOfVariable()
print bSunStatus


... will give you an answer if the the sun is up (True) or down (False).....
Hi Walter,

Is it possible to also get just the sun up/sun down request with an offset value?

I would like to use the command in a Python command to get an 'instant offset sunset value'. I thought maybe I could use the parenthesis that you use for the weather offset, but if I add an offset value of -20 between the parenthesis (like: GetContentsOfVariable(-20)) it does not work.

Thanks,
Perry
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post by krambriw »

Hi Perry,

Just to be sure I have understood you correctly:

You want to have the possibility to ask for the offset relative sunrise/sunset. I understand that you would like to send a request like

sunSetOffset = GetSunSetStateOffset()

this would return a value +/- how many minutes left/passed since last sunset

Similar

sunRiseOffset = GetSunRiseStateOffset()

would return the same for sunrise


Lets say it is 1 hour 20 minutes left to sunset: GetSunSetStateOffset() would then return a value of +80


Have I understood you correctly?

Do you want to have the possibility also to add a value in the call for weather compensation? Like GetSunSetStateOffset(15)



Best regards, Walter
Post Reply