# $Id: 98_openweathermap.pm 14102 2017-04-25 10:54:58Z betateilchen $
##############################################################################
#
# 98_openweathermap.pm
# An FHEM Perl module connecting to www.openweathermap.org (owo)
# providing the following tasks:
#
# 1. send weather data from your own weather station to owo network
#
# 2. set a wheater station as datasource inside your fhem installation
#
# 3. retrieve wheather date via owo APII from any weather station
# inside owo network
#
# All tasks can be accessed single or in any desired combination.
# Copyright: betateilchen ®
# e-mail : fhem.development@betateilchen.de
#
# This file is part of fhem.
#
# Fhem is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Fhem is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with fhem. If not, see .
#
##############################################################################
# Changelog:
#
# 2013-07-28 initial release
#
# 2013-07-29 fixed: some typos in documentation
# added: "set send"
#
# 2013-07-30 modi: replaced try/catch by eval
# added: some more logging
# added: delete some station readings before update
# added: attribute owoSendUrl
#
# 2013-08-08 added: proxy support by reading env-Settings
#
# 2013-08-11 modi: switched from GetLogLevel() to Log3()
# fixed: use JSON (due to Fritzbox problems)
#
# 2013-08-12 added: XML for decoding, controlled by attribute owoUseXml
# added: attribute owoProxy for proxy configuration
#
# 2013-08-13 added: new reading for html response on "send"
# added: new reading for html response on "get/set"
# 2013-10-12 added: NotifyFn
#
# 2013-12-08 fixed: first try to remove duplicate processing
#
# 2014-02-04 added: shutdownFn
#
# 2014-02-14 modi: changed Loglevel from 3 to 4 where possible
#
# 2014-03-22 added: added set command 'clear'
#
package main;
use strict;
use warnings;
use POSIX;
use XML::Simple;
eval {require JSON};
use feature qw/say switch/;
no if $] >= 5.017011, warnings => 'experimental';
require LWP::UserAgent; # test
my $ua = LWP::UserAgent->new; # test
$ua->timeout(10); # test
$ua->env_proxy; # test
sub OWO_abs2rel($$$);
sub OWO_isday($$);
###################################
sub openweathermap_Initialize($) {
my ($hash) = @_;
$hash->{SetFn} = "OWO_Set";
$hash->{GetFn} = "OWO_Get";
$hash->{DefFn} = "OWO_Define";
$hash->{UndefFn} = "OWO_Undefine";
$hash->{NotifyFn} = "OWO_Notify";
$hash->{AttrFn} = "OWO_Attr";
$hash->{ShutdownFn} = "OWO_Shutdown";
$hash->{AttrList} = "do_not_notify:0,1 ".
"owoGetUrl owoSendUrl owoInterval:600,900,1800,3600 ".
"owoApiKey owoProxy owoStation owoUser owoUseXml:1,0 ".
"owoDebug:0,1 owoRaw:0,1 owoTimestamp:0,1 ".
"owoSrc00 owoSrc01 owoSrc02 owoSrc03 owoSrc04 ".
"owoSrc05 owoSrc06 owoSrc07 owoSrc08 owoSrc09 ".
"owoSrc10 owoSrc11 owoSrc12 owoSrc13 owoSrc14 ".
"owoSrc15 owoSrc16 owoSrc17 owoSrc18 owoSrc19 ".
$readingFnAttributes;
}
sub OWO_Shutdown($) {
my ($hash) = @_;
my $name = $hash->{NAME};
Log3 ($name,4,"owo $name: shutdown requested");
return undef;
}
sub OWO_Set($@){
my ($hash, @a) = @_;
my $name = $hash->{NAME};
my $usage = "Unknown argument, choose one of clear:readings stationById stationByGeo ".
"stationByName stationByZip send:noArg";
my $response;
return "No Argument given" if(!defined($a[1]));
my $urlString = AttrVal($name, "owoGetUrl", undef);
return "Please set attribute owoGetUrl!" if(!defined($urlString));
my $cmd = $a[1];
given($cmd){
when("?") { return $usage; }
when("clear"){
CommandDeleteReading(undef, "$name _.*");
CommandDeleteReading(undef, "$name c_.*");
CommandDeleteReading(undef, "$name g_.*");
return;
}
when("send"){
OWO_GetStatus($hash,1);
return;
}
when("stationByName"){
$urlString = $urlString."?q=";
my $count;
my $element = @a;
for ($count = 2; $count < $element; $count++) {
$urlString = $urlString."%20".$a[$count];
}
}
when("stationById"){
$urlString = $urlString."?id=".$a[2];
}
when("stationByZip"){
$urlString = $urlString."?zip=".$a[2];
}
when("stationByGeo"){
$a[2] = AttrVal("global", "latitude", 0) unless(defined($a[2]));
$a[3] = AttrVal("global", "longitude", 0) unless(defined($a[3]));
$urlString = $urlString."?lat=$a[2]&lon=$a[3]";
}
default: { return $usage; }
}
UpdateReadings($hash, $urlString, "c_");
return;
}
sub OWO_Get($@){
my ($hash, @a) = @_;
my $name = $hash->{NAME};
my $usage = "Unknown argument, choose one of stationById stationByGeo stationByName stationByZip";
my $response;
return "No Argument given" if(!defined($a[1]));
my $urlString = AttrVal($name, "owoGetUrl", undef);
return "Please set attribute owoGetUrl!" if(!defined($urlString));
my $cmd = $a[1];
given($cmd){
when("?") { return $usage; }
when("stationByName"){
$urlString = $urlString."?q=";
my $count;
my $element = @a;
for ($count = 2; $count < $element; $count++) {
$urlString = $urlString."%20".$a[$count];
}
}
when("stationById"){
$urlString = $urlString."?id=".$a[2];
}
when("stationByZip"){
$urlString = $urlString."?zip=".$a[2];
}
when("stationByGeo"){
$a[2] = AttrVal("global", "latitude", 0) unless(defined($a[2]));
$a[3] = AttrVal("global", "longitude", 0) unless(defined($a[3]));
$urlString = $urlString."?lat=$a[2]&lon=$a[3]";
}
default: { return $usage; }
}
UpdateReadings($hash, $urlString, "g_");
return;
# return $response;
}
sub OWO_Attr(@){
my @a = @_;
my $hash = $defs{$a[1]};
my (undef, $name, $attrName, $attrValue) = @a;
given($attrName){
when("owoInterval"){
if($attrValue ne ""){
$attrValue = 600 if($attrValue < 600);
$hash->{helper}{INTERVAL} = $attrValue;
} else {
$hash->{helper}{INTERVAL} = 1800;
}
$attr{$name}{$attrName} = $attrValue;
RemoveInternalTimer($hash);
InternalTimer(gettimeofday()+$hash->{helper}{INTERVAL}, "OWO_GetStatus", $hash, 0);
break;
}
when("owoProxy"){
if($attrValue ne ""){
$ua->proxy(['http'], $attrValue);
}
}
default {
$attr{$name}{$attrName} = $attrValue;
}
}
return "";
}
sub OWO_Notify($$) {
my ($hash,$dev) = @_;
if( grep(m/^INITIALIZED$/, @{$dev->{CHANGED}}) ) {
delete $modules{openweathermap}->{NotifyFn};
foreach my $d (keys %defs) {
next if($defs{$d}{TYPE} ne "openweathermap");
OWO_GetStatus($hash);
}
}
}
sub OWO_GetStatus($;$){
my ($hash, $local) = @_;
my $name = $hash->{NAME};
my $htmlDummy;
$local = 0 unless(defined($local));
$attr{$name}{"owoInterval"} = 600 if(AttrVal($name,"owoInterval",0) < 600);
RemoveInternalTimer($hash);
##### start of send job (own weather data)
#
# do we have anything to send from our own station?
#
my ($user, $pass) = split(":", AttrVal($name, "owoUser",""));
my $station = AttrVal($name, "owoStation", undef);
if(defined($user) && defined($station)){
Log3($name, 3, "owo $name: started: SendData");
my $lat = AttrVal("global", "latitude", "");
my $lon = AttrVal("global", "longitude", "");
my $alt = AttrVal("global", "altitude", "");
my $urlString = AttrVal($name, "owoSendUrl", "http://openweathermap.org/data/post");
my ($p1, $p2) = split("//", $urlString);
$urlString = $p1."//$user:$pass\@".$p2;
my $dataString = "name=$station&lat=$lat&long=$lon&alt=$alt";
my ($count, $paraName, $paraVal, $p, $s, $v, $o);
for ($count = 0; $count < 20; $count++) {
$paraName = "owoSrc".sprintf("%02d",$count);
$paraVal = AttrVal($name, $paraName, undef);
if(defined($paraVal)){
($p, $s, $v, $o) = split(":", AttrVal($name, $paraName, ""));
$o = 0 if(!defined($o));
$v = ReadingsVal($s, $v, 0) + $o;
$dataString = $dataString."&$p=$v";
Log3($name, 4, "owo $name: reading: $paraName $p $s $v");
readingsSingleUpdate($hash, "my_".$p, $v, 1);
}
}
$dataString .= "&APPID=".AttrVal($name, "owoApiKey", "");
my $sendString = $urlString."?".$dataString;
if(AttrVal($name, "owoDebug",1) == 0){
Log3($name, 4, "owo $name: sending: $dataString");
$htmlDummy = $ua->post($sendString);
Log3($name, 3, "owo $name: htmlResponse: ".$htmlDummy->status_line);
} else {
Log3($name, 3, "owo $name: debug: $dataString");
}
readingsBeginUpdate($hash);
readingsBulkUpdate($hash, "_httpResponse_my", $htmlDummy->status_line) if $htmlDummy;
readingsBulkUpdate($hash, "my_response", $htmlDummy->decoded_content) if $htmlDummy;
readingsBulkUpdate($hash, "state","active");
if(AttrVal($name, "owoTimestamp", 0) == 1){
readingsBulkUpdate($hash, "my_lastSent", time);
} else {
readingsBulkUpdate($hash, "my_lastSent", localtime(time));
}
readingsEndUpdate($hash, 1);
if(defined($htmlDummy)){
CommandDeleteReading(undef, "$name my_.*") if $htmlDummy->is_error;
}
}
##### end of send job
##### start of update job (set station)
#
# Do we already have a stationId set?
# If yes => update this station
#
my $cId = ReadingsVal($name,"c_stationId", undef);
if(defined($cId)){
my $cName = ReadingsVal($name,"stationName", "");
Log3($name, 4, "owo $name: retrievingStationData: Id: $cId Name: $cName");
fhem("set $name stationById $cId");
}
##### end of update job
InternalTimer(gettimeofday()+$hash->{helper}{INTERVAL}, "OWO_GetStatus", $hash, 0) unless($local == 1);
return;
}
sub OWO_Define($$){
my ($hash, $def) = @_;
my @a = split("[ \t][ \t]*", $def);
my $name = $hash->{NAME};
$hash->{helper}{INTERVAL} = 1800;
$hash->{helper}{AVAILABLE} = 1;
$attr{$name}{"owoDebug"} = 1;
$attr{$name}{"owoUseXml"} = 1;
$attr{$name}{"owoInterval"} = 1800;
$attr{$name}{"owoGetUrl"} = "http://api.openweathermap.org/data/2.5/weather";
$attr{$name}{"owoSendUrl"} = "http://openweathermap.org/data/post";
if( $init_done ) {
delete $modules{openweathermap}->{NotifyFn};
OWO_GetStatus($hash);
} else {
readingsSingleUpdate($hash, "state", "defined",1);
}
# readingsSingleUpdate($hash, "state","defined",1);
# InternalTimer(gettimeofday()+$hash->{helper}{INTERVAL}, "OWO_GetStatus", $hash, 0);
Log3($name, 4, "owo $name: created");
return;
}
sub OWO_Undefine($$){
my($hash, $name) = @_;
RemoveInternalTimer($hash);
return undef;
}
sub UpdateReadings($$$){
my ($hash, $url, $prefix) = @_;
my $name = $hash->{NAME};
my ($jsonWeather, $response);
my $xmlMode = AttrVal($name, "owoUseXml", "");
$url .= "&mode=xml" if($xmlMode eq "1");
$url .= "&APPID=".AttrVal($name, "owoApiKey", "");
eval {$response = $ua->get("$url")};
#
# error handling for not found stations (error 404 from server)
#
if($response->decoded_content =~ m/error/i){
CommandDeleteReading(undef, "$name $prefix.*");
readingsSingleUpdate($hash, "_httpResponse_".substr($prefix,0,1), $response->decoded_content, 1);
return;
}
if(defined($response)){
if(AttrVal($name, "owoDebug", 1) == 1){
Log3($name, 4, "owo $name: response:\n".$response->decoded_content);
}
} else {
Log3($name, 4, "owo $name: error: no response from server");
return;
}
CommandDeleteReading(undef, "$name $prefix.*");
readingsSingleUpdate($hash, "_httpResponse_".substr($prefix,0,1), $response->status_line, 1);
if($xmlMode eq "1" && $response->is_success){
Log3($name, 4, "owo $name: decoding XML");
my $xml = new XML::Simple;
$jsonWeather = undef;
$jsonWeather = $xml->XMLin($response->decoded_content, KeyAttr => 'current' );
if(defined($jsonWeather)){
readingsBeginUpdate($hash);
if(AttrVal($name, "owoRaw", 0) == 1){
readingsBulkUpdate($hash, $prefix."rawData", $response->decoded_content);
}
readingsBulkUpdate($hash, "_dataSource", "www.openweathermap.org");
readingsBulkUpdate($hash, "_decodedWith", "XML");
readingsBulkUpdate($hash, $prefix."lastWx", $jsonWeather->{lastupdate}{value});
readingsBulkUpdate($hash, $prefix."sunrise", $jsonWeather->{city}{sun}{rise});
readingsBulkUpdate($hash, $prefix."sunset", $jsonWeather->{city}{sun}{set});
readingsBulkUpdate($hash, $prefix."stationId", $jsonWeather->{city}{id});
readingsBulkUpdate($hash, $prefix."stationName", utf8ToLatin1($jsonWeather->{city}{name}));
readingsBulkUpdate($hash, $prefix."stationCountry", $jsonWeather->{city}{country});
readingsBulkUpdate($hash, $prefix."stationLat", sprintf("%.4f",$jsonWeather->{city}{coord}{lat}));
readingsBulkUpdate($hash, $prefix."stationLon", sprintf("%.4f",$jsonWeather->{city}{coord}{lon}));
readingsBulkUpdate($hash, $prefix."temperature", sprintf("%.1f",$jsonWeather->{temperature}{value}-273.15));
readingsBulkUpdate($hash, $prefix."tempMin", sprintf("%.1f",$jsonWeather->{temperature}{min}-273.15));
readingsBulkUpdate($hash, $prefix."tempMax", sprintf("%.1f",$jsonWeather->{temperature}{max}-273.15));
readingsBulkUpdate($hash, $prefix."humidity", $jsonWeather->{humidity}{value});
readingsBulkUpdate($hash, $prefix."pressure", $jsonWeather->{pressure}{value});
# readingsBulkUpdate($hash, $prefix."pressureRel", $jsonWeather->{main}{sea_level});
readingsBulkUpdate($hash, $prefix."windSpeed", $jsonWeather->{wind}{speed}{value});
readingsBulkUpdate($hash, $prefix."windDir", $jsonWeather->{wind}{direction}{value});
readingsBulkUpdate($hash, $prefix."clouds", $jsonWeather->{clouds}{value});
readingsBulkUpdate($hash, $prefix."rain3h", $jsonWeather->{rain}{"3h"});
readingsBulkUpdate($hash, $prefix."snow3h", $jsonWeather->{snow}{"3h"});
readingsBulkUpdate($hash, "state", "active");
readingsEndUpdate($hash, 1);
} else {
Log3($name, 2, "owo $name error: update not possible!");
}
}
if($xmlMode ne "1" && $response->is_success){
Log3($name, 4, "owo $name: decoding JSON");
my $json = JSON->new->allow_nonref;
eval {$jsonWeather = $json->decode($response->decoded_content)}; warn $@ if $@;
if(defined($jsonWeather)){
readingsBeginUpdate($hash);
if(AttrVal($name, "owoRaw", 0) == 1){
readingsBulkUpdate($hash, $prefix."rawData", $response->decoded_content);
}
if(AttrVal($name, "owoTimestamp", 0) == 1){
readingsBulkUpdate($hash, $prefix."lastWx", $jsonWeather->{dt});
readingsBulkUpdate($hash, $prefix."sunrise", $jsonWeather->{sys}{sunrise});
readingsBulkUpdate($hash, $prefix."sunset", $jsonWeather->{sys}{sunset});
} else {
readingsBulkUpdate($hash, $prefix."lastWx", localtime($jsonWeather->{dt}));
readingsBulkUpdate($hash, $prefix."sunrise", localtime($jsonWeather->{sys}{sunrise}));
readingsBulkUpdate($hash, $prefix."sunset", localtime($jsonWeather->{sys}{sunset}));
}
readingsBulkUpdate($hash, "_dataSource", "www.openweathermap.org");
readingsBulkUpdate($hash, "_decodedWith", "JSON");
readingsBulkUpdate($hash, $prefix."stationId", $jsonWeather->{id});
readingsBulkUpdate($hash, $prefix."lastRxCode", $jsonWeather->{cod});
readingsBulkUpdate($hash, $prefix."stationName", utf8ToLatin1($jsonWeather->{name}));
readingsBulkUpdate($hash, $prefix."humidity", $jsonWeather->{main}{humidity});
readingsBulkUpdate($hash, $prefix."pressureAbs", $jsonWeather->{main}{pressure});
readingsBulkUpdate($hash, $prefix."pressureRel", $jsonWeather->{main}{sea_level});
readingsBulkUpdate($hash, $prefix."windSpeed", $jsonWeather->{wind}{speed});
readingsBulkUpdate($hash, $prefix."windDir", $jsonWeather->{wind}{deg});
readingsBulkUpdate($hash, $prefix."clouds", $jsonWeather->{clouds}{all});
readingsBulkUpdate($hash, $prefix."rain3h", $jsonWeather->{rain}{"3h"});
readingsBulkUpdate($hash, $prefix."snow3h", $jsonWeather->{snow}{"3h"});
readingsBulkUpdate($hash, $prefix."stationLat", sprintf("%.4f",$jsonWeather->{coord}{lat}));
readingsBulkUpdate($hash, $prefix."stationLon", sprintf("%.4f",$jsonWeather->{coord}{lon}));
readingsBulkUpdate($hash, $prefix."temperature", sprintf("%.1f",$jsonWeather->{main}{temp}-273.15));
readingsBulkUpdate($hash, $prefix."tempMin", sprintf("%.1f",$jsonWeather->{main}{temp_min}-273.15));
readingsBulkUpdate($hash, $prefix."tempMax", sprintf("%.1f",$jsonWeather->{main}{temp_max}-273.15));
readingsBulkUpdate($hash, "state", "active");
readingsEndUpdate($hash, 1);
} else {
Log3($name, 2, "owo $name error: update not possible!");
}
}
return;
}
sub OWO_abs2rel($$$){
# Messwerte
my $Pa = $_[0];
my $Temp = $_[1];
my $Alti = $_[2];
# Konstanten
my $g0 = 9.80665;
my $R = 287.05;
my $T = 273.15;
my $Ch = 0.12;
my $a = 0.065;
my $E = 0;
if($Temp < 9.1) { $E = 5.6402*(-0.0916 + exp(0.06 * $Temp)); }
else { $E = 18.2194*(1.0463 - exp(-0.0666 * $Temp)); }
my $xp = $Alti * $g0 / ($R*($T+$Temp + $Ch*$E + $a*$Alti/2));
my $Pr = $Pa*exp($xp);
return int($Pr);
}
sub OWO_isday($$){
my $name = $_[0];
my $src = $_[1];
my $response;
if(AttrVal($name, "owoTimestamp",0)){
$response = (time > ReadingsVal($name, $src."_sunrise", 0) && time < ReadingsVal($name, $src."_sunset", 0) ? "1" : "0");
} else {
$response = "Attribute owoTimestamp not set to 1!";
}
return $response;
}
# OpenWeatherMap API parameters
# -----------------------------
# 01 wind_dir - wind direction, grad
# 02 wind_speed - wind speed, mps
# 03 temp - temperature, grad C
# 04 humidity - relative humidity, %
# 05 pressure - atmosphere pressure
# 06 wind_gust - speed of wind gust, mps
# 07 rain_1h - rain in recent hour, mm
# 08 rain_24h - rain in recent 24 hours, mm
# 09 rain_today - rain today, mm
# 10 snow - snow in recent 24 hours, mm
# 11 lum - illumination, W/M²
# 12 radiation - radiation
# 13 dewpoint - dewpoint
# 14 uv - UV index
# name - station name
# lat - latitude
# long - longitude
# alt - altitude, m
1;
=pod
not to be translated
=begin html
openweathermap
Prerequisits
- Module uses following additional Perl modules:
XML::Simple, JSON
If not already installed in your environment, please install them using appropriate commands from your environment.
Use of JSON is optional. You can activate it by setting attribute owoUseXml to 0
- please check global attributes latitude, longitude and altitude are set correctly
- you can use all task alone, in any combination or all together
Define
define <name> openweathermap
This module provides connection to openweathermap-network www.openweathermap.org (owo)
You can use this module to do three different tasks:
- 1. send weather data from your own weather station to owo network.
- 2. set any weather data in owo network as datasource for your fhem installation. Data from this station will be updated periodically.
- 3. retrieve weather data from any weather station in owo network once. (same as 2. but without update)
Example:
define owo openweathermap
Configuration of your owo tasks
- 1. providing your own weather data to owo network
define owo openweathermap
attr owo owoUser myuser:mypassword
attr owo owoStation myStationName
attr owo owoInterval 600
attr owo owoSrc00 temp:sensorname:temperature
- 2. set a weather station from owo network as data source for your fhem installation
set owo stationByName Leimen
set owo stationById 2879241
set owo stationByGeo 49.3511 8.6894
- All commands will retrieve weather data for Leimen (near Heidelberg,DE)
- Readings will be updated periodically, based on value of owoInterval.
- If lat and lon value in stationByGeo are omitted, the corresponding values from global attributes are used.
- All readings will use prefix "c_"
- 3. get weather data from a selected weather station once (e.g. to do own presentations)
get owo stationByName Leimen
get owo stationById 2879241
get owo stationByGeo 49.3511 8.6894
- All commands will retrieve weather data for Leimen (near Heidelberg,DE) once.
- Readings will not be updated periodically.
- If lat and lon value in stationByGeo are omitted, the corresponding values from global attributes are used.
- All readings will use prefix "g_"
Set-Commands
set <name> clear
Delete all readings for cleanup
set <name> send
start an update cycle manually:
- send own data
- update c_* readings from "set" station (if defined)
- does not affect or re-trigger running timer cycles!
- main purpose: for debugging and testing
set <name> <stationById stationId>|<stationByName stationName>|<stationByGeo> [lat lon]>|<stationByZip stationZipCode>
Get-Commands
get <name> <stationById stationId>|<stationByName stationName>|<stationByGeo> [lat lon]>|<stationByZip stationZipCode>
Used exactly as the "set" command, but with two differences:
- all generated readings use prefix "g_" instead of "c_"
- readings will not be updated automatically
Attributes
- do_not_notify
- readingFnAttributes
- owoApiKey
<yourOpenweathermapApiKey> - find it in your owo account! If set, it will be used in all owo requests.
- owoDebug
<0|1> this attribute must be defined and set to 0 to start sending own weather data to owo network. Otherwise you can find all data as debug informations in logfile.
- owoGetUrl
<owoApiUrl> - current URL to owo api. If this url changes, you can correct it here unless updated version of 98_openweather becomes available.
- owoInterval
<intervalSeconds> - define the interval used for sending own weather data and for updating SET station. Default = 1800sec. If deleted, default will be used.
Please do not set interval below 600 seconds! This regulation is defined by openweathermap.org.
Values below 600 will be corrected to 600.
- owoProxy
<proxyAddress> - define a proxy server address, please give full url and port, e.g. http://192.168.111.222:8080
- owoStation
<yourStationName> - define the station name to be used in "my stats" in owo account
- owoUser
<user:password> - define your username and password for owo access here
- owoRaw
<0|1> - defines wether JSON date from owo will be shown in an additional reading (e.g. to use it for own presentations)
- owoSendUrl
Current URL to post your own data. If this url changes, you can correct it here unless updated version of 98_openweather becomes available.
- owoTimestamp
<0|1> - defines whether date/time readings show timestamps or localtime-formatted informations
- owoSrc00 ... owoSrc19
Each of this attributes contains information about weather data to be sent in format owoParam:sensorName:readingName:offset
Example: attr owo owoSrc00 temp:outside:temperature
will define an attribut owoSrc00, and
reading "temperature" from device "outside" will be sent to owo network als paramater "temp" (which indicates current temperature)
Parameter "offset" will be added to the read value (e.g. necessary to send dewpoint - use offset 273.15 to send correct value)
- owoUseXml
<0|1> - defines wether data must be decoded from XML, e.g. JSON not available on Fritzbox
Generated Readings/Events:
- state - current device state (defined|active)
- c_<readingName> - weather data from SET weather station. Readings will be updated periodically
- g_<readingName> - weather data from GET command. Readings will NOT be updated periodically
- my_lastSent - time of last upload to owo network
- my_<readingName> - all readings from own weather station. These readings will be sent to owo network.
Author's notes
- further informations about sending your own weather data to owo: Link
- further informations about owo location search: Link
- further informations about owo weather data: Link
=end html
=begin html_DE
openweathermap
Sorry, keine deutsche Dokumentation vorhanden.
Die englische Doku gibt es hier: openweathermap
=end html_DE
=cut