2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

46_TRX_WEATHER.pm: added: Maverick ET732,733 grill thermometer, WT0122 pool sensor, Inovalley S80 plant humidity sensor, Imagintronix/Opus XT300 Soil sensor, Alecto WS1700 and compatibles, Alecto WS3500, WS4500, Auriol H13726, Hama EWS1500, Meteoscan W155/W160, Ventus WS155

git-svn-id: https://svn.fhem.de/fhem/trunk@10766 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
wherzig 2016-02-07 22:07:41 +00:00
parent 16e8ee53f4
commit 134613da76

View File

@ -17,10 +17,12 @@
# * "WS2300" is La Crosse WS2300
# * "RUBICSON" is RUBiCSON
# * "TFA_303133" is TFA 30.3133
# * "WT0122" is WT0122 pool sensor
#
# humidity sensors (HYDRO):
# * "TX3" is LaCrosse TX3
# * "WS2300" is # LaCrosse WS2300
# * "WS2300" is LaCrosse WS2300
# * "S80" is Inovalley S80 plant humidity sensor
#
# temperature/humidity sensors (TEMPHYDRO):
# * "THGR228N" is THGN122/123, THGN132, THGR122/228/238/268
@ -34,6 +36,9 @@
# * "VIKING_02038" is Viking 02035,02038 (02035 has no humidity)
# * "RUBICSON" is Rubicson
# * "EW109" is EW109
# * "XT300" is Imagintronix/Opus XT300 Soil sensor
# * "WS1700" is Alecto WS1700 and compatibles
# * "WS3500" is Alecto WS3500, WS4500, Auriol H13726, Hama EWS1500, Meteoscan W155/W160, Ventus WS155
#
# temperature/humidity/pressure sensors (TEMPHYDROBARO):
# * "BTHR918" is BTHR918
@ -45,7 +50,8 @@
# * "TFA_RAIN" is TFA
# * "RG700" is UPM RG700
# * "WS2300_RAIN" is WS2300
# * "TX5_RAIN" is La Crosse TX5
# * "TX5_RAIN" is La Crosse TX5
# * "WS4500_RAIN" is Alecto WS4500, Auriol H13726, Hama EWS1500, Meteoscan W155/W160,
#
# wind sensors (WIND):
# * "WTGR800_A" is WTGR800
@ -54,11 +60,12 @@
# * "TFA_WIND" is TFA
# * "WDS500" is UPM WDS500u
# * "WS2300_WIND" is WS2300
# * "WS4500_WIND" is Alecto WS4500, Auriol H13726, Hama EWS1500, Meteoscan W155/W160, Ventus WS155
#
# UV Sensors:
# "UVN128" is Oregon UVN128, UV138
# "UVN800" is Oregon UVN800
# "TFA_UV" is TFA_UV-Sensor
# * "UVN128" is Oregon UVN128, UV138
# * "UVN800" is Oregon UVN800
# * "TFA_UV" is TFA_UV-Sensor
#
# Date/Time Sensors:
# * "RTGR328_DATE" is RTGR328N
@ -72,6 +79,9 @@
# * "BWR101" is Oregon Scientific BWR101
# * "GR101" is Oregon Scientific GR101
#
# BBQ-Sensors (two temperature values):
# * "ET732" is Maverick ET-732
#
# Copyright (C) 2012/2013 Willi Herzig
#
# This script is distributed in the hope that it will be useful,
@ -116,7 +126,7 @@ TRX_WEATHER_Initialize($)
{
my ($hash) = @_;
$hash->{Match} = "^..(50|51|52|54|55|56|57|58|5a|5c|5d).*";
$hash->{Match} = "^..(4e|50|51|52|54|55|56|57|58|5a|5c|5d).*";
$hash->{DefFn} = "TRX_WEATHER_Define";
$hash->{UndefFn} = "TRX_WEATHER_Undef";
$hash->{ParseFn} = "TRX_WEATHER_Parse";
@ -171,6 +181,8 @@ TRX_WEATHER_Undef($$)
my %types =
(
# BBQ
0x4e0a => { part => 'BBQ', method => \&TRX_WEATHER_common_bbq, },
# TEMP
0x5008 => { part => 'TEMP', method => \&TRX_WEATHER_common_temp, },
# HYDRO
@ -227,6 +239,34 @@ sub TRX_WEATHER_temperature {
}
sub TRX_WEATHER_temperature_food {
my ($bytes, $dev, $res, $off) = @_;
my $temp = $bytes->[$off]*256 + $bytes->[$off+1];
push @$res, {
device => $dev,
type => 'temp-food',
current => $temp,
units => 'Grad Celsius'
}
}
sub TRX_WEATHER_temperature_bbq {
my ($bytes, $dev, $res, $off) = @_;
my $temp = $bytes->[$off]*256 + $bytes->[$off+1];
push @$res, {
device => $dev,
type => 'temp-bbq',
current => $temp,
units => 'Grad Celsius'
}
}
sub TRX_WEATHER_chill_temperature {
my ($bytes, $dev, $res, $off) = @_;
@ -357,7 +397,8 @@ sub TRX_WEATHER_use_longid {
# ------------------------------------------------------------
#
# T R X _ W E A T H E R _ c o m m o n _ a n e m o m e t e r
# 0x5610 => { part => 'WIND'
sub TRX_WEATHER_common_anemometer {
my $type = shift;
my $longids = shift;
@ -374,6 +415,7 @@ sub TRX_WEATHER_common_anemometer {
0x04 => "TFA_WIND",
0x05 => "WDS500", # UPM WDS500
0x06 => "WS2300_WIND", # WS2300
0x07 => "WS4500_WIND", # Alecto WS4500, Auriol H13726, Hama EWS1500, Meteoscan W155/W160, Ventus WS155
);
if (exists $devname{$bytes->[1]}) {
@ -431,7 +473,57 @@ sub TRX_WEATHER_common_anemometer {
}
# -----------------------------
# --------------------------------------------------------------------
# T R X _ W E A T H E R _ c o m m o n _ b b q
# 0x4e0a => { part => 'BBQ'
#
sub TRX_WEATHER_common_bbq {
my $type = shift;
my $longids = shift;
my $bytes = shift;
my $subtype = sprintf "%02x", $bytes->[1];
my $dev_type;
my %devname =
( # HEXSTRING => "NAME"
0x01 => "ET732",
);
if (exists $devname{$bytes->[1]}) {
$dev_type = $devname{$bytes->[1]};
} else {
Log3 undef, 3, "TRX_WEATHER: common_bbq error undefined subtype=$subtype";
my @res = ();
return @res;
}
#my $seqnbr = sprintf "%02x", $bytes->[2];
my $dev_str = $dev_type;
if (TRX_WEATHER_use_longid($longids,$dev_type)) {
$dev_str .= $DOT.sprintf("%02x", $bytes->[3]);
$dev_str .= $DOT.sprintf("%02x", $bytes->[4]);
}
my @res = ();
# hexline debugging
if ($TRX_HEX_debug) {
my $hexline = ""; for (my $i=0;$i<@$bytes;$i++) { $hexline .= sprintf("%02x",$bytes->[$i]);}
push @res, { device => $dev_str, type => 'hexline', current => $hexline, units => 'hex', };
}
TRX_WEATHER_temperature_food($bytes, $dev_str, \@res, 5);
TRX_WEATHER_temperature_bbq($bytes, $dev_str, \@res, 7);
TRX_WEATHER_simple_battery($bytes, $dev_str, \@res, 9);
return @res;
}
# --------------------------------------------------------------------
# T R X _ W E A T H E R _ c o m m o n _ t e m p
# 0x5008 => { part => 'TEMP'
sub TRX_WEATHER_common_temp {
my $type = shift;
my $longids = shift;
@ -452,14 +544,7 @@ sub TRX_WEATHER_common_temp {
0x08 => "WS2300", # La Crosse WS2300
0x09 => "RUBICSON", # RUBiCSON
0x0a => "TFA_303133", # TFA 30.3133
0x0b => "RES_TEMP1", # Reserved for future use
0x0c => "RES_TEMP2", # Reserved for future use
0x0d => "RES_TEMP3", # Reserved for future use
0x0e => "RES_TEMP4", # Reserved for future use
0x0f => "RES_TEMP5", # Reserved for future use
0x10 => "RES_TEMP6", # Reserved for future use
0x11 => "RES_TEMP7", # Reserved for future use
0x12 => "RES_TEMP8", # Reserved for future use
0x0b => "WT0122", # WT0122
);
if (exists $devname{$bytes->[1]}) {
@ -493,7 +578,9 @@ sub TRX_WEATHER_common_temp {
return @res;
}
# -----------------------------
# --------------------------------------------------------------------
# T R X _ W E A T H E R _ c o m m o n _ h y d r o
# 0x5108 => { part => 'HYDRO'
sub TRX_WEATHER_common_hydro {
my $type = shift;
my $longids = shift;
@ -506,6 +593,7 @@ sub TRX_WEATHER_common_hydro {
( # HEXSTRING => "NAME"
0x01 => "TX3", # LaCrosse TX3
0x02 => "WS2300", # LaCrosse WS2300 Humidity
0x03 => "S80", # Inovalley S80 plant humidity sensor
);
if (exists $devname{$bytes->[1]}) {
@ -537,7 +625,9 @@ sub TRX_WEATHER_common_hydro {
return @res;
}
# -----------------------------
# --------------------------------------------------------------------
# T R X _ W E A T H E R _ c o m m o n _ t e m p h y d r o
# 0x520a => { part => 'TEMPHYDRO'
sub TRX_WEATHER_common_temphydro {
my $type = shift;
my $longids = shift;
@ -559,14 +649,9 @@ sub TRX_WEATHER_common_temphydro {
0x09 => "VIKING_02038", # Viking 02035,02038 (02035 has no humidity)
0x0a => "RUBICSON", # Rubicson
0x0b => "EW109", # EW109
0x0c => "RES_TEMPHUM1", # Reserved for future use
0x0d => "RES_TEMPHUM2", # Reserved for future use
0x0e => "RES_TEMPHUM3", # Reserved for future use
0x0f => "RES_TEMPHUM4", # Reserved for future use
0x10 => "RES_TEMPHUM5", # Reserved for future use
0x11 => "RES_TEMPHUM6", # Reserved for future use
0x12 => "RES_TEMPHUM7", # Reserved for future use
0x13 => "RES_TEMPHUM8", # Reserved for future use
0x0c => "XT300", # Imagintronix/Opus XT300 Soil sensor
0x0d => "WS1700", # Alecto WS1700 and compatibles
0x0e => "WS3500", # Alecto WS3500, WS4500, Auriol H13726, Hama EWS1500, Meteoscan W155/W160, Ventus WS155
);
if (exists $devname{$bytes->[1]}) {
@ -624,7 +709,9 @@ sub TRX_WEATHER_common_temphydro {
return @res;
}
# -----------------------------
# --------------------------------------------------------------------
# T R X _ W E A T H E R _ c o m m o n _ t e m p h y d r o b a r o
# 0x540d => { part => 'TEMPHYDROBARO'
sub TRX_WEATHER_common_temphydrobaro {
my $type = shift;
my $longids = shift;
@ -670,7 +757,9 @@ sub TRX_WEATHER_common_temphydrobaro {
return @res;
}
# -----------------------------
# --------------------------------------------------------------------
# T R X _ W E A T H E R _ c o m m o n _ r a i n
# 0x550b => { part => 'RAIN'
sub TRX_WEATHER_common_rain {
my $type = shift;
my $longids = shift;
@ -688,7 +777,7 @@ sub TRX_WEATHER_common_rain {
0x04 => "RG700",
0x05 => "WS2300_RAIN", # WS2300
0x06 => "TX5_RAIN", # La Crosse TX5
0x07 => "WS4500_RAIN", # Alecto WS4500, Auriol H13726, Hama EWS1500, Meteoscan W155/W160,
);
if (exists $devname{$bytes->[1]}) {
@ -759,7 +848,9 @@ sub TRX_WEATHER_uv_string {
$uv_str[$_[0]] || 'dangerous';
}
# -----------------------------
# ------------------------------------------------------------
# T R X _ W E A T H E R _ c o m m o n _ u v
# * 0x5709 => { part => 'UV'
sub TRX_WEATHER_common_uv {
my $type = shift;
my $longids = shift;
@ -821,7 +912,8 @@ sub TRX_WEATHER_common_uv {
}
# ------------------------------------------------------------
#
# T R X _ W E A T H E R _ c o m m o n _ d a t e t i m e
# 0x580D => { part => 'DATE', method => \&TRX_WEATHER_common_datetime, },
sub TRX_WEATHER_common_datetime {
my $type = shift;
my $longids = shift;
@ -1314,6 +1406,20 @@ TRX_WEATHER_Parse($$)
$sensor = "temperature";
readingsBulkUpdate($def, $sensor, $i->{current});
}
elsif ($i->{type} eq "temp-bbq") {
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name Temperature-bbq ".$i->{current}." ".$i->{units};
$val .= "TB: ".$i->{current}." ";
$sensor = "temp-bbq";
readingsBulkUpdate($def, $sensor, $i->{current});
}
elsif ($i->{type} eq "temp-food") {
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name Temperatur-food ".$i->{current}." ".$i->{units};
$val .= "TF: ".$i->{current}." ";
$sensor = "temp-food";
readingsBulkUpdate($def, $sensor, $i->{current});
}
elsif ($i->{type} eq "chilltemp") {
Log3 $name, 5, "TRX_WEATHER: name=$name device=$device_name windchill ".$i->{current}." ".$i->{units};
$val .= "CT: ".$i->{current}." ";