%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 .= "
Net::FTP, List::MoreUtils, XML::Simple, Text::CSV
define <name> GDS <username> <password>
GDSAsHtmlV
, GDSAsHtmlH
and GDSAsHtmlD
.
- The first function returns the HTML code for a vertically arranged weather forecast.
- The second function returns the HTML code for a horizontally arranged weather forecast.
- The third function dynamically picks the orientation depending on whether a smallscreen style is set (vertical layout) or not (horizontal layout).
- The attributes gdsSetCond and gdsSetForecast must be configured for the functions to work.
- Each of these functions accepts an additional parameter to limit the number of icons to display (1...8).
- If the attribute gdsSetForecast is not configured this parameter should be set to 1.define MyForecastWeblink weblink htmlCode { GDSAsHtml("MyWeather") }
where "MyWeather" is the name of your GDS device.
- set <name> clear alerts|all
- set <name> conditions <stationName>
- set <name> forecasts <region>/<stationName>
- set <name> help
- set <name> rereadcfg
- set <name> update
- get <name> alerts <region>
- get <name> conditions <stationName>
- get <name> forecasts <region>
- get <name> conditionsmap <region>
- get <name> forecastsmap <stationName>
- get <name> headlines
- get <name> help
- get <name> list capstations|data|stations
- get <name> radarmap <region>
- get <name> rereadcfg
- get <name> warnings <region>
- get <name> warningssmap <region>
- Net::FTP, List::MoreUtils, XML::Simple, Text::CSV
%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", "na"), 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, "na"), $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") }