2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

CUL_HM:siren update

git-svn-id: https://svn.fhem.de/fhem/trunk@11645 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2016-06-11 09:54:00 +00:00
parent 9bf05414cf
commit a766508275
3 changed files with 71 additions and 11 deletions

View File

@ -31,6 +31,7 @@ sub HMLAN_getVerbLvl ($$$$);
my %sets = ( "open" => ""
,"close" => ""
,"reopen" => ""
,"restart" => ""
,"hmPairForSec" => "HomeMatic"
,"hmPairSerial" => "HomeMatic"
,"reassignIDs" => ""
@ -436,6 +437,10 @@ sub HMLAN_Set($@) {############################################################
HMLAN_condUpdate($hash,253);#set disconnected
DevIo_OpenDev($hash, 0, "HMLAN_DoInit");
}
elsif($cmd eq "restart") { #################################
HMLAN_SimpleWrite($hash, "Y05,");
HMLAN_condUpdate($hash,253);#set disconnected
}
elsif($cmd eq "close") { #################################
DevIo_CloseDev($hash);
HMLAN_condUpdate($hash,253);#set disconnected
@ -1168,8 +1173,14 @@ sub HMLAN_getVerbLvl ($$$$){#get verboseLevel for message
<ul>
<li><a href="#hmPairForSec">hmPairForSec</a></li>
<li><a href="#hmPairSerial">hmPairSerial</a></li>
<li><a href="#hmreopen">reopen</a>
reconnect the device
</li>
<li><a href="#hmrestart">restart</a>
Restart the device
</li>
<li><a href="#HMLANset_reassignIDs">reassignIDs</a>
Syncs the IDs between HMLAN and teh FHEM list.
Syncs the IDs between HMLAN and the FHEM list.
Usually this is done automatically and only is recomended if there is a difference in counts.
</li>
<br><br>
@ -1305,6 +1316,11 @@ sub HMLAN_getVerbLvl ($$$$){#get verboseLevel for message
<ul>
<li><a href="#hmPairForSec">hmPairForSec</a></li>
<li><a href="#hmPairSerial">hmPairSerial</a></li>
<li><a href="#hmreopen">reopen</a>
Connection zum IO device neu starten</li>
<li><a href="#hmrestart">restart</a>
Neustart des IOdevice
</li>
<li><a href="#HMLANset_reassignIDs">reassignIDs</a>
Synchronisiert die im HMLAN eingetragenen IDs mit der von FHEM verwalteten Liste.
I.a. findet dies automatisch statt, koennte aber in reset Fällen abweichen.

View File

@ -2134,6 +2134,26 @@ sub CUL_HM_Parse($$) {#########################################################
}
elsif($mh{st} =~ m /^(siren)$/) {############################################
if (($mh{mTyp} eq "0201") || # handle Ack_Status
($mh{mTyp} eq "1006")) { # or Info_Status message here
my ($chn,$val,$err) = (hex($mI[1]),hex($mI[2])/2,hex($mI[3]));
my $vs = $val == 0 ? "off" : "on";
if ($chn == 4){
my %lvlSet = ("00"=>"disarmed","01"=>"armExtSens","02"=>"armAll","03"=>"armBlocked");
$vs = $lvlSet{$val};
}
push @evtEt,[$mh{cHash},1,"level:$val"];
push @evtEt,[$mh{cHash},1,"pct:$val"]; # duplicate to level - necessary for "slider"
push @evtEt,[$mh{cHash},1,"deviceMsg:$vs$target"] if($mh{chnM} ne "00");
push @evtEt,[$mh{cHash},1,"state:$vs"];
push @evtEt,[$mh{cHash},1,"timedOn:".(($err&0x40)?"running":"off")];
push @evtEt,[$mh{devH},1,"powerOn:$tn",] if ($chn == 0) ;
push @evtEt,[$mh{devH},1,"sabotageError:".(($err&0x04)?"on":"off")];
}
}
elsif($mh{st} eq "senBright") { #############################################
if ($mh{mTp} =~ m/5[34]/){
#Channel is fixed 1
@ -2191,15 +2211,16 @@ sub CUL_HM_Parse($$) {#########################################################
my $sumState = "eState:E: $eCnt P: $P";
push @evtEt,[$mh{shash},1,$sumState];
push @evtEt,[$mh{shash},1,"boot:" .(($eCnt&0x800000)?"on":"off")];
my $eo = ReadingsVal($mh{shash}->{NAME},"gasCntOffset",0);
if($eCnt == 0 && hex($mh{mNo}) < 3 ){
if($mh{devH}->{helper}{PONtest}){
push @evtEt,[$mh{devH},1,"powerOn:$tn",] ;
$mh{devH}->{helper}{PONtest} = 0;
}
my $eo = ReadingsVal($mh{shash}->{NAME},"gasCnt",0)+
ReadingsVal($mh{shash}->{NAME},"gasCntOffset",0);
$eo += ReadingsVal($mh{shash}->{NAME},"gasCnt",0);
push @evtEt,[$mh{shash},1,"gasCntOffset:".$eo];
}
push @evtEt,[$mh{shash},1,"gasCntCalc:".($eo + $eCnt)];
}
elsif ($mh{mTp} eq "5E" ||$mh{mTp} eq "5F" ) { # POWER_EVENT_CYCLIC
$mh{shash} = $modules{CUL_HM}{defptr}{$mh{src}."02"}
@ -2345,7 +2366,7 @@ sub CUL_HM_Parse($$) {#########################################################
push @evtEt,[$mh{shash},1,""];
}
elsif ($mh{mTp} =~ m /^4[01]/){# if channel is SD team we have to act
if ($mh{cHash}->{helper}{fkt} eq "sdLead2"){
if ($mh{cHash}->{helper}{fkt} && $mh{cHash}->{helper}{fkt} eq "sdLead2"){
CUL_HM_parseSDteam_2($mh{mTp},$mh{src},$mh{dst},$mh{p});
}
else{
@ -4377,6 +4398,19 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
CUL_HM_PushCmdStack($hash,"++${flag}11$id${dst}02${chn}$lvlMax$ramp$tval");
$hash = $chnHash; # report to channel if defined
}
elsif($cmd eq "alarmLevel") { ###############################################
#level =>"[disarmed|armExtSens|armAll|armBlocked]"
my %lvlSet = (disarmed=>"00",armExtSens=>"01",armAll=>"02",armBlocked=>"03");
my (undef,undef,$lvl,$onTime) = (@a,0);#set ontime to 0 if not given.
$lvl = $lvlSet{$lvl};
return "please enter the onTime in seconds"
if ($onTime !~ m/^[+-]?\d+(\.\d+)?$/);
my $tval = CUL_HM_encodeTime16($onTime);# onTime 0.0..85825945.6, 0=forever
$tval = "" if ($tval eq "0000");
CUL_HM_PushCmdStack($hash,"++${flag}11$id${dst}02${chn}${lvl}0000$tval");
}
elsif($cmd eq "lock") { #####################################################
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'800100FF'); # LEVEL_SET
}

View File

@ -308,7 +308,7 @@ my $K_actDetID = '000000'; # id of actionDetector
,"00F6" => {name=>"HM-ES-PMSw1-SM" ,alias=>"HM-ES-PMSw1-Pl"}
,"00F7" => {name=>"HM-SEC-MDIR-3" ,alias=>"HM-SEC-MDIR"}
,"00F8" => {name=>"HM-RC-4-3-D" ,st=>'remote' ,cyc=>'' ,rxt=>'c:w:l' ,lst=>'1,4' ,chn=>"Btn:1:4",}
,"00F9" => {name=>"HM-Sec-Sir-WM" ,st=>'siren' ,cyc=>'' ,rxt=>'c:b' ,lst=>'1,3' ,chn=>"Sen:1:2,Panic:3:3,Arm4:4",}
,"00F9" => {name=>"HM-Sec-Sir-WM" ,st=>'siren' ,cyc=>'' ,rxt=>'c:b' ,lst=>'1,3' ,chn=>"Sen:1:2,Panic:3:3,Arm:4:4",}
,"00FA" => {name=>"HM-OU-CFM-TW" ,st=>'outputUnit' ,cyc=>'' ,rxt=>'c:b' ,lst=>'3' ,chn=>"Led:1:1,Mp3:2:2",}
,"00FB" => {name=>"HM-Dis-EP-WM55" ,st=>'pushButton' ,cyc=>'' ,rxt=>'c:b' ,lst=>'1,3' ,chn=>"Dis:1:2,Key:3:9",}
,"00FC" => {name=>"OLIGO-smart-iq-HM" ,st=>'dimmer' ,cyc=>'' ,rxt=>'' ,lst=>'1,3' ,chn=>"Dim:1:2,Dim1_V:3:4,Dim2_V:5:6",}
@ -376,6 +376,7 @@ foreach my $al (keys %culHmModel){ # duplicate entries for alias devices
OffLevel =>{a=> 15.0,s=>1.0,l=>3,min=>0 ,max=>100 ,c=>'' ,f=>2 ,u=>'%' ,d=>0,t=>"PowerLevel off"},
OnMinLevel =>{a=> 16.0,s=>1.0,l=>3,min=>0 ,max=>100 ,c=>'' ,f=>2 ,u=>'%' ,d=>0,t=>"minimum PowerLevel"},
OnLevel =>{a=> 17.0,s=>1.0,l=>3,min=>0 ,max=>100.5 ,c=>'' ,f=>2 ,u=>'%' ,d=>1,t=>"PowerLevel on" ,lit=>{oldLevel=>100.5}},
OnLevelArm =>{a=> 17.0,s=>1.0,l=>3,min=>0 ,max=>100 ,c=>'lit' ,f=>2 ,u=>'' ,d=>1,t=>"onLevel on" ,lit=>{disarmed=>0,extSens=>50,allSens=>200}},
OffLevelKm =>{a=> 15.0,s=>1.0,l=>3,min=>0 ,max=>127.5 ,c=>'' ,f=>2 ,u=>'%' ,d=>0,t=>"OnLevel 127.5=locked"},
OnLevelKm =>{a=> 17.0,s=>1.0,l=>3,min=>0 ,max=>127.5 ,c=>'' ,f=>2 ,u=>'%' ,d=>0,t=>"OnLevel 127.5=locked"},
@ -687,6 +688,7 @@ foreach my $al (keys %culHmModel){ # duplicate entries for alias devices
waGreen =>{a=>165.0,s=>1 ,l=>1,min=>0 ,max=>100 ,c=>'' ,f=>'' ,u=>'%' ,d=>0,t=>"whitebalance green"},
waBlue =>{a=>166.0,s=>1 ,l=>1,min=>0 ,max=>100 ,c=>'' ,f=>'' ,u=>'%' ,d=>0,t=>"whitebalance blue"},
colChangeSpeed =>{a=>167.0,s=>1 ,l=>1,min=>0 ,max=>255 ,c=>'' ,f=>'' ,u=>'s/U' ,d=>0,t=>"color change speed"},
soundId =>{a=>171.0,s=>1 ,l=>1,min=>0 ,max=>72 ,c=>'' ,f=>'' ,u=>'' ,d=>0,t=>"sound ID" ,lit=>{unused=>0}},
acusticMultiDly =>{a=>169.7,s=>0.1,l=>1,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"acustic mutli exec delay" ,lit=>{off=>0,on=>1}},
@ -703,7 +705,7 @@ foreach my $al (keys %culHmModel){ # duplicate entries for alias devices
opticDisArm =>{a=>170.0,s=>0.1,l=>1,min=>0 ,max=>1 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"optic disarm " ,lit=>{off=>0,on=>1}},
txThresPercent =>{a=>172.0,s=>1 ,l=>1,min=>10 ,max=>100 ,c=>'' ,f=>'' ,u=>'%' ,d=>0,t=>"threshold percent" ,lit=>{unused=>0}},
txThresPercent =>{a=>172.0,s=>1 ,l=>1,min=>10 ,max=>100 ,c=>'' ,f=>'' ,u=>'%' ,d=>0,t=>"threshold percent" ,lit=>{unused=>0}},
#rf_es_tx_wm r:TX_THRESHOLD_POWER l:1 idx:124 size:3 type:integer log## ty: float min:0.01 max:160000.0 def:100.00 uni:W Conv## ty: float_integer_scale factor:100 offset:
#rf_es_tx_wm r:METER_TYPE l:1 idx:149 size:1 type:integer log## ty: option min: max: def: uni: Conv## ty: option_integer factor: offset:
#rf_es_tx_wm r:POWER_STRING l:1 idx:54 size:16 type:string log## ty: string min: max: def: uni:
@ -927,7 +929,7 @@ foreach my $al (keys %culHmModel){ # duplicate entries for alias devices
}
,siren =>{ intKeyVisib =>1
,transmitTryMax =>1,statusInfoMinDly=>1,statusInfoRandom=>1,powerUpAction =>1
,transmitTryMax =>1,statusInfoMinDly=>1,statusInfoRandom=>1
,alarmTimeMax =>1,cyclicInfoMsg =>1,sabotageMsg =>1,signalTone =>1
,lowBatLimitRT =>1,localResDis =>1,lowBatSignal =>1
@ -1239,9 +1241,11 @@ $culHmRegModel{"ROTO_ZEL-STG-RM-DWT-10"}= $culHmRegModel{"HM-PB-4DIS-WM"};
,ActionType =>1,OnTimeMode =>1,OffTimeMode =>1
,lgMultiExec =>1,shMultiExec =>1,powerUpAction =>1
}
,"HM-Sec-Sir-WM01" =>{ soundId =>1}
,"HM-Sec-Sir-WM04" =>{ OnLevel =>1
,acusticMultiDly =>1,acusticArmSens =>1,acusticArmDly =>1,acusticExtArm =>1,acusticExtDly =>1,acusticDisArm =>1
,opticMultiDly =>1,opticArmSens =>1,opticArmDly =>1,opticExtArm =>1,opticExtDly =>1,opticDisArm =>1
,OnLevelArm =>1
}
,"HM-ES-PMSw1-Pl02" =>{ averaging =>1
,txMinDly =>1,txThrPwr =>1,txThrCur =>1,txThrVlt =>1,txThrFrq =>1
@ -1307,6 +1311,8 @@ $culHmRegChan{"WDF-solar02"} = $culHmRegType{"dimmer"}; # type has
$culHmRegChan{"HM-TC-IT-WM-W-EU03"} = $culHmRegChan{"HM-CC-RT-DN03"};
$culHmRegChan{"HM-TC-IT-WM-W-EU06"} = $culHmRegChan{"HM-CC-RT-DN06"};
$culHmRegChan{"HM-Sec-Sir-WM02"} = $culHmRegChan{"HM-Sec-Sir-WM01"};
$culHmRegChan{"HM-Sec-Sir-WM03"} = $culHmRegChan{"HM-Sec-Sir-WM01"};
$culHmRegChan{"ROTO_ZEL-STG-RM-FWT02"}= $culHmRegChan{"HM-CC-TC02"};
$culHmRegChan{"ROTO_ZEL-STG-RM-FWT03"}= $culHmRegChan{"HM-CC-TC03"};
@ -1633,14 +1639,14 @@ $culHmSubTypeSets{motionAndBtn} = $culHmSubTypeSets{threeStateSensor};
%culHmModelSets = (# channels of this subtype-------------
"HM-CC-VD" =>{ valvePos =>"[off|0.0..99.0]"}
,"HM-RC-19" =>{ service => "-count-"
,"HM-RC-19" =>{ service =>"-count-"
,alarm => "-count-"
,display => "-text- [comma|no] [unit] [off|1|2|3] [off|on|slow|fast] -symbol-"
}
,"HM-PB-4DIS-WM" =>{ text => "-txt1- -txt2-..."
,"HM-PB-4DIS-WM" =>{ text =>"-txt1- -txt2-..."
#text => "-btn- [on|off] -txt1- -txt2-...", old style will not be offered anymore
}
,"HM-OU-LED16" =>{ led => "[off|red|green|orange]"
,"HM-OU-LED16" =>{ led =>"[off|red|green|orange]"
,ilum => "[0-15] [0-127]"
,statusRequest =>""
}
@ -1659,10 +1665,13 @@ $culHmSubTypeSets{motionAndBtn} = $culHmSubTypeSets{threeStateSensor};
,"HM-TC-IT-WM-W-EU" =>{ inhibit =>"[on|off]"}
,"HM-SEC-SD" =>{ statusRequest =>""}
,"HM-SEC-SD-2" =>{ statusRequest =>""}
,"ActionDetector" =>{ clear => "[readings|all]"
,"ActionDetector" =>{ clear =>"[readings|all]"
,update => ""
}
);
# clones- - - - - - - - - - - - - - - - -
$culHmModelSets{"HM-OU-CM-PCB"} = $culHmModelSets{"HM-OU-CFM-PL"};
@ -1793,6 +1802,7 @@ $culHmModelSets{"HM-OU-CM-PCB"} = $culHmModelSets{"HM-SEC-SD"};
}
,"HM-LC-RGBW-WM02" =>{ brightCol =>"-bright- -colVal- -duration- -ramp- ..."}
,"HM-LC-RGBW-WM03" =>{ brightAuto =>"-bright- -colProg- -min- -max- -duration- -ramp- ..."}
,"HM-Sec-Sir-WM04" =>{ alarmLevel =>"[disarmed|armExtSens|armAll|armBlocked]"}
);
# clones- - - - - - - - - - - - - - - - -