diff --git a/fhem/CHANGED b/fhem/CHANGED
index 52b7fc55e..74358e0cc 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,5 +1,8 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
+ - bugfix: 59_Weather: DarkSky and OpenWeatherMapAPI change formated output,
+ add hourly support for DarkSky - thanks to Lippie,
+ multiple factor to wind speed and many bugfix
- bugfix: 73_AutoShuttersControl: Fix shutters drive then window open and
shutter in brightness rage.
- feature: 82_LGTV_WebOS: Support for SkyOnline App
diff --git a/fhem/FHEM/59_Weather.pm b/fhem/FHEM/59_Weather.pm
index 6d2085c44..95260768f 100755
--- a/fhem/FHEM/59_Weather.pm
+++ b/fhem/FHEM/59_Weather.pm
@@ -286,10 +286,10 @@ sub Weather_WriteReadings($$) {
}
}
- my $val= 'T:' . $dataRef->{current}->{temperature} . '°C'
- .' ' . substr($status_items_txt_i18n{1}, 0, 1) . ':' . $dataRef->{current}->{humidity} . '%'
- .' ' . substr($status_items_txt_i18n{0}, 0, 1) . ':' . $dataRef->{current}->{wind} . 'km/h'
- .' P:' . $dataRef->{current}->{pressure} . 'mbar';
+ my $val= 'T: ' . $dataRef->{current}->{temperature} . '°C'
+ .' ' . substr($status_items_txt_i18n{1}, 0, 1) . ': ' . $dataRef->{current}->{humidity} . '%'
+ .' ' . substr($status_items_txt_i18n{0}, 0, 1) . ': ' . $dataRef->{current}->{wind} . 'km/h'
+ .' P: ' . $dataRef->{current}->{pressure} . 'hPa';
Log3 $hash, 4, "$name: $val";
readingsBulkUpdate($hash, 'state', $val);
@@ -620,7 +620,7 @@ sub WeatherAsHtmlD($;$)
Define
define <name> Weather [API=<API>[,<apiotions>]] [apikey=<apikey>]
+ define <name> Weather [API=<API>[,<apioptions>]] [apikey=<apikey>]
[location=<location>] [interval=<interval>] [lang=<lang>]
@@ -783,7 +783,7 @@ sub WeatherAsHtmlD($;$)
Define
- define <name> Weather [API=<API>[,<apiotions>]] [apikey=<apikey>]
+ define <name> Weather [API=<API>[,<apioptions>]] [apikey=<apikey>]
[location=<location>] [interval=<interval>] [lang=<lang>]
Die Parameter haben die folgende Bedeutung:
diff --git a/fhem/FHEM/DarkSkyAPI.pm b/fhem/FHEM/DarkSkyAPI.pm
index 6a2f279f6..5f6f720cc 100644
--- a/fhem/FHEM/DarkSkyAPI.pm
+++ b/fhem/FHEM/DarkSkyAPI.pm
@@ -7,6 +7,7 @@
# All rights reserved
#
# Special thanks goes to:
+# - Lippie hourly forecast code
#
#
# This script is free software; you can redistribute it and/or modify
@@ -228,10 +229,10 @@ sub _ProcessingRetrieveData($$) {
sprintf( "%.1f", $data->{currently}->{pressure} ) + 0.5
),
'wind' => int(
- sprintf( "%.1f", $data->{currently}->{windSpeed} ) + 0.5
+ sprintf( "%.1f", ($data->{currently}->{windSpeed} * 3.6) ) + 0.5
),
'wind_speed' => int(
- sprintf( "%.1f", $data->{currently}->{windSpeed} ) + 0.5
+ sprintf( "%.1f", ($data->{currently}->{windSpeed} * 3.6) ) + 0.5
),
'wind_direction' => $data->{currently}->{windBearing},
'windGust' => int(
@@ -430,12 +431,12 @@ sub _ProcessingRetrieveData($$) {
$data->{daily}->{data}->[$i]->{windBearing},
'wind' => int(
sprintf( "%.1f",
- $data->{daily}->{data}->[$i]->{windSpeed} )
+ ($data->{daily}->{data}->[$i]->{windSpeed} * 3.6) )
+ 0.5
),
'wind_speed' => int(
sprintf( "%.1f",
- $data->{daily}->{data}->[$i]->{windSpeed} )
+ ($data->{daily}->{data}->[$i]->{windSpeed} * 3.6) )
+ 0.5
),
'windGust' => int(
@@ -481,6 +482,71 @@ sub _ProcessingRetrieveData($$) {
$i++;
}
+
+ if ( ref( $data->{hourly}->{data} ) eq "ARRAY"
+ and scalar( @{ $data->{hourly}->{data} } ) > 0 )
+ {
+ ### löschen des alten Datensatzes
+ delete $self->{cached}->{forecast}->{hourly};
+
+ my $i = 0;
+ foreach ( @{ $data->{hourly}->{data} } ) {
+ push(
+ @{ $self->{cached}->{forecast}->{hourly} },
+ {
+ 'pubDate' => strftime(
+ "%a, %e %b %Y %H:%M %p",
+ localtime(
+ $data->{hourly}->{data}->[$i]->{'time'}
+ )
+ ),
+ 'day_of_week' => strftime(
+ "%a",
+ localtime(
+ $data->{hourly}->{data}->[$i]->{'time'}
+ )
+ ),
+ 'temperature' => sprintf( "%.1f", $data->{hourly}->{data}->[$i]->{temperature} ),
+ 'code' =>
+ $codes{ $data->{hourly}->{data}->[$i]->{icon} },
+ 'iconAPI' => $data->{hourly}->{data}->[$i]->{icon},
+ 'condition' => encode_utf8(
+ $data->{hourly}->{data}->[$i]->{summary}
+ ),
+ 'ozone' => $data->{hourly}->{data}->[$i]->{ozone},
+ 'uvIndex' =>
+ $data->{hourly}->{data}->[$i]->{uvIndex},
+ 'precipIntensity' =>
+ $data->{hourly}->{data}->[$i]->{precipIntensity},
+ 'dewPoint' => sprintf( "%.1f",
+ $data->{hourly}->{data}->[$i]->{dewPoint} ),
+ 'humidity' =>
+ $data->{hourly}->{data}->[$i]->{humidity} * 100,
+ 'cloudCover' =>
+ $data->{hourly}->{data}->[$i]->{cloudCover} * 100,
+ 'precipType' =>
+ $data->{hourly}->{data}->[$i]->{precipType},
+
+ 'wind_direction' =>
+ $data->{hourly}->{data}->[$i]->{windBearing},
+ 'wind' => sprintf( "%.1f",
+ $data->{hourly}->{data}->[$i]->{windSpeed} ),
+ 'wind_speed' => sprintf( "%.1f",
+ $data->{hourly}->{data}->[$i]->{windSpeed} ),
+ 'windGust' => sprintf( "%.1f",
+ $data->{hourly}->{data}->[$i]->{windGust} ),
+ 'precipProbability' =>
+ $data->{hourly}->{data}->[$i]->{precipProbability},
+ 'pressure' => sprintf( "%.1f",
+ $data->{hourly}->{data}->[$i]->{pressure} ),
+ 'visibility' => sprintf( "%.1f",
+ $data->{hourly}->{data}->[$i]->{visibility} ),
+ }
+ );
+
+ $i++;
+ }
+ }
}
}
}
diff --git a/fhem/FHEM/OpenWeatherMapAPI.pm b/fhem/FHEM/OpenWeatherMapAPI.pm
index 4debae17f..9f7be4319 100644
--- a/fhem/FHEM/OpenWeatherMapAPI.pm
+++ b/fhem/FHEM/OpenWeatherMapAPI.pm
@@ -300,9 +300,9 @@ sub _ProcessingRetrieveData($$) {
'pressure' =>
int( sprintf( "%.1f", $data->{main}->{pressure} ) + 0.5 ),
'wind' =>
- int( sprintf( "%.1f", $data->{wind}->{speed} ) + 0.5 ),
+ int( sprintf( "%.1f", ($data->{wind}->{speed} * 3.6) ) + 0.5 ),
'wind_speed' =>
- int( sprintf( "%.1f", $data->{wind}->{speed} ) + 0.5 ),
+ int( sprintf( "%.1f", ($data->{wind}->{speed} * 3.6) ) + 0.5 ),
'wind_direction' => $data->{wind}->{deg},
'cloudCover' => $data->{clouds}->{all},
'visibility' =>
@@ -415,12 +415,12 @@ sub _ProcessingRetrieveData($$) {
),
'wind' => int(
sprintf( "%.1f",
- $data->{list}->[$i]->{wind}->{speed} )
+ ($data->{list}->[$i]->{wind}->{speed} * 3.6) )
+ 0.5
),
'wind_speed' => int(
sprintf( "%.1f",
- $data->{list}->[$i]->{wind}->{speed} )
+ ($data->{list}->[$i]->{wind}->{speed} * 3.6) )
+ 0.5
),
'cloudCover' =>