mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-30 12:07:09 +00:00
change channel commands, no device commands allowed
git-svn-id: https://svn.fhem.de/fhem/trunk@2808 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a4022c2542
commit
3112fe928a
@ -757,15 +757,14 @@ sub CUL_HM_Parse($$) {#############################
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif($st eq "KFM100" && $model eq "KFM-Sensor") { ##########################
|
elsif($st eq "KFM100" && $model eq "KFM-Sensor") { ##########################
|
||||||
if($p =~ m/.14(.)0200(..)(..)(..)/) {# todo very risky - no start...
|
if ($msgType eq "53"){
|
||||||
my ($k_cnt, $k_v1, $k_v2, $k_v3) = ($1,$2,$3,$4);
|
if($p =~ m/.14(.)0200(..)(..)(..)/) {
|
||||||
my $v = 128-hex($k_v2); # FIXME: calibrate
|
my ($seq, $k_v1, $k_v2, $k_v3) = (hex($1),$2,hex($$3),hex($4));
|
||||||
# $v = 256+$v if($v < 0);
|
my $v = 128-$k_v2; # FIXME: calibrate
|
||||||
$v += 256 if(!($k_v3 & 1));
|
$v += 256 if(!($k_v3 & 1));
|
||||||
push @event, "rawValue:$v";
|
push @event, "rawValue:$v";
|
||||||
|
my $nextSeq = (ReadingsVal($name,"Sequence","") %15)+1;
|
||||||
my $seq = hex($k_cnt);
|
push @event, "Sequence:$seq".($nextSeq ne $seq?"_seqMiss":"");
|
||||||
push @event, "Sequence:$seq";
|
|
||||||
|
|
||||||
my $r2r = AttrVal($name, "rawToReadable", undef);
|
my $r2r = AttrVal($name, "rawToReadable", undef);
|
||||||
if($r2r) {
|
if($r2r) {
|
||||||
@ -775,7 +774,6 @@ sub CUL_HM_Parse($$) {#############################
|
|||||||
my $f = (($v-$r2r[$idx])/($r2r[$idx+2]-$r2r[$idx]));
|
my $f = (($v-$r2r[$idx])/($r2r[$idx+2]-$r2r[$idx]));
|
||||||
my $cv = ($r2r[$idx+3]-$r2r[$idx+1])*$f + $r2r[$idx+1];
|
my $cv = ($r2r[$idx+3]-$r2r[$idx+1])*$f + $r2r[$idx+1];
|
||||||
my $unit = AttrVal($name, "unit", "");
|
my $unit = AttrVal($name, "unit", "");
|
||||||
$unit = " $unit" if($unit);
|
|
||||||
push @event, sprintf("state:%.1f %s",$cv,$unit);
|
push @event, sprintf("state:%.1f %s",$cv,$unit);
|
||||||
push @event, sprintf("content:%.1f %s",$cv,$unit);
|
push @event, sprintf("content:%.1f %s",$cv,$unit);
|
||||||
last;
|
last;
|
||||||
@ -786,6 +784,7 @@ sub CUL_HM_Parse($$) {#############################
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
elsif($st eq "switch" || ####################################################
|
elsif($st eq "switch" || ####################################################
|
||||||
$st eq "dimmer" ||
|
$st eq "dimmer" ||
|
||||||
$st eq "blindActuator") {
|
$st eq "blindActuator") {
|
||||||
@ -1376,7 +1375,7 @@ my %culHmRegDefine = (
|
|||||||
intKeyVisib =>{a=> 2.7,s=>0.1,l=>0,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>'visibility of internal channel',lit=>{invisib=>0,visib=>1}},
|
intKeyVisib =>{a=> 2.7,s=>0.1,l=>0,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>'visibility of internal channel',lit=>{invisib=>0,visib=>1}},
|
||||||
pairCentral =>{a=> 10.0,s=>3.0,l=>0,min=>0 ,max=>16777215,c=>'hex' ,f=>'' ,u=>'' ,d=>1,t=>'pairing to central'},
|
pairCentral =>{a=> 10.0,s=>3.0,l=>0,min=>0 ,max=>16777215,c=>'hex' ,f=>'' ,u=>'' ,d=>1,t=>'pairing to central'},
|
||||||
#blindActuator mainly
|
#blindActuator mainly
|
||||||
lgMultiExec =>{a=> 10.5,s=>0.1,l=>3,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>"multiple execution per repeat of long trigger" ,lit=>{off=>0,on=>1}},
|
lgMultiExec =>{a=>138.5,s=>0.1,l=>3,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>1,t=>"multiple execution per repeat of long trigger" ,lit=>{off=>0,on=>1}},
|
||||||
driveDown =>{a=> 11.0,s=>2.0,l=>1,min=>0 ,max=>6000.0 ,c=>'factor' ,f=>10 ,u=>'s' ,d=>1,t=>"drive time up"},
|
driveDown =>{a=> 11.0,s=>2.0,l=>1,min=>0 ,max=>6000.0 ,c=>'factor' ,f=>10 ,u=>'s' ,d=>1,t=>"drive time up"},
|
||||||
driveUp =>{a=> 13.0,s=>2.0,l=>1,min=>0 ,max=>6000.0 ,c=>'factor' ,f=>10 ,u=>'s' ,d=>1,t=>"drive time up"},
|
driveUp =>{a=> 13.0,s=>2.0,l=>1,min=>0 ,max=>6000.0 ,c=>'factor' ,f=>10 ,u=>'s' ,d=>1,t=>"drive time up"},
|
||||||
driveTurn =>{a=> 15.0,s=>1.0,l=>1,min=>0 ,max=>6000.0 ,c=>'factor' ,f=>10 ,u=>'s' ,d=>1,t=>"fliptime up <=>down"},
|
driveTurn =>{a=> 15.0,s=>1.0,l=>1,min=>0 ,max=>6000.0 ,c=>'factor' ,f=>10 ,u=>'s' ,d=>1,t=>"fliptime up <=>down"},
|
||||||
@ -1619,9 +1618,14 @@ my %culHmRegModel = (
|
|||||||
lowBatLimit =>1,batDefectLimit =>1,
|
lowBatLimit =>1,batDefectLimit =>1,
|
||||||
transmitTryMax =>1,},
|
transmitTryMax =>1,},
|
||||||
"HM-Sys-sRP-Pl" =>{compMode =>1,},
|
"HM-Sys-sRP-Pl" =>{compMode =>1,},
|
||||||
|
"KFM-Display" =>{CtDlyOn =>1,CtDlyOff =>1,
|
||||||
|
CtOn =>1,CtOff =>1,CtRampOn =>1,CtRampOff =>1,
|
||||||
|
CtValLo =>1,CtValHi =>1,
|
||||||
|
ActionType =>1,OffTimeMode =>1,OnTimeMode =>1,
|
||||||
|
DimJtOn =>1,DimJtOff =>1,DimJtDlyOn =>1,DimJtDlyOff =>1,
|
||||||
|
DimJtRampOn =>1,DimJtRampOff =>1,
|
||||||
|
lgMultiExec =>1,
|
||||||
|
},
|
||||||
"HM-Sen-Wa-Od" =>{cyclicInfoMsg =>1, transmDevTryMax =>1,
|
"HM-Sen-Wa-Od" =>{cyclicInfoMsg =>1, transmDevTryMax =>1,
|
||||||
localResDis =>1,ledOnTime =>1,transmitTryMax =>1,
|
localResDis =>1,ledOnTime =>1,transmitTryMax =>1,
|
||||||
waterUppThr =>1,waterlowThr =>1,caseDesign =>1,caseHigh =>1,
|
waterUppThr =>1,waterlowThr =>1,caseDesign =>1,caseHigh =>1,
|
||||||
@ -2025,23 +2029,25 @@ sub CUL_HM_Get($@) {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
###################################
|
###################################
|
||||||
my %culHmGlobalSets = (
|
my %culHmGlobalSetsDevice = (# general commands for devices only
|
||||||
raw => "data ...",
|
raw => "data ...",
|
||||||
reset => "",
|
reset => "",
|
||||||
pair => "",
|
pair => "",
|
||||||
unpair => "",
|
unpair => "",
|
||||||
|
getpair => "",
|
||||||
|
virtual =>"<noButtons>",
|
||||||
|
actiondetect =>"outdated",#todo Updt3 remove
|
||||||
|
);
|
||||||
|
my %culHmGlobalSets = (
|
||||||
sign => "[on|off]",
|
sign => "[on|off]",
|
||||||
regRaw => "[List0|List1|List2|List3|List4|List5|List6] <addr> <data> ... <PeerChannel>", #todo Updt2 remove
|
regRaw => "[List0|List1|List2|List3|List4|List5|List6] <addr> <data> ... <PeerChannel>", #todo Updt2 remove
|
||||||
regBulk => "<list>:<peer> <addr1:data1> <addr2:data2> ...",
|
regBulk => "<list>:<peer> <addr1:data1> <addr2:data2> ...",
|
||||||
peerBulk => "<peer1,peer2,...>",
|
peerBulk => "<peer1,peer2,...>",
|
||||||
statusRequest => "",
|
statusRequest => "",
|
||||||
getpair => "",
|
|
||||||
getdevicepair => "",
|
getdevicepair => "",
|
||||||
getRegRaw =>"[List0|List1|List2|List3|List4|List5|List6] ... <PeerChannel>",
|
getRegRaw =>"[List0|List1|List2|List3|List4|List5|List6] ... <PeerChannel>",
|
||||||
getConfig => "",
|
getConfig => "",
|
||||||
regSet =>"<regName> <value> ... <peerChannel>",
|
regSet =>"<regName> <value> ... <peerChannel>",
|
||||||
virtual =>"<noButtons>",
|
|
||||||
actiondetect =>"outdated",#todo Updt3 remove
|
|
||||||
clear =>"[readings|msgEvents]",
|
clear =>"[readings|msgEvents]",
|
||||||
);
|
);
|
||||||
my %culHmSubTypeSets = (
|
my %culHmSubTypeSets = (
|
||||||
@ -2205,6 +2211,7 @@ sub CUL_HM_Set($@) {
|
|||||||
|
|
||||||
my $mdCh = $md.($isChannel?$chn:"00"); # chan specific commands?
|
my $mdCh = $md.($isChannel?$chn:"00"); # chan specific commands?
|
||||||
my $h = $culHmGlobalSets{$cmd} if($st ne "virtual");
|
my $h = $culHmGlobalSets{$cmd} if($st ne "virtual");
|
||||||
|
$h = $culHmGlobalSetsDevice{$cmd} if(!defined($h) && $st ne "virtual" && !$isChannel);
|
||||||
$h = $culHmSubTypeSets{$st}{$cmd} if(!defined($h) && $culHmSubTypeSets{$st});
|
$h = $culHmSubTypeSets{$st}{$cmd} if(!defined($h) && $culHmSubTypeSets{$st});
|
||||||
$h = $culHmModelSets{$md}{$cmd} if(!defined($h) && $culHmModelSets{$md} );
|
$h = $culHmModelSets{$md}{$cmd} if(!defined($h) && $culHmModelSets{$md} );
|
||||||
$h = $culHmChanSets{$mdCh}{$cmd} if(!defined($h) && $culHmChanSets{$mdCh} );
|
$h = $culHmChanSets{$mdCh}{$cmd} if(!defined($h) && $culHmChanSets{$mdCh} );
|
||||||
@ -2218,6 +2225,7 @@ sub CUL_HM_Set($@) {
|
|||||||
elsif(!defined($h)) {
|
elsif(!defined($h)) {
|
||||||
my @arr;
|
my @arr;
|
||||||
@arr = keys %culHmGlobalSets if($st ne "virtual");
|
@arr = keys %culHmGlobalSets if($st ne "virtual");
|
||||||
|
push @arr, keys %culHmGlobalSetsDevice if($st ne "virtual" && !$isChannel);
|
||||||
push @arr, keys %{$culHmSubTypeSets{$st}} if($culHmSubTypeSets{$st});
|
push @arr, keys %{$culHmSubTypeSets{$st}} if($culHmSubTypeSets{$st});
|
||||||
push @arr, keys %{$culHmModelSets{$md}} if($culHmModelSets{$md});
|
push @arr, keys %{$culHmModelSets{$md}} if($culHmModelSets{$md});
|
||||||
push @arr, keys %{$culHmChanSets{$mdCh}} if($culHmChanSets{$mdCh});
|
push @arr, keys %{$culHmChanSets{$mdCh}} if($culHmChanSets{$mdCh});
|
||||||
@ -2244,6 +2252,9 @@ sub CUL_HM_Set($@) {
|
|||||||
return "$cmd requires parameter: $h";
|
return "$cmd requires parameter: $h";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if chn cmd is executed on device but refers to a channel?
|
||||||
|
my $chnHash = (!$isChannel && $modules{CUL_HM}{defptr}{$dst."01"})?
|
||||||
|
$modules{CUL_HM}{defptr}{$dst."01"}:$hash;
|
||||||
my $devHash = CUL_HM_getDeviceHash($hash);
|
my $devHash = CUL_HM_getDeviceHash($hash);
|
||||||
my $id = CUL_HM_IOid($hash);
|
my $id = CUL_HM_IOid($hash);
|
||||||
my $state = "set_".join(" ", @a[1..(int(@a)-1)]);
|
my $state = "set_".join(" ", @a[1..(int(@a)-1)]);
|
||||||
@ -2501,9 +2512,11 @@ sub CUL_HM_Set($@) {
|
|||||||
}
|
}
|
||||||
elsif($cmd eq "on") { #######################################################
|
elsif($cmd eq "on") { #######################################################
|
||||||
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'02'.$chn.'C80000');
|
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'02'.$chn.'C80000');
|
||||||
|
$hash = $chnHash; # report to channel if defined
|
||||||
}
|
}
|
||||||
elsif($cmd eq "off") { ######################################################
|
elsif($cmd eq "off") { ######################################################
|
||||||
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'02'.$chn.'000000');
|
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'02'.$chn.'000000');
|
||||||
|
$hash = $chnHash; # report to channel if defined
|
||||||
}
|
}
|
||||||
elsif($cmd eq "on-for-timer"||$cmd eq "on-till") { ##########################
|
elsif($cmd eq "on-for-timer"||$cmd eq "on-till") { ##########################
|
||||||
my (undef,undef,$duration,$edate) = @a; #date prepared extention to entdate
|
my (undef,undef,$duration,$edate) = @a; #date prepared extention to entdate
|
||||||
@ -2519,10 +2532,12 @@ sub CUL_HM_Set($@) {
|
|||||||
return "please enter the duration in seconds" if (!defined ($duration));
|
return "please enter the duration in seconds" if (!defined ($duration));
|
||||||
$tval = CUL_HM_encodeTime16($duration);# onTime 0.0..85825945.6, 0=forever
|
$tval = CUL_HM_encodeTime16($duration);# onTime 0.0..85825945.6, 0=forever
|
||||||
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'02'.$chn.'C80000'.$tval);
|
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'02'.$chn.'C80000'.$tval);
|
||||||
|
$hash = $chnHash; # report to channel if defined
|
||||||
}
|
}
|
||||||
elsif($cmd eq "toggle") { ###################################################
|
elsif($cmd eq "toggle") { ###################################################
|
||||||
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'02'.$chn.
|
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'02'.$chn.
|
||||||
(ReadingsVal($name,"state","on") eq "off" ?"C80000":"000000"));
|
(ReadingsVal($name,"state","on") eq "off" ?"C80000":"000000"));
|
||||||
|
$hash = $chnHash; # report to channel if defined
|
||||||
}
|
}
|
||||||
elsif($cmd eq "lock") { #####################################################
|
elsif($cmd eq "lock") { #####################################################
|
||||||
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'800100FF'); # LEVEL_SET
|
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'800100FF'); # LEVEL_SET
|
||||||
@ -3610,6 +3625,12 @@ my %culHmBits = (
|
|||||||
LOWBAT => '00,2,$val=(hex($val)&0x80)?1:0',
|
LOWBAT => '00,2,$val=(hex($val)&0x80)?1:0',
|
||||||
VALUE => '02,2,$val=(hex($val))',
|
VALUE => '02,2,$val=(hex($val))',
|
||||||
NEXT => '04,2,$val=(hex($val))',} },
|
NEXT => '04,2,$val=(hex($val))',} },
|
||||||
|
"53" => { txt => "WaterSensor", params => {
|
||||||
|
CMD => "00,2",
|
||||||
|
SEQ => '02,2,$val=(hex($val))-64',
|
||||||
|
V1 => '08,2,$val=(hex($val))',
|
||||||
|
V2 => '10,2,$val=(hex($val))',
|
||||||
|
V3 => '12,2,$val=(hex($val))'} },
|
||||||
"58" => { txt => "ClimateEvent", params => {
|
"58" => { txt => "ClimateEvent", params => {
|
||||||
CMD => "00,2",
|
CMD => "00,2",
|
||||||
ValvePos => '02,2,$val=(hex($val))', } },
|
ValvePos => '02,2,$val=(hex($val))', } },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user