38_netatmo: error state, enabled debug logging for verbose 5

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@12052 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markus-m 2016-08-22 16:33:21 +00:00
parent bf74045aed
commit 73b77fdd8c
2 changed files with 49 additions and 6 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # 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. # Do not insert empty lines here, update check depends on it.
- change: 38_netatmo: error state, enabled debug logging for verbose 5
- change: 10_ZWave.pm: change numbers in events (hex -> dec, Forum #56682) - change: 10_ZWave.pm: change numbers in events (hex -> dec, Forum #56682)
- added: 98_exportdevice: new command to export device definitions - added: 98_exportdevice: new command to export device definitions
- feature: 90_at: computeAfterInit attribute (Forum #56706) - feature: 90_at: computeAfterInit attribute (Forum #56706)

View File

@ -1640,7 +1640,8 @@ netatmo_dispatch($$$)
$data =~ s/\n//g; $data =~ s/\n//g;
if( $data !~ m/^{.*}$/ ) { if( $data !~ m/^{.*}$/ ) {
Log3 $name, 2, "$name: invalid json detected: >>$data<<"; Log3 $name, 2, "$name: invalid json detected: \n$data";
$hash->{status} = "error";
return undef; return undef;
} }
@ -2207,6 +2208,10 @@ netatmo_parseReadings($$;$)
} }
} }
} }
else
{
$hash->{status} = "error";
}
} }
@ -2431,6 +2436,10 @@ netatmo_parseGlobal($$)
}#ok }#ok
}#json }#json
else
{
$hash->{status} = "error";
}
return undef; return undef;
@ -2447,7 +2456,7 @@ netatmo_parseForecast($$)
if( $json ) if( $json )
{ {
Log3 $name, 6, "$name: parseforecastdata".Dumper($json); Log3 $name, 5, "$name: parseforecastdata".Dumper($json);
$hash->{status} = $json->{status}; $hash->{status} = $json->{status};
$hash->{status} = $json->{error}{message} if( $json->{error} ); $hash->{status} = $json->{error}{message} if( $json->{error} );
@ -2653,6 +2662,10 @@ netatmo_parseForecast($$)
}#ok }#ok
}#json }#json
else
{
$hash->{status} = "error";
}
return undef; return undef;
@ -2677,6 +2690,7 @@ netatmo_parseHomeReadings($$;$)
if( $hash->{status} eq "ok" ) if( $hash->{status} eq "ok" )
{ {
#$hash->{STATE} = "Connected"; #$hash->{STATE} = "Connected";
return undef if(!defined($json->{body}{homes}));
foreach my $homedata ( @{$json->{body}{homes}}) foreach my $homedata ( @{$json->{body}{homes}})
{ {
next if($homedata->{id} ne $hash->{Home}); next if($homedata->{id} ne $hash->{Home});
@ -3051,6 +3065,10 @@ netatmo_parseHomeReadings($$;$)
$hash->{STATE} = "Error"; $hash->{STATE} = "Error";
} }
} }
else
{
$hash->{status} = "error";
}
} }
@ -3071,6 +3089,10 @@ netatmo_parseCameraPing($$;$)
readingsSingleUpdate($hash, "local_url", $json->{local_url}, 1) if(defined($json->{local_url})); readingsSingleUpdate($hash, "local_url", $json->{local_url}, 1) if(defined($json->{local_url}));
} }
else
{
$hash->{status} = "error";
}
} }
sub sub
@ -3105,6 +3127,10 @@ netatmo_parseTagStatus($$;$)
$hash->{status} = $json->{error}{message} if( $json->{error} ); $hash->{status} = $json->{error}{message} if( $json->{error} );
readingsSingleUpdate($hash, "status", "calibrating", 1); readingsSingleUpdate($hash, "status", "calibrating", 1);
} }
else
{
$hash->{status} = "error";
}
} }
@ -3125,6 +3151,10 @@ netatmo_parseCameraVideo($$;$)
readingsSingleUpdate($hash, "local_url", $json->{local_url}, 1) if(defined($json->{local_url})); readingsSingleUpdate($hash, "local_url", $json->{local_url}, 1) if(defined($json->{local_url}));
} }
else
{
$hash->{status} = "error";
}
} }
sub sub
@ -3238,6 +3268,10 @@ netatmo_parsePersonReadings($$;$)
$hash->{STATE} = "Error"; $hash->{STATE} = "Error";
} }
} }
else
{
$hash->{status} = "error";
}
} }
@ -3415,6 +3449,10 @@ netatmo_parseThermostatReadings($$;$)
$hash->{STATE} = "Error"; $hash->{STATE} = "Error";
} }
} }
else
{
$hash->{status} = "error";
}
} }
@ -3445,7 +3483,7 @@ netatmo_parsePublic($$)
my($hash, $json) = @_; my($hash, $json) = @_;
my $name = $hash->{NAME}; my $name = $hash->{NAME};
Log3 $name, 6, "$name: parsepublic ".Dumper($json); Log3 $name, 5, "$name: parsepublic ".Dumper($json);
if( $json ) { if( $json ) {
$hash->{status} = $json->{status}; $hash->{status} = $json->{status};
@ -3721,6 +3759,10 @@ netatmo_parsePublic($$)
return $hash->{status}; return $hash->{status};
} }
} }
else
{
$hash->{status} = "error";
}
} }
sub sub
@ -4312,7 +4354,7 @@ sub netatmo_DbLog_splitFn($)
} }
elsif($event =~ m/temp/ || $event =~ m/dewpoint/) elsif($event =~ m/temp/ || $event =~ m/dewpoint/)
{ {
$unit = "°C"; $unit = "˚C";
} }
elsif($event =~ m/humidity/) elsif($event =~ m/humidity/)
{ {
@ -4336,7 +4378,7 @@ sub netatmo_DbLog_splitFn($)
} }
elsif($event =~ m/angle/ || $event =~ m/direction/) elsif($event =~ m/angle/ || $event =~ m/direction/)
{ {
$unit = "°"; $unit = "deg";
} }
elsif($event =~ m/strength/ || $event =~ m/gust/) elsif($event =~ m/strength/ || $event =~ m/gust/)
{ {
@ -4356,7 +4398,7 @@ sub netatmo_DbLog_splitFn($)
} }
elsif($event =~ m/air_/) elsif($event =~ m/air_/)
{ {
$unit = "µg/m³"; $unit = "ug/m3";
} }
else else
{ {