Page 25 of 38

Re: SunTracker - with moving ghost

Posted: Sun Jan 13, 2013 7:02 am
by blaher
Is the latitude / longitude figure supposed to be red if you put in a negative figure? e.g. a southern hemisphere country

Thanks!

Re: SunTracker - with moving ghost

Posted: Sun Jan 13, 2013 7:44 am
by krambriw
Yes, this is the standard for SpinNumCtrl

BestR

Re: SunTracker - with moving ghost

Posted: Thu Jan 24, 2013 5:59 am
by Saxtus
Hello!

I think I've found a bug again!

I am trying the "SunTracker: Check if time now is inside calculated virtual range including a weather compensated offset" functions with the following settings:

Image

The sunset part seems working ok.
The sunrise part is not.
It returns True at Sunrise (7:35am in my case), ignoring the offset,
then goes back to returning False at 7:52am (obeying the offset),
until 8:35am that start returning True again (as expected).

Re: SunTracker - with moving ghost

Posted: Sat Jan 26, 2013 10:06 am
by krambriw
I'm not so sure. Have you verified that the conditions are all fulfilled or not changed during the possible time interval range?

Every minute the calculation happens and the weather compensation is taken into consideration. Suppose the
weather condition changes during the time period (in your case we are talking about 2 hours). What could happen
is that you will get 'true' already at sunrise even with -120 minutes if the weather condition is
in the list 'weather_conditions_dark'. If the weather condition then changes, you could get 'false' again if you are still
in the sunrise+120 minutes range. Actually, you could get a lot of changes 'true'/'false' within this range if
the weather condition would change dramatically several times.

To verify better, you could active the print statement that is in the plugin code.

Line nbr 4610:

Code: Select all

        print isInsideRange, currCondition, self.iTimeAhead
This morning, the results in my case was the following:

Code: Select all

2013-01-26 09:09:00  ["'Main.Weather", "Condition:'"]Main.Weather Condition: 'Mostly Cloudy'
2013-01-26 09:09:00           ('Up|0810', 'Down|1551')
2013-01-26 09:09:00           False Mostly Cloudy -60
2013-01-26 09:10:00  ["'Main.Weather", "Condition:'"]Main.Weather Condition: 'Mostly Cloudy'
2013-01-26 09:10:00           ('Up|0810', 'Down|1551')
2013-01-26 09:10:00           True Mostly Cloudy -60
As you can see, it was -60 minutes compensation as expected.

A little later the weather was changed:

Code: Select all

2013-01-26 10:45:00  ["'Main.Weather", "Condition:'"]Main.Weather Condition: 'Light Sleet'
2013-01-26 10:45:00           ('Up|0810', 'Down|1551')
2013-01-26 10:45:00           True Light Sleet 0
To get the first line printing the base sunrise/sunset times, I use a simple python script with:

Code: Select all

print eg.plugins.Suntracker.GetTimeFor_SunSet_SunRise()
You have to compare those data to verify if the return value is correct or not. In the example above, I would get
true exactly at sunrise since the weather condition 'Light Sleet' would give a resulting time compensation of zero.

Best regards, Walter

Re: SunTracker - with moving ghost

Posted: Sat Jan 26, 2013 2:24 pm
by Saxtus
krambriw wrote:Have you verified that the conditions are all fulfilled or not changed during the possible time interval range?
Yes and sorry for forgetting mentioning it.
I was proactive and I checked the weather statements from the log: It was "Mostly Cloudy" at the entire time.

Thing is that I woke up that time, but I don't know when that will happen again to make more tests.

Re: SunTracker - with moving ghost

Posted: Sat Jan 26, 2013 2:57 pm
by krambriw
OK, but you could activate the thing as i have from now and then just log it, hopefully we will get some data captured that can help us find the issue. For better logging, use Pako's nice 'Log redirector' plugin.

BestR Walter

Re: SunTracker - with moving ghost

Posted: Sat Jan 26, 2013 3:22 pm
by Saxtus
I did. I will let you know of my findings.
Let's hope I was just not fully awake and I misread my logs! :lol:

Re: SunTracker - with moving ghost

Posted: Wed Jan 30, 2013 10:10 am
by krambriw
@saxtus

Just some interesting observations:

This morning, the following was in the log

At sunrise, the weather made the total time compensation to -60 minutes, expected the 'true' condition to happen at 0901 instead of 0801 (actual sunrise)
2013-01-30 08:00:00 ["'Main.Weather", "Condition:'"]Main.Weather Condition: 'Mostly Cloudy'
2013-01-30 08:00:00 ('Up|0801', 'Down|1601')
2013-01-30 08:00:00 False Mostly Cloudy -60
2013-01-30 08:01:00 ["'Main.Weather", "Condition:'"]Main.Weather Condition: 'Mostly Cloudy'
2013-01-30 08:01:00 ('Up|0801', 'Down|1601')
2013-01-30 08:01:00 False Mostly Cloudy -60
2013-01-30 08:01:00 EVENT: Main.Sunrise
2013-01-30 08:02:00 ["'Main.Weather", "Condition:'"]Main.Weather Condition: 'Mostly Cloudy'
2013-01-30 08:02:00 ('Up|0801', 'Down|1601')
2013-01-30 08:02:00 False Mostly Cloudy -60
2013-01-30 08:03:00 ["'Main.Weather", "Condition:'"]Main.Weather Condition: 'Mostly Cloudy'
2013-01-30 08:03:00 ('Up|0801', 'Down|1601')
2013-01-30 08:03:00 False Mostly Cloudy -60
But next in a few minutes, the weather changed to 'Light Rain' and the condition became 'true' instantly
2013-01-30 08:08:00 ["'Main.Weather", "Condition:'"]Main.Weather Condition: 'Mostly Cloudy'
2013-01-30 08:08:00 ('Up|0801', 'Down|1601')
2013-01-30 08:08:00 False Mostly Cloudy -60
2013-01-30 08:09:00 ["'Main.Weather", "Condition:'"]Main.Weather Condition: 'Light Rain'
2013-01-30 08:09:00 ('Up|0801', 'Down|1601')
2013-01-30 08:09:00 True Light Rain 0
The weather stayed like this for a while and then later changed to 'Rain' and kept the condition 'true'.

Everything worked as expected.

Best regards, Walter

Re: SunTracker - with moving ghost

Posted: Wed Jan 30, 2013 3:10 pm
by Saxtus
Until I have the log file to prove it, your script works as expected.
This time I am prepared, log is created 24/7, but at sunrise your script is used only when I am awake and that somehow haven't happened yet!

Re: SunTracker - with moving ghost

Posted: Thu Feb 14, 2013 6:38 pm
by Saxtus
Saxtus wrote:Until I have the log file to prove it, your script works as expected.
This time I am prepared, log is created 24/7, but at sunrise your script is used only when I am awake and that somehow haven't happened yet!
Proof log

Image
Now, either I don't understand how compensation works, or the value is ignored completely if the weather is good and does zero compensation.
What I am looking for, is a way to have combined custom compensation + weather compensation.

Re: SunTracker - with moving ghost

Posted: Thu Feb 14, 2013 8:56 pm
by krambriw
Now, either I don't understand how compensation works, or the value is ignored completely if the weather is good and does zero compensation.
What I am looking for, is a way to have combined custom compensation + weather compensation.
What I can see, the logic is working correctly (even if it is not matching your expectations).

'Light Rain' is defined under 'weather_conditions_dark():'

What will happen is that your '-120' will be fully weather compensated and therefore you see a ' 0 ' value.

If the weather would have been some condition under the section 'weather_conditions_half_bright():' the compensation would result in ' -60 ' and for all conditions under 'weather_conditions_bright():' the result would be ' -120 '.

I think I understand, you would actually like to have a fixed offset setting as well in combination with the weather stuff.

So as example, assume a fixed offset of ' -60 ' and a weather compensation of ' -60 '. This would result in a the following possible resulting compensations: -120, -90 and -60

If you instead would set ' +30 ' as fixed and ' -60 ' for weather, the possible resulting could be: -30, 0 and +30

Did I understand your expectation correctly?

Best regards, Walter

Re: SunTracker - with moving ghost

Posted: Thu Feb 14, 2013 9:12 pm
by Saxtus
krambriw wrote:Did I understand your expectation correctly?
Yes!
I thought it was clear from a previous post of mine. :oops:

Re: SunTracker - with moving ghost

Posted: Fri Feb 15, 2013 3:13 pm
by krambriw
@saxtus

Attached version I think is working correctly...

Now you configure first the default offset you like to have (-120 ---- +120 minutes)

Second you set the weather compensation time base (0 ---- +120 minutes)

If clear weather, only the offset will have an impact, if weather gets bad, the weather compensation comes into consideration.

Like if you have -60 as offset, in good weather it will return 'false' 60 minutes before sunset and 'true' 60 minutes after sunrise.

If you then add a value for the weather compensation, like 30, this will be used as well: in good weather it will not be considered at all, in half bad 15 minutes will be added so you would get -75 and in bad weather you would get -90 in total correction.

Let me know what you think about it?

Best regards, Walter
__init__.py
(173.31 KiB) Downloaded 315 times

PS I have tried testing as much as possible by changing my PC clock back and forth, it looked ok in my tests.

Re: SunTracker - with moving ghost

Posted: Fri Feb 15, 2013 5:36 pm
by Saxtus
Thank you once again!
I've installed it, configured it and seems working ok so far.

I guess time will tell!

Re: SunTracker - with moving ghost

Posted: Wed Feb 27, 2013 7:17 am
by krambriw
Released version updated in first post