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.
User avatar
Saxtus
Posts: 42
Joined: Wed Jan 02, 2013 3:37 am
Location: Athens, Greece
Contact:

Re: SunTracker - with moving ghost

Post by Saxtus »

I get an error when I try "GetSunStatusWeatherCompensated(0)".
Everything between 1 and 60 doesn't display an error so far.

Maybe I haven't understood exactly what that value means, except that it is counted in minutes.
Can you please clarify?
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 main idea behind the various possible actions is to check if the sun is up or down and to use this variable in a script to execute something based on the condition.

The "normal" one to use is the 'GetSunState'. It will return the sun state based only on the actual sunrise and sunset in your location.

If you intend to control something based on the sun state, it might be that you also would like to consider the current weather in your location. Like when you are turning on lamps, in bad weather conditions, lamps need to be turned on earlier and left on longer. For this purpose you could use the 'GetSunStatusWeatherCompensated' and add the number of minutes that shall be used in the calculation.

As in your example, if you set 'GetSunStatusWeatherCompensated(60)', the calculation will use 60 minutes in total for calculation, depending on the programmed rules (you can see and actually change this in the separate python file 'weather_condition.py' where the various sections hold their specific sets of weather conditions).

So if the weather condition is one of those in section 'weather_conditions_dark' the full time (in your example 60 minutes) will be applied and the lights will be turned on 60 minutes before the actual sunset (and consequently turned off 60 minutes after actual sunrise). If the weather is fair, clear, sunny or something else in the section 'weather_conditions_bright' no time will be added or subtracted...and then there is a section for weather conditions in between where the time will be divided into half.

When you use this you shall not use the value = 0 because it makes no sense, it is the same as using 'GetSunState' instead. The error you see now will not be there when the print statements are removed in the final version

Best regards, Walter
User avatar
Saxtus
Posts: 42
Joined: Wed Jan 02, 2013 3:37 am
Location: Athens, Greece
Contact:

Re: SunTracker - with moving ghost

Post by Saxtus »

Thank you, now it makes sense.

After passing the 00:30 mark without any problem, I believe that you've fixed the problem completely.

Some requests/ideas:
Is there a way to get the next sunrise's timestamp from SunTracker into a variable, kinda like GetSunStateWithTimeStamp does for (next?) sunset?
Also is there a way to use "GetSunStatusWeatherCompensated()" with "Check if time now is inside calculated virtual range" action? (i.e. I don't see an option to select "Weather Compensated Sunrise/Sunset" at it's dropdown boxes).
krambriw wrote:When you use this you shall not use the value = 0 because it makes no sense, it is the same as using 'GetSunState' instead.
The dialog shows and allows zero values, maybe needs a fix and also add some of the description you gave above to it just to spice it up for those not reading the fora?
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 dialog shows and allows zero values
Thanks, will change to allow 1-60, thats easy!

For the rest of your ideas, I think all is possible (with software), just more or less work for each of them.

What are the use cases you have in mind?
get the next sunrise's timestamp from SunTracker into a variable
Do you want actions to pick the time for upcoming sunrise (and sunset) into a variable?
Also is there a way to use "GetSunStatusWeatherCompensated()" with "Check if time now is inside calculated virtual range" action?
This one is a bit more heavy to implement, I need to look at the impact and how much effort it will take, maybe I can find an easy solution.

Best regards, Walter
User avatar
Saxtus
Posts: 42
Joined: Wed Jan 02, 2013 3:37 am
Location: Athens, Greece
Contact:

Re: SunTracker - with moving ghost

Post by Saxtus »

I am just trying an easy way to combine the power of "Compensated Weather" with adding a preset offset, as offered by the other functions.
If you have a better idea in mind to do this, please guide me!
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 »

@saxtus

Attached is a new test version. It includes new features as discussed and understood.
- Added a getter action 'Check if time now is inside calculated virtual range with weather compensated offset' to check dawn/dusk calculations for various twilight options and +/- X minutes offset setting with weather condition compensation.
This action is based on the one where you can check if within time range for the various twilight options and +/- X minutes offset setting and now in addition, with weather condition compensation. This action will return True or False depending on if all conditions are met or not.

- Added a getter action 'GetTimeFor_SunSet_SunRise' to retrieve current time stamps for todays Sunset and Sunrise"
This action will return a list with two strings, one for sunrise time and one for sunset time in the following format:

Code: Select all

('Up|0839', 'Down|1507')

I hope I understood it correctly,

Best regards, Walter
__init__.py
(172.37 KiB) Downloaded 283 times
flopp
Posts: 17
Joined: Mon Dec 24, 2012 8:00 am

Re: SunTracker - with moving ghost

Post by flopp »

If i want to power on when sunset is and turn off when sunrise is, power on during whole night, how do I set it up then.

I have tried with ---- on everything but nothing happens.

I have to add at least OFF time, then it works.

Any ideas?
flopp
Posts: 17
Joined: Mon Dec 24, 2012 8:00 am

Re: SunTracker - with moving ghost

Post by flopp »

I get "URL Error" every 2 minutes.

I got this error as soon as I added Suntracker plugin.

I have Tellstick DUO, Broadcast and scheduler plugins installed.
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 »

I get "URL Error" every 2 minutes.
It might be that your location settings are incorrect...
If i want to power on when sunset is and turn off when sunrise is, power on during whole night, how do I set it up then.
Try to set '1100' on all days like below
Image2.png
User avatar
Saxtus
Posts: 42
Joined: Wed Jan 02, 2013 3:37 am
Location: Athens, Greece
Contact:

Re: SunTracker - with moving ghost

Post by Saxtus »

krambriw wrote:
- Added a getter action 'Check if time now is inside calculated virtual range with weather compensated offset' to check dawn/dusk calculations for various twilight options and +/- X minutes offset setting with weather condition compensation.
This action is based on the one where you can check if within time range for the various twilight options and +/- X minutes offset setting and now in addition, with weather condition compensation. This action will return True or False depending on if all conditions are met or not.
Thank you very much but I can't understand where do I set the weather compensated offset.
I only see the standard offset... (either I didn't understood it correctly) :oops:
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 »

Oh, yes, good point, it is the normal offset setting that is used. Like if you set 60 minutes, when weather compensated it might be changed before it is used in the calculation (same rules applies as for all weather condition based stuff), all depending on the weather condition...
User avatar
Saxtus
Posts: 42
Joined: Wed Jan 02, 2013 3:37 am
Location: Athens, Greece
Contact:

Re: SunTracker - with moving ghost

Post by Saxtus »

I am still confused...
Maybe if you can give me an example with numbers, so I will understand how the offset is used in conjunction with good and with bad weather conditions?
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 action will return true
- if you are within the time range (with the weather compensated offset applied) between the selected twilight options (e.g sunrise/sunset or something else)

The rules for recalculating the offset are the same as described earlier above:
So if the weather condition is one of those in section 'weather_conditions_dark' the full time (in your example 60 minutes) will be applied and the lights will be turned on 60 minutes before the actual sunset (and consequently turned off 60 minutes after actual sunrise). If the weather is fair, clear, sunny or something else in the section 'weather_conditions_bright' no time will be added or subtracted...and then there is a section for weather conditions in between where the time will be divided into half.
As example, assume you define an action and you would like this to return TRUE as long as you are inside the range.

- you select 'Civil Dawn' and 'Civil Dusk'
- you set the offset to 60 minutes

What will happen is that depending on the weather condition, a certain time will be added or subtracted to the actual time for 'Civil Dawn' and 'Civil Dusk' when checking if you are inside or not. If outside the return is of course FALSE. Note that this time adjustment might change many times during the day, in the early morning, time may be added, in the evening, time may be subtracted, all depending on the current weather condition when the check is performed.

BestR Walter
User avatar
Saxtus
Posts: 42
Joined: Wed Jan 02, 2013 3:37 am
Location: Athens, Greece
Contact:

Re: SunTracker - with moving ghost

Post by Saxtus »

What I fail to understand, is where do I set the weather compensation minutes offset.

Thank you for your patience with me! :)
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 offset you set will not be fixed, it will be weather compensated...you set the maximum or minimum value it is allowed to have.

Image2.png
Image2.png (9.21 KiB) Viewed 7794 times
Post Reply