mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
added temp and windchill for TFA_WIND
git-svn-id: https://svn.fhem.de/fhem/trunk@1889 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
af04296f8e
commit
a350eb1ce1
@ -176,6 +176,24 @@ sub TRX_WEATHER_temperature {
|
||||
|
||||
}
|
||||
|
||||
sub TRX_WEATHER_chill_temperature {
|
||||
my ($bytes, $dev, $res, $off) = @_;
|
||||
|
||||
my $temp =
|
||||
(
|
||||
(($bytes->[$off] & 0x80) ? -1 : 1) *
|
||||
(($bytes->[$off] & 0x7f)*256 + $bytes->[$off+1])
|
||||
)/10;
|
||||
|
||||
push @$res, {
|
||||
device => $dev,
|
||||
type => 'chilltemp',
|
||||
current => $temp,
|
||||
units => 'Grad Celsius'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sub TRX_WEATHER_humidity {
|
||||
my ($bytes, $dev, $res, $off) = @_;
|
||||
my $hum = $bytes->[$off];
|
||||
@ -317,6 +335,11 @@ sub TRX_WEATHER_common_anemometer {
|
||||
my $avspeed = $bytes->[7]*256 + $bytes->[8];
|
||||
my $speed = $bytes->[9]*256 + $bytes->[10];
|
||||
|
||||
if ($dev_type eq "TFA_WIND") {
|
||||
TRX_WEATHER_temperature($bytes, $dev_str, \@res, 11);
|
||||
TRX_WEATHER_chill_temperature($bytes, $dev_str, \@res, 13);
|
||||
}
|
||||
|
||||
push @res, {
|
||||
device => $dev_str,
|
||||
type => 'speed',
|
||||
@ -774,6 +797,15 @@ TRX_WEATHER_Parse($$)
|
||||
$def->{READINGS}{$sensor}{VAL} = $i->{current};
|
||||
$def->{CHANGED}[$n++] = $sensor . ": " . $i->{current};
|
||||
}
|
||||
elsif ($i->{type} eq "chilltemp") {
|
||||
#printf "Temperatur %2.1f %s ; ",$i->{current},$i->{units};
|
||||
$val .= "CT: ".$i->{current}." ";
|
||||
|
||||
$sensor = "windchill";
|
||||
$def->{READINGS}{$sensor}{TIME} = $tm;
|
||||
$def->{READINGS}{$sensor}{VAL} = $i->{current};
|
||||
$def->{CHANGED}[$n++] = $sensor . ": " . $i->{current};
|
||||
}
|
||||
elsif ($i->{type} eq "humidity") {
|
||||
#printf "Luftfeuchtigkeit %d%s, %s ;",$i->{current},$i->{units},$i->{string};
|
||||
$val .= "H: ".$i->{current}." ";
|
||||
|
Loading…
x
Reference in New Issue
Block a user