supplement // Nachtrag
if the values in /wxgraphic/DATA/wxgraphic_weewx.txt = in format ""13:00:00 01.10.2022 10,1 9,7 10,1 96,0 9,5 998,3 langsam_fallend 11,3 S 4,8 19,3 07:15:41 18:51:55
i.e. with spaces, then the value for windchill or heatindex is wrong
I changed this in config.txt as follows:
Die Werte in wxgraphic_weewx.txt mit Leerzeichen getrennt und dazu noch als Komma-Werte gespeichert werden
können diese Werte mit Komma und Punkt nicht verglichen werden, dann ist das Ergebnis für WindChill und HeatIndex nicht definiert oder falsch
darum habe ich in der config.txt die folgenden Ergänzungen vorgenommen ($windchill_us und $heatindex_us)
Beispiel bei CUSTOM
/******************************************************************************/
/* write_custom: This function writes your values onto a custom 500X80 banner.*/
/* imagecenteredtext($x, $y, $text, $size, $ttfsize, $color, $angle); */
/******************************************************************************/
function write_custom() {
// let's start by defining some global variables that will be passed between
// functions. This is kind of clunky!
// NOTE: IF YOU ADD ADDITIONAL COLORS YOU'LL NEED TO ADD THEM HERE TOO!
global $color1, $color2, $color3, $color4, $color5, $date, $t_ime, $temp,
$degree_units, $winds, $wind_units, $gust, $raintoday, $rain_units,
$barom, $barom_units, $baromtrendwords, $dewpt, $humidity, $heatindex,
$heat_index_threshold, $windchill, $wind_chill_threshold,
$banner_icon_x, $banner_icon_y, $anti_alias,
$windchill_us, $heatindex_us; // this section does the heat index and wind chill
// it figures out what to show, wind chill, heatindex or nothing
// depending upon your settings
$windchill_us = number_format($windchill, 1, '.', '');
$heatindex_us = number_format($heatindex, 1, '.', '');
switch (TRUE){
// if windchill is <= $wind_chill_threshold we'll output it
case (
$windchill_us <= $wind_chill_threshold):
$feelslike = "Wind Chill: $windchill$degree_units";
imagecenteredtext(90, 52, "$feelslike", 2, 8, $color3, 0);
break;
// if heat index >= $heat_index_threshold we'll output it
case (
$heatindex_us >= $heat_index_threshold):
$feelslike = "Heat Idx: $heatindex$degree_units";
imagecenteredtext(90, 52, "$feelslike", 2, 8, $color1, 0);
break;
} // end switch
-------------------------------------------
There is certainly a better way, but for now it works
Gruss
Hartmut