WD - Solar sensor settings on scripts for YoWindow

User avatar
Tihomir Z
Posts: 180
Joined: Thu Dec 24, 2009 11:03 am
Name: Tihomir
Location: Trnovec Bartolovecki Croatia
Contact:

WD - Solar sensor settings on scripts for YoWindow

Post by Tihomir Z »

I need help with setting the solar sensor in php scripts YoWindow.
Specifically, when a moderately cloudy and solar sensor to show well, as Wdisplay but the YoWindow icon is displayed Mostly cloudy. And, when the sensor shows that the Mostly cloudy then the YoWindow displays Partly cloudy, only these two icons are not displayed well as other icons, Clear, Clear sky it appears good.
Here is the problem that I have noticed, please help with this. I'd still like to add that it would be good to be in the program at each Wdisplay icons added its actual number, this one does not know what that number.
For example, Clear has a number 0, then Mostly clear No. 5 ... and so on.
What should be changed in the PHP scripts to override data from Wdispleya.
Thank you all for your help in advance, especially Jim.
Image
jmcmurry
Posts: 368
Joined: Tue Oct 13, 2009 11:09 am
Name: Jim
Location: Mauston, WI, USA
Contact:

Re: WD - Solar sensor settings on scripts for YoWindow

Post by jmcmurry »

Tihomir,

Right in this section

Code: Select all

   if (time() > $sun_info[sunrise] + ($SolarAMOffset * 60) && time() < $sun_info[sunset] - ($SolarPMOffset * 60)) {
		if ($Solar >= 83) { $sIcon = 0; } else    // Sunny
		if ($Solar >= 80) { $sIcon = 9; } else    // Mostly Clear/Fair
		if ($Solar >= 75) { $sIcon = 5; } else    // Partly Cloudy
		if ($Solar >= 50) { $sIcon = 3; } else    // Mostly Cloudy
		if ($Solar >= 10) { $sIcon = 18;} else    // Overcast          // perhaps 20%
		if ($Solar >   0) { $sIcon = 6; }         // Fog
		$mods .= " solar indicates icon #" . $sIcon.'('.$Conditions[$sIcon][0].') at this moment';
   }
you should be able to set that first column to match the solar % that you have set in Weather Display, then everything should agree.

It looks like you changed the icon numbers in the second column and you shouldn't do that. I suggest you start over with what I have above then only change the solar % to match the condition like you did in WD.

Also make sure your solar offsets are set correctly in the settings so that during early morning and late afternoon this won't be used. WD icons will then be used instead during those times and at night.

- Jim
User avatar
Tihomir Z
Posts: 180
Joined: Thu Dec 24, 2009 11:03 am
Name: Tihomir
Location: Trnovec Bartolovecki Croatia
Contact:

Re: WD - Solar sensor settings on scripts for YoWindow

Post by Tihomir Z »

Thanks Jim
I've now corrected and I hope that now these two icons work well.
That the sensor is working by day, and early in the morning and night, I put the manual entry in Wdisplay program as it was before until I had a solar sensor, it is good to me because I come by all day away from home I'm at work, and then it all works solar sensor .
Thanks again for your help
User avatar
Tihomir Z
Posts: 180
Joined: Thu Dec 24, 2009 11:03 am
Name: Tihomir
Location: Trnovec Bartolovecki Croatia
Contact:

Re: WD - Solar sensor settings on scripts for YoWindow

Post by Tihomir Z »

Hello everyone
Here I volunteer with the same problem around the icons on YoWindow. Only problem about the icon partlycloudy , Mostly cloudy, still these two icons appear on the opposite YoWindow, Wdisplay well evident and it is ok, but YoWindow persistently replace the icons, I do not know what the scripts do to solve this problem. Jim, do you have a solution where you are wrong. Here is the picture below.
Wdisplay is well read by the icon, it is O.K
Image

Image

YoWindow incorrectly displayed the partlycloudy, that's not true.(MostlyCloudy it is OK)
Image
jmcmurry
Posts: 368
Joined: Tue Oct 13, 2009 11:09 am
Name: Jim
Location: Mauston, WI, USA
Contact:

Re: WD - Solar sensor settings on scripts for YoWindow

Post by jmcmurry »

Tihomir,

I will try to watch this over the weekend and see what might be happening.

- Jim
User avatar
Tihomir Z
Posts: 180
Joined: Thu Dec 24, 2009 11:03 am
Name: Tihomir
Location: Trnovec Bartolovecki Croatia
Contact:

Re: WD - Solar sensor settings on scripts for YoWindow

Post by Tihomir Z »

Thank you Jim for your help, and I hope they will find a solution.

Here, below the banner icon is mostlycloudy , and YoWindow shows that partlycloudy and put the icon.
jmcmurry
Posts: 368
Joined: Tue Oct 13, 2009 11:09 am
Name: Jim
Location: Mauston, WI, USA
Contact:

Re: WD - Solar sensor settings on scripts for YoWindow

Post by jmcmurry »

Tihomir,

I have found the problem and have made the change in my script too. For you, please replace this section

Code: Select all

   if (time() > $sun_info[sunrise] + ($SolarAMOffset * 60) && time() < $sun_info[sunset] - ($SolarPMOffset * 60)) {
		if ($Solar >= 90) { $sIcon = 0; } else    // Vedro/Sunny
		if ($Solar >= 75) { $sIcon = 9; } else    // Prete&#382;no vedro/Mostly Clear/Fair
		if ($Solar >= 50) { $sIcon = 5; } else    // Umjereno obla&#269;no/Partly Cloudy
		if ($Solar >= 25) { $sIcon = 3; } else    // Prete&#382;no obla&#269;no/Mostly Cloudy
		if ($Solar >= 10) { $sIcon = 18;} else    // Obla&#269;no/Overcast            // perhaps 20%
		if ($Solar >   0) { $sIcon = 6; }         // Magla/Fog
		$mods .= " solar indicates icon #" . $sIcon.'('.$Conditions[$sIcon][0].') at this moment';
   }
with

Code: Select all

   if (time() > $sun_info[sunrise] + ($SolarAMOffset * 60) && time() < $sun_info[sunset] - ($SolarPMOffset * 60)) {
		if ($Solar >= 90) { $Icon = 0; } else    // Vedro/Sunny
		if ($Solar >= 75) { $Icon = 9; } else    // Prete&#382;no vedro/Mostly Clear/Fair
		if ($Solar >= 50) { $Icon = 5; } else    // Umjereno obla&#269;no/Partly Cloudy
		if ($Solar >= 25) { $Icon = 3; } else    // Prete&#382;no obla&#269;no/Mostly Cloudy
		if ($Solar >= 10) { $Icon = 18;} else    // Obla&#269;no/Overcast            // perhaps 20%
		if ($Solar >   0) { $Icon = 6; }         // Magla/Fog
		$mods .= " solar indicates icon #" . $Icon.'('.$Conditions[$Icon][0].') at this moment';
   }
This is just changing each of the $sIcon variables to $Icon. This way your solar sensor will always override what WD is saying and it wasn't doing that before.

I'm sorry it took so long to find this. - Jim
User avatar
Tihomir Z
Posts: 180
Joined: Thu Dec 24, 2009 11:03 am
Name: Tihomir
Location: Trnovec Bartolovecki Croatia
Contact:

Re: WD - Solar sensor settings on scripts for YoWindow

Post by Tihomir Z »

Jim
Here I replaced by scripts that you describe, and it is now as it should be, once again thank you for your help, thank you once again. :Yahoo!: :good:
This option means a lot that works well because I'm away from home on business, and it is now working solar sensor for me, at least per day.
Tihomir
jmcmurry
Posts: 368
Joined: Tue Oct 13, 2009 11:09 am
Name: Jim
Location: Mauston, WI, USA
Contact:

Re: WD - Solar sensor settings on scripts for YoWindow

Post by jmcmurry »

Good deal Tihomir, I'm glad we finally got that fixed.

- Jim
User avatar
Tihomir Z
Posts: 180
Joined: Thu Dec 24, 2009 11:03 am
Name: Tihomir
Location: Trnovec Bartolovecki Croatia
Contact:

Re: WD - Solar sensor settings on scripts for YoWindow

Post by Tihomir Z »

Hello Jim
Today I put your latest version 2.8 and all is well except for one item.
When night falls, then METAR information includes, for me it is not appropriate because I live very far from the airport, so I'll have to go back to the old version because I am the night I put the information about the state of the sky manually from Wdispleya and then it is good for me . There are many of us who Meter data is not appropriate because we live far away from the airport.
$ UseSolar = true; / / Set the weather icons (unless raining) from the solar data. Include meter conditions at nitetime.
Tihomir
Post Reply