2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

Small fixes + HMS added to the CUL

git-svn-id: https://svn.fhem.de/fhem/trunk@402 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2009-06-26 12:43:52 +00:00
parent cdfc267c3d
commit 4b44680ecf
6 changed files with 45 additions and 22 deletions

View File

@ -505,4 +505,6 @@
- feature: Google Weather API support for FHEM (Boris 2009-06-01) - feature: Google Weather API support for FHEM (Boris 2009-06-01)
- feature: lazy attribute for FHT devices (Boris 2009-06-09) - feature: lazy attribute for FHT devices (Boris 2009-06-09)
- feature: tmpcorr attribute for FHT devices - feature: tmpcorr attribute for FHT devices
- feature: CUL_EM generates an event for each of the READINGS
- feature: USF1000S support for FHEM added (Boris 2009-06-20) - feature: USF1000S support for FHEM added (Boris 2009-06-20)
- feature: CUL supports HMS (culfw >= 1.22 needed)

View File

@ -48,14 +48,15 @@ CUL_Initialize($)
# Provider # Provider
$hash->{ReadFn} = "CUL_Read"; $hash->{ReadFn} = "CUL_Read";
$hash->{WriteFn} = "CUL_Write"; $hash->{WriteFn} = "CUL_Write";
$hash->{Clients} = ":FS20:FHT:KS300:CUL_EM:CUL_WS:USF1000:"; $hash->{Clients} = ":FS20:FHT:KS300:CUL_EM:CUL_WS:USF1000:HMS:";
my %mc = ( my %mc = (
"1:USF1000" => "^81..(04|0c)..0101a001a5ceaa00....", "1:USF1000" => "^81..(04|0c)..0101a001a5ceaa00....",
"2:FS20" => "^81..(04|0c)..0101a001", "2:FS20" => "^81..(04|0c)..0101a001",
"3:FHT" => "^81..(04|09|0d)..(0909a001|83098301|c409c401)..", "3:FHT" => "^81..(04|09|0d)..(0909a001|83098301|c409c401)..",
"4:KS300" => "^810d04..4027a001", "4:KS300" => "^810d04..4027a001",
"5:CUL_WS" => "^K.....", "5:CUL_WS" => "^K.....",
"6:CUL_EM" => "^E0.................\$" "6:CUL_EM" => "^E0.................\$",
"7:HMS" => "^810e04....(1|5|9).a001",
); );
$hash->{MatchList} = \%mc; $hash->{MatchList} = \%mc;
$hash->{ReadyFn} = "CUL_Ready"; $hash->{ReadyFn} = "CUL_Ready";
@ -696,7 +697,8 @@ CUL_Read($)
} }
my $rssi; my $rssi;
if($initstr =~ m/X2/ && $dmsg =~ m/[FEHTK]([A-F0-9][A-F0-9])+$/) { # RSSI my $rmsg = $dmsg;
if($initstr =~ m/X2/ && $dmsg =~ m/[FTKEHR]([A-F0-9][A-F0-9])+$/) { # RSSI
my $l = length($dmsg); my $l = length($dmsg);
$rssi = hex(substr($dmsg, $l-2, 2)); $rssi = hex(substr($dmsg, $l-2, 2));
$dmsg = substr($dmsg, 0, $l-2); $dmsg = substr($dmsg, 0, $l-2);
@ -723,13 +725,19 @@ CUL_Read($)
} }
$dmsg = sprintf("81%02x04xx0101a001%s00%s", $dmsg = sprintf("81%02x04xx0101a001%s00%s",
$len/2+5, substr($dmsg,1,6), substr($dmsg,7)); $len/2+7, substr($dmsg,1,6), substr($dmsg,7));
$dmsg = lc($dmsg); $dmsg = lc($dmsg);
} elsif($fn eq "T" && $len >= 11) { # Reformat for 11_FHT.pm } elsif($fn eq "T" && $len >= 11) { # Reformat for 11_FHT.pm
$dmsg = sprintf("81%02x04xx0909a001%s00%s", $dmsg = sprintf("81%02x04xx0909a001%s00%s",
$len/2+5, substr($dmsg,1,6), substr($dmsg,7)); $len/2+7, substr($dmsg,1,6), substr($dmsg,7));
$dmsg = lc($dmsg);
} elsif($fn eq "H" && $len >= 13) { # Reformat for 12_HMS.pm
$dmsg = sprintf("81%02x04xxxx5%sa001%s0000%s",
$len/2+8, substr($dmsg,6,1), substr($dmsg,1,4), substr($dmsg,5));
$dmsg = lc($dmsg); $dmsg = lc($dmsg);
} elsif($fn eq "K" && $len >= 5) { } elsif($fn eq "K" && $len >= 5) {
@ -749,12 +757,15 @@ CUL_Read($)
Log GetLogLevel($name,2), "CUL: unknown message $dmsg"; Log GetLogLevel($name,2), "CUL: unknown message $dmsg";
goto NEXTMSG; goto NEXTMSG;
} }
$hash->{RSSI} = $rssi; $hash->{RSSI} = $rssi;
$hash->{RAWMSG} = $rmsg;
my $foundp = Dispatch($hash, $dmsg); my $foundp = Dispatch($hash, $dmsg);
if($foundp && $rssi) { if($foundp) {
foreach my $d (@{$foundp}) { foreach my $d (@{$foundp}) {
next if(!$defs{$d}); next if(!$defs{$d});
$defs{$d}{RSSI} = $rssi; $defs{$d}{RSSI} = $rssi if($rssi);
$defs{$d}{RAWMSG} = $rmsg;
} }
} }

View File

@ -59,11 +59,11 @@ FHZ_Initialize($)
$hash->{WriteFn} = "FHZ_Write"; $hash->{WriteFn} = "FHZ_Write";
$hash->{Clients} = ":FHZ:FS20:FHT:HMS:KS300:USF1000:"; $hash->{Clients} = ":FHZ:FS20:FHT:HMS:KS300:USF1000:";
my %mc = ( my %mc = (
"0:USF1000" => "^810c04..0101a001a5ceaa00...." "1:USF1000" => "^810c04..0101a001a5ceaa00....",
"1:FS20" => "^81..(04|0c)..0101a001", "2:FS20" => "^81..(04|0c)..0101a001",
"2:FHT" => "^81..(04|09|0d)..(0909a001|83098301|c409c401)..", "3:FHT" => "^81..(04|09|0d)..(0909a001|83098301|c409c401)..",
"3:HMS" => "^810e04....(1|5|9).a001", "4:HMS" => "^810e04....(1|5|9).a001",
"4:KS300" => "^810d04..4027a001", "5:KS300" => "^810d04..4027a001",
); );
$hash->{MatchList} = \%mc; $hash->{MatchList} = \%mc;
$hash->{ReadyFn} = "FHZ_Ready"; $hash->{ReadyFn} = "FHZ_Ready";
@ -673,7 +673,16 @@ FHZ_Read($)
$fhzdata = substr($fhzdata, 2); $fhzdata = substr($fhzdata, 2);
next; next;
} }
Dispatch($hash, $dmsg);
$hash->{RAWMSG} = $dmsg;
my $foundp = Dispatch($hash, $dmsg);
if($foundp) {
foreach my $d (@{$foundp}) {
next if(!$defs{$d});
$defs{$d}{RAWMSG} = $dmsg;
}
}
$fhzdata = substr($fhzdata, $len); $fhzdata = substr($fhzdata, $len);
} else { } else {

View File

@ -66,7 +66,8 @@ sub
HMS_Undef($$) HMS_Undef($$)
{ {
my ($hash, $name) = @_; my ($hash, $name) = @_;
delete($defptr{$hash->{CODE}}); delete($defptr{$hash->{CODE}})
if(defined($hash->{CODE}) && defined($defptr{$hash->{CODE}}));
return undef; return undef;
} }
@ -216,7 +217,7 @@ HMS_Parse($$)
} else { } else {
Log 4, "HMS Device $dev (Unknown type: $type)"; Log 3, "HMS Device $dev (Unknown type: $type)";
return ""; return "";
} }

View File

@ -1540,7 +1540,8 @@ A line ending with \ will be concatenated with the next one, so long lines
The CUL is an USB device sold by <a href="http://www.busware.de">busware.de The CUL is an USB device sold by <a href="http://www.busware.de">busware.de
</a>. With the opensource firmware (see this <a </a>. With the opensource firmware (see this <a
href="http://groups.google.com/group/cul-fans">google discussion</a>) it is href="http://groups.google.com/group/cul-fans">google discussion</a>) it is
capable to receive/send different 868MHz protocols, e.g. FS20/FHT/S300/EM.<br> capable to receive and send different 868MHz protocols
(FS20/FHT/S300/EM/HMS).<br>
<br> <br>
Some protocols (FS20/FHT) are converted by this module so that the same Some protocols (FS20/FHT) are converted by this module so that the same
logical device can be used, irrespective if the radio telegram is received by logical device can be used, irrespective if the radio telegram is received by

View File

@ -56,7 +56,7 @@ Currently implemented features:<br>
<ul> <ul>
<li>FS20 (Receive/Send, all devices) <li>FS20 (Receive/Send, all devices)
<li>EM (EM1000EM/EM1000GZ/EM1000WZ) <li>EM (EM1000EM/EM1000GZ/EM1000WZ)
<li>FHT (Only snoop functionality, no send!) <li>FHT (Receive/Send)
<li>S300 (KS300, S300TH, S555TH, etc) <li>S300 (KS300, S300TH, S555TH, etc)
/ul> /ul>
</li> </li>
@ -104,11 +104,10 @@ commandref.html</a> and <a href="faq.html">faq.html</a> for more documentation,
<a href="http://sourceforge.net/projects/linviex"> <a href="http://sourceforge.net/projects/linviex">
http://sourceforge.net/projects/linviex</a><br> http://sourceforge.net/projects/linviex</a><br>
Protocol descriptions and other useful stuff: <a href="http://fhz4linux.info/">http://fhz4linux.info/</a><br> Protocol descriptions and other useful stuff: <a href="http://fhz4linux.info/">http://fhz4linux.info/</a><br>
busware.de: <a href=http://shop.busware.de/product_info.php?products_id=29"> CUL: <a href=http://shop.busware.de/product_info.php?products_id=29">
CUL</a>, <a href="http://groups.google.com/group/cul-fans"> Hardware shop</a>, <a href="http://www.koeniglich.de/culfw/culfw.html">
CUL fans google group</a><br> firmware homepage</a>, <a href="http://groups.google.com/group/cul-fans">
CUL fans google group</a><br>
<br> <br>
Device/OS Specific installation guides:<br> Device/OS Specific installation guides:<br>