2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 13:26: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") { #############################################
if ($mh{mTp} =~ m/5[34]/){
#Channel ist fixed 1
my ($chn,undef,$dat) = unpack 'A2A2A8',$mh{p};
#Channel is fixed 1
my ($chn,$unkn,$dat) = unpack 'A2A2A8',$mh{p};# chn = 01
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
if ($chnHash){
push @evtEt,[$chnHash,1,"state:bright: $dat"];
push @evtEt,[$chnHash,1,"bright:$dat"];
}
else{
push @evtEt,[$mh{devH},1,"Chan_01:brigth: $dat"];
}
$dat = sprintf("%0.2f",hex($dat))/100; #down to 0.01lux per docu
# verify whether we have a channel or will use the Device instead
my $cHash = ($modules{CUL_HM}{defptr}{$mh{src}."01"})
?$modules{CUL_HM}{defptr}{$mh{src}."01"}
:$mh{devH};
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") {############################################