2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 19:36:02 +00:00

CUL_HM:bright sensor

git-svn-id: https://svn.fhem.de/fhem/trunk@11471 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2016-05-16 18:33:20 +00:00
parent 71d4679d77
commit 4fd5d7becb

View File

@ -2133,19 +2133,19 @@ sub CUL_HM_Parse($$) {#########################################################
elsif($mh{st} eq "senBright") { ############################################# elsif($mh{st} eq "senBright") { #############################################
if ($mh{mTp} =~ m/5[34]/){ if ($mh{mTp} =~ m/5[34]/){
#Channel ist fixed 1 #Channel is fixed 1
my ($chn,undef,$dat) = unpack 'A2A2A8',$mh{p}; my ($chn,$unkn,$dat) = unpack 'A2A2A8',$mh{p};# chn = 01
push @evtEt,[$mh{devH},1,"battery:".(hex($chn)&0x80?"low":"ok")]; push @evtEt,[$mh{devH},1,"battery:".(hex($chn)&0x80?"low":"ok")];
$dat = sprintf("%0.1f",hex($dat)*100);
my $chnHash = $modules{CUL_HM}{defptr}{$mh{src}."01"};#fixed channel $dat = sprintf("%0.2f",hex($dat))/100; #down to 0.01lux per docu
if ($chnHash){
push @evtEt,[$chnHash,1,"state:bright: $dat"]; # verify whether we have a channel or will use the Device instead
push @evtEt,[$chnHash,1,"bright:$dat"]; my $cHash = ($modules{CUL_HM}{defptr}{$mh{src}."01"})
} ?$modules{CUL_HM}{defptr}{$mh{src}."01"}
else{ :$mh{devH};
push @evtEt,[$mh{devH},1,"Chan_01:brigth: $dat"]; push @evtEt,[$cHash,1,"state:B: $dat"];
} push @evtEt,[$cHash,1,"brightness:$dat"];
push @evtEt,[$cHash,1,"unknown: 0x".$unkn]; # read 0xC1, but what is it?
} }
} }
elsif($mh{st} eq "powerSensor") {############################################ elsif($mh{st} eq "powerSensor") {############################################