Trying to understand ... follow you!

Personnal Weather Station (PWS) support
gemini06720

Trying to understand ... follow you!

Post by gemini06720 »

Pasha, I have been trying to follow the improvements you make to the YoWindow tags but I have great difficulties in following your explanations - I know, I am from Canada and I am a bit 'slower' than European people...

OK, here is my latest list of YoWindow tags (as I have understood it):

Code: Select all

<response>
  <current_weather>

    <temperature>
      <current>
          @value - Current temperature
      <feels_like>
          @value - Feels-like temperature
      @unit [c, f] - temperature units
          -c - Celsius (default)
          -f - Fahrenheit
    </temperature>

    <wind>
      <speed>
          @value - Wind speed value
          @unit - [mps, kph, mph] Wind speed units
              -mps - Meters per Second (default)
              -kph - Kilometers per Hour
              -mph - Miles per Hour
      <direction>
          @value - Wind direction angle [0, 359] - where wind blows from, 0 - blows from North, 90 - blows from West
      <gusts>
          @value - Wind gusts speed
          @unit - [mps, kph, mph] - wind speed units
              -mps - Meters per Second (default)
              -kph - Kilometers per Hour
              -mph - Miles per Hour
    </wind>

    <pressure>
        @value - Pressure in Millibars
        @unit - [hPa, mmMerc, inchMerc] - pressure units
            -hPa - hectopascals (default)
            -mmMerc - millimeters of mercury
            -inchMerc - inches of mercury

    <humidity>
        @value - Relative humidity [0, 100] 0 - 100%

    <sky> - Sky conditions
        <clouds>
          @value - [clear, fair, partlyCloudy, mostlyCloudy, overcast]
              -clear - no clouds in the sky
              -fair - 30% or less cloud cover
              -partlyCloudy - 60% or less cloud cover
              -mostlyCloudy - 60-100% cloud cover with clearings
              -overcast - 100% cloud cover

        <precipitation>
          <rain>
            <rate>
                @value - rain rate per hour (mm/hour), 0 means "no rain"
                @unit - [mmph, iph] - rain rate units
                    -mmph - Millimeters per Hour (default)
                    -iph - Inches per Hour
            </rate>
            <daily_total>
                @value - the amount of rain during the day
                @unit - [mm, inch] - rain amount units
            </daily_total>
          </rain>
          <snow>
            <rate>
                @value - snow rate per hour (mm/hour), 0 means "no snow"
                @unit - [mmph, iph] - rain rate units
                    -mmph - Millimeters per Hour (default)
                    -iph - Inches per Hour
            </rate>
            <level>
                @value - snow level over the ground
                @unit - [mm, inch] - snow level units
                    -mm - Millimeters (default)
                    -cm - Centimeters
                    -inch - Inches
            </level>

                Snow level helps YoWindow to choose the season picture.
                When snow level > 0 YoWindow will always display winter landscape.
                When snow level = 0 YoWindow will always display naked landscape.

                If your station does not provide rain or snow rate or snow level,
                do not include the corresponding tag or attribute.

                When a tag is omitted, rain or snow is taken from the closest METAR station.
          </snow>
        </precipitation>

        <thunderstorm> - thunderstorm indication
            @value - the number of lightenings per minute
                -set @value to 0 if there is no thunderstorm
                -set @value to 'yes' if it's thunderstorm but you don't know the lightening rate

        <description>
            @value - sky conditions description, example: "Partly Cloudy"

        <icon>
            @id - icon id
            @format = "wd" - let YoWindow know the icon id is from Weather Display station
              YoWindow will pick sky parameters represented by the icon.
    </sky>

    <uv>
        @value - ultra violet index

    <solar> - solar activity
        @radiation
        @energy

    <visibility>
        @value - visibility distance OR "unlimited" string
        @unit - [m, km, mile] - visibility distance units
            -m - meters
            -km - kilometers
            -mile - miles

        In case your the weather station does not provide a parameter, "clouds" for instance,
        just don't include the corresponding tag in the XML file. The parameter will be taken
        from METAR.

  </current_weather>

</response>
And, here is how my latest YoWindow XML file should look like once the tags have been replaced by weather data (as I have understood it):

Code: Select all

<response>
  <current_weather>
    <temperature>
      <current value="5" unit="c"/>
      <feels_like value="8" unit="c"/>
    </temperature>
    <wind>
      <speed value="10.2" unit="kph"/>
      <direction value="220"/>
      <gusts value="10.2" unit="kph"/>
    </wind>
    <pressure value="979" unit="hPa"/>
    <humidity value="86"/>
    <sky>
      <clouds value="partlyCloudy"/>
      <precipitation>
        <rain>
          <rate>
            <value="2" unit="mmph">
          </rate>
          <daily_total>
            <value="5" unit="mm"/>
          </daily_total>
        </rain>
        <snow>
          <rate>
            <value="2" unit="mmph">
          </rate>
          <level>
            <value="10" unit="cm"/>
          </level>
        </snow>
      </precipitation>
      <thunderstorm value="5"/>
      <description value="Partly Cloudy"/>
      <icon id="21" format="wd"/>
    </sky>
    <uv value="1"/>
    <solar radiation="" energy=""/>
    <visibility value="19" unit="km"/>
  </current_weather>
</response>
Has the '<icon id="number" format="weather station type"/>' tag been dropped - I do not see it (nor have I seen it in along time) on the 'Doc: YoWindow XML' forum page?

For the '<solar radiation="" energy=""/>' tag, you seem to require 2 parameters - my weather station produced only one parameter and the unit is 'w/m2'. Could you please define clearly (at least for me) that you and YoWindow are expecting for the 'radiation' parameter and for the 'energy' parameter.

Thank you.
User avatar
par
Posts: 8629
Joined: Mon Sep 21, 2009 11:56 am
Name: Pasha
Location: Saint-Petersburg, Russia
Contact:

Re: Trying to understand ... follow you!

Post by par »

Hey, Ray!

I have noticed only one error in your XML.
You should set @unit attribute to <temperature> tag, NOT to <current> and <feels_like> tags.

Sorry for my poor way of explaining things.
I'm a programmer, not a Leo Tolstoy.
Please correct my thoughts if you think they sound bad.

<icon> tag has not disappeared.
It is specific for Weather Display station format only.
Because of this it is documented in an individual topic.
The topic is next to YoWindow XML Doc.
http://yowindow.com/forum/viewtopic.php?f=11&t=391

I know almost nothing about solar radiation and energy.
The tag was proposed by Meerkat.
You better ask him.
I would also like to know what is the solar energy and why people need it.

Also, pay attention that Jim and Rainer (Meerkat) are also working on Weather Display PHP script.
Please contact them to avoid double work.
Get YoWindow weather app for your phone or tablet.

Image Image Image
gemini06720

Re: Trying to understand ... follow you!

Post by gemini06720 »

Pasha, thank you for the reply.
You should set @unit attribute to <temperature> tag, NOT to <current> and <feels_like> tags.
OK, if I understand you properly, is this what I should have instead:

Code: Select all

<response>
  <current_weather>
    <temperature unit="c">    <---- change ??
      <current value="5"/>
      <feels_like value="8"/>
    </temperature>
    <wind>
      <speed value="10.2" unit="kph"/>
      <direction value="220"/>
      <gusts value="10.2" unit="kph"/>
    </wind>
    <pressure value="979" unit="hPa"/>
    <humidity value="86"/>
    <sky>
      <clouds value="partlyCloudy"/>
      <precipitation>
        <rain>
          <rate>
            <value="2" unit="mmph">
          </rate>
          <daily_total>
            <value="5" unit="mm"/>
          </daily_total>
        </rain>
        <snow>
          <rate>
            <value="2" unit="mmph">
          </rate>
          <level>
            <value="10" unit="cm"/>
          </level>
        </snow>
      </precipitation>
      <thunderstorm value="5"/>
      <description value="Partly Cloudy"/>
      <icon id="21" format="wd"/>
    </sky>
    <uv value="1"/>
    <solar radiation="" energy=""/>
    <visibility value="19" unit="km"/>
  </current_weather>
</response>
nse>
Pasha, if the above modification is the right one, then, may I suggest that you standardize the way that part of the code is written, for example, as it is written for the wind:

Code: Select all

    <wind>
      <speed value="10.2" unit="kph"/>  <---  value + unit
      <direction value="220"/>
      <gusts value="10.2" unit="kph"/>  <---  value + unit
    </wind>

    <temperature>
      <current value="5" unit="c"/>  <---  value + unit  ??
      <feels_like value="8" unit="c"/>  <---  value + unit  ??
    </temperature>
Sorry for my poor way of explaining things.
I'm a programmer, not a Leo Tolstoy.
Pasha, this XML template is not really documentation, it is your programming map as well as a tool to allow YoWindow to get its data. If you can, try to keep the text definition of the tags and the XML example the same, meaning keep the same position and same number of tags in both the texts and the XML example (do I make sense). :?
Also, pay attention that Jim and Rainer (Meerkat) are also working on Weather Display PHP script.
Please contact them to avoid double work.
I have combined both Jim and Rainer templates for my development - for me it a matter of testing and learning new way of doing PHP things... :)
I would also like to know what is the solar energy and why people need it.
I use the solar energy reading in combination with the UV index to calculate the skin burning rate...
User avatar
par
Posts: 8629
Joined: Mon Sep 21, 2009 11:56 am
Name: Pasha
Location: Saint-Petersburg, Russia
Contact:

Re: Trying to understand ... follow you!

Post by par »

>you standardize the way that part of the code is written, for example, as it is written for the wind:

ok

Pay attention that you don't have to specify "c" as temperature unit since it is the default unit.

>I use the solar energy reading in combination with the UV index to calculate the skin burning rate...

This is very interesting.
In future YoWindow will benefit from this calculations.
Get YoWindow weather app for your phone or tablet.

Image Image Image
gemini06720

Re: Trying to understand ... follow you!

Post by gemini06720 »

par wrote:>you standardize the way that part of the code is written, for example, as it is written for the wind:

ok
Does that mean that you will modify the temperature tag to make it similar to the wind tag? ;) ;)
par wrote:Pay attention that you don't have to specify "c" as temperature unit since it is the default unit.
I know that, but I prefer to keep a standard with my script, so, if a unit can be added to a value then I prefer to have that unit beside the value ... even it the unit I have entered is the default unit... :)
par wrote:>I use the solar energy reading in combination with the UV index to calculate the skin burning rate...

This is very interesting.
In future YoWindow will benefit from this calculations.
I just checked some of my PHP code and the solar radiation is to display the solar temperature (that value is from Weather Display), the solar radiation, the percentage of sun.

Although the solar value is used as a parameter for the skin burning rate, the amount of time in the sun (before burning) is calculated by the amount of UV.
User avatar
par
Posts: 8629
Joined: Mon Sep 21, 2009 11:56 am
Name: Pasha
Location: Saint-Petersburg, Russia
Contact:

Re: Trying to understand ... follow you!

Post by par »

>Does that mean that you will modify the temperature tag to make it similar to the wind tag?

Yes

>Although the solar value is used as a parameter for the skin burning rate, the amount of time in the sun (before burning) is calculated by the amount of UV.

Thanks!
Get YoWindow weather app for your phone or tablet.

Image Image Image
gemini06720

Re: Trying to understand ... follow you!

Post by gemini06720 »

par wrote:>Does that mean that you will modify the temperature tag to make it similar to the wind tag?

Yes
Thank you ... really ... thank you... :D

Pasha, what about adding decimals for the temperature (one decimal), the wind speed (one decimal), the pressure (one decimal), the feel like temperature (one decimal), the rain rate (two decimals), the daily rain (one decimal), the visibility (one decimal as it is), the snow rate (two decimals), the snow level (one decimal), UV index (no decimal) and solar radiation (one decimal).

I know I have already asked for the decimal but was wondering how difficult will it be to add the decimals? My weather software (Weather Display) can already supply the decimals for the values mentioned above.
jmcmurry
Posts: 368
Joined: Tue Oct 13, 2009 11:09 am
Name: Jim
Location: Mauston, WI, USA
Contact:

Re: Trying to understand ... follow you!

Post by jmcmurry »

Ray,

I have thought about the same thing and especially missed the decimals on the rain figures. I held off though thinking that some day we'd be able to "maximize" the inspector and show all of the PWS data that's available, then it might be more appropriate there. But yes, even in the current inspector I think the rain is important.

- Jim
User avatar
Meerkat
Posts: 65
Joined: Thu Jan 21, 2010 4:19 pm
Name: Rainer
Location: Pretoria, South Africa
Contact:

Re: Trying to understand ... follow you!

Post by Meerkat »

Pasha can you please have a look and see if I've got all the tags correct here:
http://www.bashewa.com/yowindow-specs.xml
User avatar
par
Posts: 8629
Joined: Mon Sep 21, 2009 11:56 am
Name: Pasha
Location: Saint-Petersburg, Russia
Contact:

Re: Trying to understand ... follow you!

Post by par »

Jim, Ray, the answer is here.
Ray, please post your requests in the Suggestions forum.

http://yowindow.com/forum/viewtopic.php?p=1678#p1678
Get YoWindow weather app for your phone or tablet.

Image Image Image
Post Reply