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

Discussion of the Meteohub software package

Moderator: Mattk

User avatar
YJB
Platinum Boarder
Platinum Boarder
Posts: 387
Joined: Thu Feb 19, 2009 5:53 pm
Location: Venhuizen, Netherlands
Contact:

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

Post 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 10396 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)
rune
Expert Boarder
Expert Boarder
Posts: 104
Joined: Wed Jun 24, 2009 10:51 pm

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

Post by rune »

You have my vote!
User avatar
d_l
Expert Boarder
Expert Boarder
Posts: 140
Joined: Fri Mar 13, 2009 12:58 am
Location: Reno, Nevada USA
Contact:

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

Post 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.
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

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

Post 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...
User avatar
YJB
Platinum Boarder
Platinum Boarder
Posts: 387
Joined: Thu Feb 19, 2009 5:53 pm
Location: Venhuizen, Netherlands
Contact:

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

Post 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
Last edited by YJB on Sun Sep 26, 2010 1:10 pm, edited 1 time in total.
Sedrani
Junior Boarder
Junior Boarder
Posts: 23
Joined: Tue May 18, 2010 10:58 am

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

Post by Sedrani »

Thanks Boris and YIB!
rune
Expert Boarder
Expert Boarder
Posts: 104
Joined: Wed Jun 24, 2009 10:51 pm

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

Post by rune »

Thanks for the quick implementation :D
Edzo1
Senior Boarder
Senior Boarder
Posts: 40
Joined: Sat Feb 14, 2009 5:16 pm
Location: Scituate, MA USA
Contact:

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

Post 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
Sedrani
Junior Boarder
Junior Boarder
Posts: 23
Joined: Tue May 18, 2010 10:58 am

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

Post 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
User avatar
YJB
Platinum Boarder
Platinum Boarder
Posts: 387
Joined: Thu Feb 19, 2009 5:53 pm
Location: Venhuizen, Netherlands
Contact:

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

Post 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.
Sedrani
Junior Boarder
Junior Boarder
Posts: 23
Joined: Tue May 18, 2010 10:58 am

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

Post 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
User avatar
YJB
Platinum Boarder
Platinum Boarder
Posts: 387
Joined: Thu Feb 19, 2009 5:53 pm
Location: Venhuizen, Netherlands
Contact:

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

Post 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?
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

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

Post 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 ;-)
Sedrani
Junior Boarder
Junior Boarder
Posts: 23
Joined: Tue May 18, 2010 10:58 am

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

Post 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
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

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

Post 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.
Post Reply