From e687ba7e782963da28dd602c90965fd78fbdcafe Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Thu, 13 Jan 2011 18:25:35 +0000 Subject: [PATCH] threeStateSensor added (by Oskar) git-svn-id: https://svn.fhem.de/fhem/trunk@800 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_CUL_HM.pm | 24 +++++++++++++++++++++--- fhem/docs/commandref.html | 2 +- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index fc1542ff0..106c25bd9 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -126,8 +126,8 @@ CUL_HM_Initialize($) $hash->{AttrList} = "IODev do_not_notify:1,0 ignore:0,1 " . "showtime:1,0 loglevel:0,1,2,3,4,5,6 model " . "subType:switch,dimmer,blindActuator,remote,sensor,". - "swi,pushButton,threeStateSensor,motionDetector,". - "keyMatic,winMatic,smokeDetector " . + "swi,pushButton,threeStateSensor,motionDetector,". + "keyMatic,winMatic,smokeDetector " . "hmClass:receiver,sender serialNr firmware"; } @@ -266,6 +266,24 @@ CUL_HM_Parse($$) } + } elsif($st eq "threeStateSensor") { ##################################### + + if($p =~ m/^....C8/) { + push @event, "state:open"; + if($id eq $dst) { + CUL_HM_SendCmd($shash, "++8002".$id.$src."0101". # Send Ack. + "C8"."0028", 1, 0); + } + + } elsif($p =~ m/^....00/) { + push @event, "state:closed"; + if($id eq $dst) { + CUL_HM_SendCmd($shash, "++8002".$id.$src."0101". # Send Ack. + "00"."0028", 1, 0); + } + + push @event, "unknownMsg:$p" if(!@event); + } elsif($st eq "THSensor") { ########################################## if($p =~ m/^(....)(..)$/) { @@ -510,7 +528,7 @@ CUL_HM_Pair(@) $attr{$name}{subType} = $dp ? $dp->{st} : "unknown"; $attr{$name}{hmClass} = $dp ? $dp->{cl} : "unknown"; $attr{$name}{serialNr} = pack('H*', substr($p, 6, 20)); - $attr{$name}{firmware} = substr($p, 0, 2)/10; + $attr{$name}{firmware} = sprintf("%0.1f", substr($p, 0, 2)/10); my $isSender = (AttrVal($name,"hmClass","") eq "sender"); my $stn = $attr{$name}{subType}; # subTypeName diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html index eaa5f72c9..f27e97da6 100644 --- a/fhem/docs/commandref.html +++ b/fhem/docs/commandref.html @@ -2178,7 +2178,7 @@ A line ending with \ will be concatenated with the next one, so long lines is a separate firmware with HomeMatic support which lacks FHT support.