Log3 changes
git-svn-id: https://svn.fhem.de/fhem/trunk@3781 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -595,7 +595,7 @@ sub TRX_LIGHT_parse_X10 ($$)
|
||||
my $name = $def->{NAME};
|
||||
return "" if(IsIgnored($name));
|
||||
|
||||
Log3 $hash, 5, "TRX_LIGHT_parse_X10() $name devn=$device_name first=$firstdevice command=$command, cmd=$hexdata";
|
||||
Log3 $name, 5, "TRX_LIGHT_parse_X10() $name devn=$device_name first=$firstdevice command=$command, cmd=$hexdata";
|
||||
|
||||
my $n = 0;
|
||||
my $tm = TimeNow();
|
||||
@@ -640,7 +640,7 @@ sub TRX_LIGHT_parse_X10 ($$)
|
||||
readingsBulkUpdate($def, $sensor, $current);
|
||||
} else {
|
||||
$error = sprintf "TRX_LIGHT: error unknown sensor type=%x device_type=%s devn=%s first=%d command=%s", $type, $device_type, $device_name, $firstdevice, $command;
|
||||
Log3 $hash, 1, "TRX_LIGHT_parse_X10() ".$error;
|
||||
Log3 $name, 1, "TRX_LIGHT_parse_X10() ".$error;
|
||||
return $error;
|
||||
}
|
||||
|
||||
@@ -744,7 +744,7 @@ sub TRX_LIGHT_parse_PT2262 ($$)
|
||||
my $name = $def->{NAME};
|
||||
return "" if(IsIgnored($name));
|
||||
|
||||
Log3 $hash, 1, "TRX_LIGHT_parse_PT2262() $name devn=$device_name command=$command, cmd=$hexdata";
|
||||
Log3 $name, 1, "TRX_LIGHT_parse_PT2262() $name devn=$device_name command=$command, cmd=$hexdata";
|
||||
|
||||
my $n = 0;
|
||||
my $val = "";
|
||||
@@ -767,10 +767,10 @@ sub TRX_LIGHT_parse_PT2262 ($$)
|
||||
$command_codes .= ",";
|
||||
#if ($command_codes =~ /$command_rest:(.*),/o ) {
|
||||
if ($command_codes =~ /$command_rest:([a-z|A-Z]*),/ ) {
|
||||
Log3 $hash, 5,"PT2262: found=$1";
|
||||
Log3 $name, 5,"PT2262: found=$1";
|
||||
$command = $1;
|
||||
}
|
||||
Log3 $hash, 1,"TRX_LIGHT_parse_PT2262() readingsBulkUpdate($def, $sensor, $command)";
|
||||
Log3 $name, 1,"TRX_LIGHT_parse_PT2262() readingsBulkUpdate($def, $sensor, $command)";
|
||||
$val = $command;
|
||||
readingsBulkUpdate($def, $sensor, $val);
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ TRX_SECURITY_Set($@)
|
||||
}
|
||||
my $error = "Unknown command $command, choose one of $l";
|
||||
|
||||
Log3 $hash, 1, "TRX_SECURITY_Set() ".$error if ($command ne "?" );
|
||||
Log3 $name, 1, "TRX_SECURITY_Set() ".$error if ($command ne "?" );
|
||||
return $error;
|
||||
}
|
||||
|
||||
@@ -159,15 +159,15 @@ TRX_SECURITY_Set($@)
|
||||
$id2 = $2;
|
||||
$id3 = $3;
|
||||
} else {
|
||||
Log3 $hash, 1,"TRX_SECURITY_Set() lightning1 wrong deviceid: name=$name device_type=$device_type, deviceid=$deviceid";
|
||||
Log3 $name, 1,"TRX_SECURITY_Set() lightning1 wrong deviceid: name=$name device_type=$device_type, deviceid=$deviceid";
|
||||
return "error set name=$name deviceid=$deviceid";
|
||||
}
|
||||
|
||||
# lightning1
|
||||
$hex_prefix = sprintf "0820";
|
||||
$hex_command = sprintf "%02x%02x%02s%02s%02s%02x00", $device_type_num & 0xff, $seqnr, $id1, $id2, $id3, $cmnd;
|
||||
Log3 $hash, 1,"TRX_SECURITY_Set() name=$name device_type=$device_type, deviceid=$deviceid id1=$id1, id2=$id2, id3=$id3, command=$command";
|
||||
Log3 $hash, 5,"TRX_SECURITY_Set() hexline=$hex_prefix$hex_command";
|
||||
Log3 $name, 1,"TRX_SECURITY_Set() name=$name device_type=$device_type, deviceid=$deviceid id1=$id1, id2=$id2, id3=$id3, command=$command";
|
||||
Log3 $name, 5,"TRX_SECURITY_Set() hexline=$hex_prefix$hex_command";
|
||||
|
||||
if ($device_type ne "KD101") {
|
||||
my $sensor = "";
|
||||
@@ -406,7 +406,7 @@ sub TRX_SECURITY_parse_X10Sec($$) {
|
||||
$command = $rec;
|
||||
}
|
||||
} else {
|
||||
Log3 $hash, 1, "TRX_SECURITY_parse_X10Sec() undefined command cmd=$data device-nr=$device, hex=$hexdata";
|
||||
Log3 $name, 1, "TRX_SECURITY_parse_X10Sec() undefined command cmd=$data device-nr=$device, hex=$hexdata";
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -415,18 +415,18 @@ sub TRX_SECURITY_parse_X10Sec($$) {
|
||||
if ($battery_level == 0x9) { $battery = 'batt_ok'}
|
||||
elsif ($battery_level == 0x0) { $battery = 'batt_low'}
|
||||
else {
|
||||
Log3 $hash, 1,"TRX_SECURITY_parse_X10Sec() unkown battery_level=$battery_level";
|
||||
Log3 $name, 1,"TRX_SECURITY_parse_X10Sec() unkown battery_level=$battery_level";
|
||||
}
|
||||
}
|
||||
|
||||
if ($trx_rssi == 1) {
|
||||
$rssi = sprintf("%d", ($bytes->[7] & 0xf0) >> 4);
|
||||
Log3 $hash, 5, "TRX_SECURITY_parse_X10Sec() $name devn=$device_name rssi=$rssi";
|
||||
Log3 $name, 5, "TRX_SECURITY_parse_X10Sec() $name devn=$device_name rssi=$rssi";
|
||||
}
|
||||
|
||||
my $current = "";
|
||||
|
||||
Log3 $hash, 5, "TRX_SECURITY_parse_X10Sec() $name devn=$device_name first=$firstdevice subtype=$subtype command=$command, delay=$delay, batt=$battery cmd=$hexdata";
|
||||
Log3 $name, 5, "TRX_SECURITY_parse_X10Sec() $name devn=$device_name first=$firstdevice subtype=$subtype command=$command, delay=$delay, batt=$battery cmd=$hexdata";
|
||||
|
||||
|
||||
my $n = 0;
|
||||
|
||||
@@ -1178,28 +1178,28 @@ TRX_WEATHER_Parse($$)
|
||||
#print "!> i=".$i."\n";
|
||||
#printf "%s\t",$i->{device};
|
||||
if ($i->{type} eq "temp") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." Temperatur ".$i->{current}." ".$i->{units};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name Temperatur ".$i->{current}." ".$i->{units};
|
||||
$val .= "T: ".$i->{current}." ";
|
||||
|
||||
$sensor = "temperature";
|
||||
readingsBulkUpdate($def, $sensor, $i->{current});
|
||||
}
|
||||
elsif ($i->{type} eq "chilltemp") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." windchill ".$i->{current}." ".$i->{units};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name windchill ".$i->{current}." ".$i->{units};
|
||||
$val .= "CT: ".$i->{current}." ";
|
||||
|
||||
$sensor = "windchill";
|
||||
readingsBulkUpdate($def, $sensor, $i->{current});
|
||||
}
|
||||
elsif ($i->{type} eq "humidity") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." Luftfeuchtigkeit ".$i->{current}.$i->{units};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name Luftfeuchtigkeit ".$i->{current}.$i->{units};
|
||||
$val .= "H: ".$i->{current}." ";
|
||||
|
||||
$sensor = "humidity";
|
||||
readingsBulkUpdate($def, $sensor, $i->{current});
|
||||
}
|
||||
elsif ($i->{type} eq "battery") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." Batterie ".$i->{current};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name Batterie ".$i->{current};
|
||||
my $tmp_battery = $i->{current};
|
||||
my @words = split(/\s+/,$i->{current});
|
||||
$val .= "BAT: ".$words[0]." "; #use only first word
|
||||
@@ -1208,7 +1208,7 @@ TRX_WEATHER_Parse($$)
|
||||
readingsBulkUpdate($def, $sensor, $i->{current});
|
||||
}
|
||||
elsif ($i->{type} eq "pressure") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." Luftdruck ".$i->{current}." ".$i->{units}." Vorhersage=".$i->{forecast};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name Luftdruck ".$i->{current}." ".$i->{units}." Vorhersage=".$i->{forecast};
|
||||
# do not add it due to problems with hms.gplot
|
||||
$val .= "P: ".$i->{current}." ";
|
||||
|
||||
@@ -1219,7 +1219,7 @@ TRX_WEATHER_Parse($$)
|
||||
readingsBulkUpdate($def, $sensor, $i->{forecast});
|
||||
}
|
||||
elsif ($i->{type} eq "speed") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." wind_speed ".$i->{current}." wind_avspeed ".$i->{average};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name wind_speed ".$i->{current}." wind_avspeed ".$i->{average};
|
||||
$val .= "W: ".$i->{current}." ";
|
||||
$val .= "WA: ".$i->{average}." ";
|
||||
|
||||
@@ -1230,7 +1230,7 @@ TRX_WEATHER_Parse($$)
|
||||
readingsBulkUpdate($def, $sensor, $i->{average});
|
||||
}
|
||||
elsif ($i->{type} eq "direction") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." wind_dir ".$i->{current}." ".$i->{string};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name wind_dir ".$i->{current}." ".$i->{string};
|
||||
$val .= "WD: ".$i->{current}." ";
|
||||
$val .= "WDN: ".$i->{string}." ";
|
||||
|
||||
@@ -1238,28 +1238,28 @@ TRX_WEATHER_Parse($$)
|
||||
readingsBulkUpdate($def, $sensor, $i->{current} . " " . $i->{string});
|
||||
}
|
||||
elsif ($i->{type} eq "rain") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." rain ".$i->{current};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name rain ".$i->{current};
|
||||
$val .= "RR: ".$i->{current}." ";
|
||||
|
||||
$sensor = "rain_rate";
|
||||
readingsBulkUpdate($def, $sensor, $i->{current});
|
||||
}
|
||||
elsif ($i->{type} eq "train") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." train ".$i->{current};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name train ".$i->{current};
|
||||
$val .= "TR: ".$i->{current}." ";
|
||||
|
||||
$sensor = "rain_total";
|
||||
readingsBulkUpdate($def, $sensor, $i->{current});
|
||||
}
|
||||
elsif ($i->{type} eq "flip") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." flip ".$i->{current};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name flip ".$i->{current};
|
||||
$val .= "F: ".$i->{current}." ";
|
||||
|
||||
$sensor = "rain_flip";
|
||||
readingsBulkUpdate($def, $sensor, $i->{current});
|
||||
}
|
||||
elsif ($i->{type} eq "uv") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." uv_val ".$i->{current}." uv_risk ".$i->{risk};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name uv_val ".$i->{current}." uv_risk ".$i->{risk};
|
||||
$val .= "UV: ".$i->{current}." ";
|
||||
$val .= "UVR: ".$i->{risk}." ";
|
||||
|
||||
@@ -1273,9 +1273,9 @@ TRX_WEATHER_Parse($$)
|
||||
my $energy_current = $i->{current};
|
||||
if (defined($def->{scale_current})) {
|
||||
$energy_current = $energy_current * $def->{scale_current};
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." scale_current=".$def->{scale_current};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name scale_current=".$def->{scale_current};
|
||||
}
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." energy_current=".$energy_current;
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name energy_current=".$energy_current;
|
||||
$val .= "ECUR: ".$energy_current." ";
|
||||
|
||||
$sensor = "energy_current";
|
||||
@@ -1285,9 +1285,9 @@ TRX_WEATHER_Parse($$)
|
||||
my $energy_current = $i->{current};
|
||||
if (defined($def->{scale_current})) {
|
||||
$energy_current = $energy_current * $def->{scale_current};
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." energy_ch1 scale_current=".$def->{scale_current};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name energy_ch1 scale_current=".$def->{scale_current};
|
||||
}
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." CH1 energy_current=".$energy_current;
|
||||
Log3 $name, 5, "TRX_WEATHER: device=$device_name CH1 energy_current=$energy_current";
|
||||
$val .= "CH1: ".$energy_current." ";
|
||||
|
||||
$sensor = "energy_ch1";
|
||||
@@ -1297,9 +1297,9 @@ TRX_WEATHER_Parse($$)
|
||||
my $energy_current = $i->{current};
|
||||
if (defined($def->{scale_current})) {
|
||||
$energy_current = $energy_current * $def->{scale_current};
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." energy_ch2 scale_current=".$def->{scale_current};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name energy_ch2 scale_current=".$def->{scale_current};
|
||||
}
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." CH2 energy_current=".$energy_current;
|
||||
Log3 $device_name, 5, "TRX_WEATHER: name=$name device=$device_name CH2 energy_current=$energy_current";
|
||||
$val .= "CH2: ".$energy_current." ";
|
||||
|
||||
$sensor = "energy_ch2";
|
||||
@@ -1309,9 +1309,9 @@ TRX_WEATHER_Parse($$)
|
||||
my $energy_current = $i->{current};
|
||||
if (defined($def->{scale_current})) {
|
||||
$energy_current = $energy_current * $def->{scale_current};
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." energy_ch3 scale_current=".$def->{scale_current};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name energy_ch3 scale_current=".$def->{scale_current};
|
||||
}
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." CH3 energy_current=".$energy_current;
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name CH3 energy_current=".$energy_current;
|
||||
$val .= "CH3: ".$energy_current." ";
|
||||
|
||||
$sensor = "energy_ch3";
|
||||
@@ -1321,45 +1321,45 @@ TRX_WEATHER_Parse($$)
|
||||
my $energy_total = $i->{current};
|
||||
if (defined($def->{scale_total}) && defined($def->{add_total})) {
|
||||
$energy_total = sprintf("%.4f",$energy_total * $def->{scale_total} + $def->{add_total});
|
||||
Log3 $iohash, 1, "TRX_WEATHER: device=".$device_name." energy_total scale_total=".$def->{scale_total};
|
||||
Log3 $name, 1, "TRX_WEATHER: name=$name device=$device_name energy_total scale_total=".$def->{scale_total};
|
||||
}
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." energy_total=".$energy_total;
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name energy_total=$energy_total";
|
||||
$val .= "ESUM: ".$energy_total." ";
|
||||
|
||||
$sensor = "energy_total";
|
||||
readingsBulkUpdate($def, $sensor, $energy_total." ".$i->{units});
|
||||
}
|
||||
elsif ($i->{type} eq "weight") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." weight ".$i->{current};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name weight ".$i->{current};
|
||||
$val .= "W: ".$i->{current}." ";
|
||||
|
||||
$sensor = "weight";
|
||||
readingsBulkUpdate($def, $sensor, $i->{current});
|
||||
}
|
||||
elsif ($i->{type} eq "hexline") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: hexline=".$device_name." train ".$i->{current};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name hexline ".$i->{current};
|
||||
$sensor = "hexline";
|
||||
readingsBulkUpdate($def, $sensor, $i->{current});
|
||||
}
|
||||
elsif ($i->{type} eq "rssi") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." rssi ".$i->{current};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name rssi ".$i->{current};
|
||||
$sensor = "rssi";
|
||||
readingsBulkUpdate($def, $sensor, $i->{current});
|
||||
}
|
||||
elsif ($i->{type} eq "date") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." date ".$i->{current};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name date ".$i->{current};
|
||||
$val .= $i->{current}." ";
|
||||
$sensor = "date";
|
||||
readingsBulkUpdate($def, $sensor, $i->{current});
|
||||
}
|
||||
elsif ($i->{type} eq "time") {
|
||||
Log3 $iohash, 5, "TRX_WEATHER: device=".$device_name." time ".$i->{current};
|
||||
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name time ".$i->{current};
|
||||
$val .= $i->{current}." ";
|
||||
$sensor = "time";
|
||||
readingsBulkUpdate($def, $sensor, $i->{current});
|
||||
}
|
||||
else {
|
||||
Log3 $iohash, 1, "TRX_WEATHER: device=".$device_name. " UNKNOWN Type: ".$i->{type}." Value: ".$i->{current}
|
||||
Log3 $name, 1, "TRX_WEATHER: name=$name device=$device_name UNKNOWN Type: ".$i->{type}." Value: ".$i->{current}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user