Page 1 of 2

Request to reflect day / nighttime in clientraw icons (15)

Posted: Thu Sep 23, 2010 9:41 am
by YJB
This is a split of of the the Update 4.6p post in which user Sedrani raised this issue.

In short - client raw field 15 doesn't reflect daytime nighttime icons. All icons are daytime based. This issue surfaced after Boris implemented the "Day Night Flag (field 610 in clientrawextra.

If tried to compile a table to reflect the various icon numbers in day/nighttime. It seems that this is not a one by one translation, so you will see some gaps. Also, feel free to comment if you don't agree with the substitution of a particular field:
Icon Values.jpg
Icon Values.jpg (60.33 KiB) Viewed 10395 times
Boris, are you able to squeeze this sometime in an update? We are basically just looking for a code change that "translates" daytime icon value to nighttime value when the 'Day Night Flag' is "N" for those stations that do not generate all 34 different conditions. (actually, I don't know if there are stations that do generate all these values)

Re: Request to reflect day / nighttime in clientraw icons (1

Posted: Thu Sep 23, 2010 10:55 pm
by rune
You have my vote!

Re: Request to reflect day / nighttime in clientraw icons (1

Posted: Fri Sep 24, 2010 5:26 pm
by d_l
Yes. This would be a great addition to the Meteohub. That matrix looks good to me.

Boris has already implemented daytime icon translations for the VP2 (Thanks, Boris!). Hopefully a similar addition for the other stations and an extension of the existing translation for the VP2 stations would be all it takes.

Re: Request to reflect day / nighttime in clientraw icons (1

Posted: Fri Sep 24, 2010 5:30 pm
by admin
As may weather stations do not provide that full range of symbols there will always be a mismatch.
However, thank you for doing the translation to the nightly symbol numbers. I just did implement this
according to your table. Hopefully, this will have the intended effect. We ll see in the next update...

Re: Request to reflect day / nighttime in clientraw icons (1

Posted: Fri Sep 24, 2010 5:34 pm
by YJB
Thanks Boris,

I agree with the limited number of conditions provided by the other stations.

(How) are you translating the 4 conditions that the Oregon stations are providing?

Code: Select all

1100 (fc 3)- sunny
0110 (fc 2)- half cloudy
0010 (fc 1)- cloudy
0011 (fc 0)- rainy

Re: Request to reflect day / nighttime in clientraw icons (1

Posted: Sat Sep 25, 2010 3:20 am
by Sedrani
Thanks Boris and YIB!

Re: Request to reflect day / nighttime in clientraw icons (1

Posted: Sat Sep 25, 2010 6:43 pm
by rune
Thanks for the quick implementation :D

Re: Request to reflect day / nighttime in clientraw icons (1

Posted: Mon Oct 04, 2010 3:26 am
by Edzo1
FYI ..., I have updated to v4.6q and it's 9:00pm and cloudy outside ...,

my OS WMR-200 is flashing Cloudy icons on console
MH XML indicates the following:
<item sensor="thb0" cat="fc" unit="">1</item>
<item sensor="thb0" cat="fc" unit="wdlive">5</item>

But when I parse the Clientraw file, line 15/Icon indicates "5(Sunny)"

Just wanted to provide some feedback since the recent update.

Ed

Re: Request to reflect day / nighttime in clientraw icons (1

Posted: Mon Oct 11, 2010 9:06 pm
by Sedrani
Hi to all.

During the last three nights, this was the WDL parser output:

015 Forecast Icon I 14 (Night Rain)

It seems that the value of "night cloudy" and "night rain" are inverted or something like this.

Mauro

Re: Request to reflect day / nighttime in clientraw icons (1

Posted: Mon Oct 11, 2010 9:53 pm
by YJB
I agree that things are not completely right, but at this point I'm not sure what exactly.


Might be a good idea if you can compile a table that shows:
meteohub fc and the field 15 "translation" and day or night time

The meteohub fc can be retrieved with:
http://<ip of your meteohub>/meteograph.cgi?text=actual_thb0_fc

field 15 can be retrieved with:
http://<ip of your meteohub>/meteograph.cgi?text=actual_thb0_fc_wdlive

daynight can be retrieved with:
http://<ip of your meteohub>/meteograph.cgi?text=actual_daynight_flag_local

Once we have a list of observed values Boris might be able to see where things are going wrong.

Re: Request to reflect day / nighttime in clientraw icons (1

Posted: Mon Oct 11, 2010 10:03 pm
by Sedrani
I will collect the data for the next days. At the moment, the values are:

actual_thb0_fc --> 2

actual_thb0_fc_wdlive --> 14

actual_daynight_flag_local --> N

Thanks YJB

Re: Request to reflect day / nighttime in clientraw icons (1

Posted: Mon Oct 11, 2010 10:17 pm
by YJB
Hmm, that's strange, I've got:

actual_thb0_fc --> 2
actual_thb0_fc_wdlive --> 5
actual_daynight_flag_local --> N

Boris, can you shed some light on this?

Re: Request to reflect day / nighttime in clientraw icons (1

Posted: Mon Oct 11, 2010 11:07 pm
by admin
looks to be a never ending story :P

Meteohub generates these variables concerning weather status guessing of the station
1) fc
2) fc_wdlive
and when it is a vantage it also gets
3) fc_rule
4) fc_text

this is what happens to the values of those parameters

1) these are codes defined by meteohub, which somehow try to summarize the individual values from supported stations and are used for selection of the Meteohub icon:

Code: Select all

#define FC_LIGHT_SNOWY  8
#define FC_LIGHT_RAINY  7
#define FC_CLEAR_NIGHT  6
#define FC_HALF_CLOUDY_NIGHT    5
#define FC_SNOWY        4
#define FC_SUNNY        3
#define FC_HALF_CLOUDY  2 
#define FC_CLOUDY       1 
#define FC_RAINY        0 
2) codes from above are used to generate wd live codes being reported at position 15 in clientraw.txt using this mapping:

Code: Select all

int fc2wdlive (int i, int nightflag)       // convert fc code to wdlive format
{
  switch (i)
  {
    case FC_LIGHT_SNOWY:        return nightflag ? 17 : 27;      // snow showers
    case FC_LIGHT_RAINY:        return nightflag ? 15 : 22;      // showers
    case FC_CLEAR_NIGHT:        return nightflag ? 2 : 1;        // clear night
    case FC_HALF_CLOUDY_NIGHT:  return nightflag ? 5 : 4;        // cloudy night
    case FC_SNOWY:              return nightflag ? 17 : 25;      // snowing
    case FC_SUNNY:              return nightflag ? 2 : 0;        // sunny
    case FC_HALF_CLOUDY:        return nightflag ? 5 : 19;       // partly cloudy
    case FC_CLOUDY:             return nightflag ? 5 : 2;        // cloudy
    case FC_RAINY:              return nightflag ? 5 : 20;       // rain
    default: return -1;
  }
}
When you have a Vantage Meteohub uses these codes (based on LOOP value position 89 "Forecast Icons" from Vantage protocol):

Code: Select all

int fc2wdlive_vantage (int i, int nightflag)         // convert fc code to wdlive format
{
  switch (i)
  {
    case 8:     return nightflag ? 2 : 0;
    case 6:     return nightflag ? 14 : 19;
    case 2:     return nightflag ? 1 : 2;
    case 3:     return nightflag ? 2 : 10;
    case 18:    return nightflag ? 5 : 20;
    case 19:    return nightflag ? 16 : 23;
    case 7:     return nightflag ? 15 : 22;
    case 22:    return nightflag ? 17 : 27;
    case 23:    return nightflag ? 5 : 24;
    default:    return 0;
  }
}
3) When it is a Vantage Meteohub also reports the rule number "fc_rule" (from LOOP packet position 90 "Forecast Rule Number")

4) When it is a Vantage Meteohub also reports the rule text in English "fc_text" matching rule number of 3).

That is the magic with the variables Meteohub reports. I have no clue if that is what wdlive expects. To my knowledge I applied the conversions rules given in this thread, but it doesn't seem to please you.

Concerning the clientraw upload fomats used by wdlive Meteohub does the following:
a) "clientraw.txt" positions 15 and 48 are feeded by value "fc_wdlive"
b) "clientraw.txt" positions 49 is feeded by value "fc_text"

When you want changes, please let me know. As all this is less than weak documented and I don't have a Vantage to play with, I don't feel enabled to solve the puzzle Brian and Julian did setup for us ;-)

Re: Request to reflect day / nighttime in clientraw icons (1

Posted: Mon Oct 11, 2010 11:30 pm
by Sedrani
FYI these are the 5 values in question (Davis Vantage Vue):

actual_thb0_fc --> 2
actual_thb0_fc_wdlive --> 14
actual_thb0_fc_rule --> 45
actual_thb0_fc_text --> increasing_clouds_with_little_temperature_change
actual_daynight_flag_local --> N

I hope that this problem can be solved.
Thanks.
Mauro

Re: Request to reflect day / nighttime in clientraw icons (1

Posted: Mon Oct 11, 2010 11:45 pm
by admin
actual_thb0_fc --> 2
actual_thb0_fc_wdlive --> 14
actual_thb0_fc_rule --> 45
actual_thb0_fc_text --> increasing_clouds_with_little_temperature_change
actual_daynight_flag_local --> N
Sorry, but I don't understand what to do with this information. My drill down on how Meteohub computes the values gives you the chance to point me to errors in conversion rules and/or errors in bringing these numbers into the correct positions in clientraw files that feed wd-live.