mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
77_SMAEM: contrib 4.0.0
git-svn-id: https://svn.fhem.de/fhem/trunk@20758 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d65a0ffad6
commit
62c1833531
@ -138,7 +138,7 @@ sub SMAEM_Initialize ($) {
|
|||||||
$hash->{DefFn} = "SMAEM_Define";
|
$hash->{DefFn} = "SMAEM_Define";
|
||||||
$hash->{UndefFn} = "SMAEM_Undef";
|
$hash->{UndefFn} = "SMAEM_Undef";
|
||||||
$hash->{DeleteFn} = "SMAEM_Delete";
|
$hash->{DeleteFn} = "SMAEM_Delete";
|
||||||
$hash->{DbLog_splitFn} = "SMAEM_DbLog_splitFn";
|
$hash->{DbLog_splitFn} = "SMAEM_DbLogSplit";
|
||||||
$hash->{DelayedShutdownFn} = "SMAEM_DelayedShutdown";
|
$hash->{DelayedShutdownFn} = "SMAEM_DelayedShutdown";
|
||||||
$hash->{AttrFn} = "SMAEM_Attr";
|
$hash->{AttrFn} = "SMAEM_Attr";
|
||||||
$hash->{AttrList} = "interval ".
|
$hash->{AttrList} = "interval ".
|
||||||
@ -793,7 +793,6 @@ sub SMAEM_ParseDone ($) {
|
|||||||
my @a = split(" ", $row, 2);
|
my @a = split(" ", $row, 2);
|
||||||
readingsBulkUpdate($hash, $a[0], $a[1]);
|
readingsBulkUpdate($hash, $a[0], $a[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
readingsEndUpdate($hash, 1);
|
readingsEndUpdate($hash, 1);
|
||||||
|
|
||||||
delete($hash->{HELPER}{RUNNING_PID});
|
delete($hash->{HELPER}{RUNNING_PID});
|
||||||
@ -824,7 +823,7 @@ return;
|
|||||||
###############################################################
|
###############################################################
|
||||||
# DbLog_splitFn
|
# DbLog_splitFn
|
||||||
###############################################################
|
###############################################################
|
||||||
sub SMAEM_DbLog_splitFn ($) {
|
sub SMAEM_DbLogSplit ($) {
|
||||||
my ($event,$device) = @_;
|
my ($event,$device) = @_;
|
||||||
my ($reading, $value, $unit) = "";
|
my ($reading, $value, $unit) = "";
|
||||||
|
|
||||||
@ -839,8 +838,6 @@ sub SMAEM_DbLog_splitFn ($) {
|
|||||||
$unit = 'V';
|
$unit = 'V';
|
||||||
} elsif($reading =~ m/.*leistung_Zaehler$/) {
|
} elsif($reading =~ m/.*leistung_Zaehler$/) {
|
||||||
$unit = 'kWh';
|
$unit = 'kWh';
|
||||||
} elsif($reading =~ m/.*THD$/) {
|
|
||||||
$unit = '%';
|
|
||||||
} else {
|
} else {
|
||||||
if(!defined($parts[1])) {
|
if(!defined($parts[1])) {
|
||||||
$reading = "state";
|
$reading = "state";
|
||||||
@ -852,8 +849,7 @@ sub SMAEM_DbLog_splitFn ($) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log3 ($device, 5, "SMAEM $device - splitFn returns Reading: ".$reading.", Value: ".
|
Log3 ($device, 5, "SMAEM $device - Split for DbLog done -> Reading: ".$reading.", Value: ".(defined($value)?$value:'').", Unit: ".(defined($unit)?$unit:''));
|
||||||
defined($value)?$value:''.", Unit: ".defined($unit)?$unit:'');
|
|
||||||
|
|
||||||
return ($reading, $value, $unit);
|
return ($reading, $value, $unit);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user