| %s | Aktuell: %s %s°C Wind %s km/h %s |
| %s | %s: %s min %s°C %s |
| %s | %s: %s %s°C %s |
| %s | %s: %s max %s°C %s |
| Aktuell | '); + for(my $i=0; $i<$items; $i++) { + my $day = int(($i + 1)/2); + my $timeLabel = $i == 0? ($hour < 17? '18' : '24') : ($i - 1)%2 == 0? '12' : '24'; + my $weekday = $i == 0? ($hour < 17? 'Spät' : 'Nachts') : ($i - 1)%2 == 0? ReadingsVal($d, "fc".$day."_weekday", "?").' früh' : ReadingsVal($d, "fc".$day."_weekday", "?").' spät'; + $ret .= sprintf('%s | ', $weekday); + } + $ret .= '||
| %s | ', $width, GDSIconIMGTag(ReadingsVal($d, "c_weather", "?"), time_str2num(ReadingsTimestamp($d, "c_weather", TimeNow())))); + for(my $i=0; $i<$items; $i++) { + my $day = int(($i + 1)/2); + my $timeLabel = $i == 0? ($hour < 17? '18' : '24') : ($i - 1)%2 == 0? '12' : '24'; + $ret .= sprintf('%s | ', $width, GDSIconIMGTag(ReadingsVal($d, "fc".$day."_weather".$timeLabel, "?"), $i==0 && $hour >= 17? 1 : undef)); + } + $ret .= '||
| %s | ', ReadingsVal($d, "c_weather", "?")); + for(my $i=0; $i<$items; $i++) { + my $day = int(($i + 1)/2); + my $timeLabel = $i == 0? ($hour < 17? '18' : '24') : ($i - 1)%2 == 0? '12' : '24'; + $ret .= sprintf('%s | ', ReadingsVal($d, "fc".$day."_weather".$timeLabel, "?")); + } + $ret .= '||
| %s°C | ', ReadingsVal($d, "c_temperature", "?")); + for(my $i=0; $i<$items; $i++) { + my $day = int(($i + 1)/2); + my $timeLabel = $i == 0? ($hour < 17? '18' : '24') : ($i - 1)%2 == 0? '12' : '24'; + if (($i - 1)%2 == 0) { + $ret .= sprintf('min %s°C | ', ReadingsVal($d, "fc".$day."_tMinAir", "?")); + } else { + if ($i == 0 && $hour >= 17) { + $ret .= sprintf('%s°C | ', ReadingsVal($d, "fc".$day."_tAvgAir".$timeLabel, "?")); + } else { + $ret .= sprintf('max %s°C | ', ReadingsVal($d, "fc".$day."_tMaxAir", "?")); + } + } + } + $ret .= '
| %s km/h %s | ', ReadingsVal($d, "c_windSpeed", "?"), ReadingsVal($d, "c_windDir", "?")); + for(my $i=0; $i<$items; $i++) { + my $day = int(($i + 1)/2); + my $timeLabel = $i == 0? ($hour < 17? '18' : '24') : ($i - 1)%2 == 0? '12' : '24'; + $ret .= sprintf('%s | ', ReadingsVal($d, "fc".$day."_windGust".$timeLabel, "")); + } + $ret .= "
GDSAsHtmlV, GDSAsHtmlH and GDSAsHtmlD. define MyForecastWeblink weblink htmlCode { GDSAsHtml("MyWeather") }