2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

repair TC, add virtual circuit

git-svn-id: https://svn.fhem.de/fhem/trunk@1922 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2012-10-04 18:46:58 +00:00
parent 8ce894a161
commit 7ec6c65048
2 changed files with 316 additions and 179 deletions

View File

@ -69,98 +69,123 @@ my %culHmDevProps=(
# <dev>_disp as channel 4 # <dev>_disp as channel 4
# <dev>_aux1,<dev>_aux2,<dev>_aux7 as channel 5 to 7 # <dev>_aux1,<dev>_aux2,<dev>_aux7 as channel 5 to 7
# autocreate for single channel devices is possible not recommended # autocreate for single channel devices is possible not recommended
#rxt - receivetype of the device------
# c: receive on config
# w: receive in wakeup
# b: receive on burst
my %culHmModel=( my %culHmModel=(
"0001" => {name=>"HM-LC-SW1-PL-OM54", chn=>"",}, "0001" => {name=>"HM-LC-SW1-PL-OM54" ,rxt=>'' ,chn=>"",},
"0002" => {name=>"HM-LC-SW1-SM", chn=>"",}, "0002" => {name=>"HM-LC-SW1-SM" ,rxt=>'' ,chn=>"",},
"0003" => {name=>"HM-LC-SW4-SM", chn=>"Sw:1:4",}, "0003" => {name=>"HM-LC-SW4-SM" ,rxt=>'' ,chn=>"Sw:1:4",},
"0004" => {name=>"HM-LC-SW1-FM", chn=>"",}, "0004" => {name=>"HM-LC-SW1-FM" ,rxt=>'' ,chn=>"",},
"0005" => {name=>"HM-LC-BL1-FM", chn=>"",}, "0005" => {name=>"HM-LC-BL1-FM" ,rxt=>'' ,chn=>"",},
"0006" => {name=>"HM-LC-BL1-SM", chn=>"",}, "0006" => {name=>"HM-LC-BL1-SM" ,rxt=>'' ,chn=>"",},
"0007" => {name=>"KS550", chn=>"",}, "0007" => {name=>"KS550" ,rxt=>'' ,chn=>"",},
"0008" => {name=>"HM-RC-4", chn=>"Btn:1:4",}, "0008" => {name=>"HM-RC-4" ,rxt=>'c' ,chn=>"Btn:1:4",},
"0009" => {name=>"HM-LC-SW2-FM", chn=>"Sw:1:2",}, "0009" => {name=>"HM-LC-SW2-FM" ,rxt=>'' ,chn=>"Sw:1:2",},
"000A" => {name=>"HM-LC-SW2-SM", chn=>"Sw:1:2",}, "000A" => {name=>"HM-LC-SW2-SM" ,rxt=>'' ,chn=>"Sw:1:2",},
"000B" => {name=>"HM-WDC7000", chn=>"",}, "000B" => {name=>"HM-WDC7000" ,rxt=>'' ,chn=>"",},
"000D" => {name=>"ASH550", chn=>"",}, "000D" => {name=>"ASH550" ,rxt=>'c:w' ,chn=>"",},
"000E" => {name=>"ASH550I", chn=>"",}, "000E" => {name=>"ASH550I" ,rxt=>'c:w' ,chn=>"",},
"000F" => {name=>"S550IA", chn=>"",}, "000F" => {name=>"S550IA" ,rxt=>'c:w' ,chn=>"",},
"0011" => {name=>"HM-LC-SW1-PL", chn=>"",}, "0011" => {name=>"HM-LC-SW1-PL" ,rxt=>'' ,chn=>"",},
"0012" => {name=>"HM-LC-DIM1L-CV", chn=>"",}, "0012" => {name=>"HM-LC-DIM1L-CV" ,rxt=>'' ,chn=>"",},
"0013" => {name=>"HM-LC-DIM1L-PL", chn=>"",}, "0013" => {name=>"HM-LC-DIM1L-PL" ,rxt=>'' ,chn=>"",},
"0014" => {name=>"HM-LC-SW1-SM-ATMEGA168",chn=>"",}, "0014" => {name=>"HM-LC-SW1-SM-ATMEGA168" ,rxt=>'' ,chn=>"",},
"0015" => {name=>"HM-LC-SW4-SM-ATMEGA168",chn=>"Sw:1:4",}, "0015" => {name=>"HM-LC-SW4-SM-ATMEGA168" ,rxt=>'' ,chn=>"Sw:1:4",},
"0016" => {name=>"HM-LC-DIM2L-CV", chn=>"",}, "0016" => {name=>"HM-LC-DIM2L-CV" ,rxt=>'' ,chn=>"Sw:1:2",},
"0018" => {name=>"CMM", chn=>"",}, "0018" => {name=>"CMM" ,rxt=>'' ,chn=>"",},
"0019" => {name=>"HM-SEC-KEY", chn=>"",}, "0019" => {name=>"HM-SEC-KEY" ,rxt=>'' ,chn=>"",},
"001A" => {name=>"HM-RC-P1", chn=>"",}, "001A" => {name=>"HM-RC-P1" ,rxt=>'c' ,chn=>"",},
"001B" => {name=>"HM-RC-SEC3", chn=>"",}, "001B" => {name=>"HM-RC-SEC3" ,rxt=>'c' ,chn=>"Btn:1:3",},
"001C" => {name=>"HM-RC-SEC3-B", chn=>"",}, "001C" => {name=>"HM-RC-SEC3-B" ,rxt=>'c' ,chn=>"Btn:1:3",},
"001D" => {name=>"HM-RC-KEY3", chn=>"",}, "001D" => {name=>"HM-RC-KEY3" ,rxt=>'c' ,chn=>"Btn:1:3",},
"001E" => {name=>"HM-RC-KEY3-B", chn=>"",}, "001E" => {name=>"HM-RC-KEY3-B" ,rxt=>'c' ,chn=>"Btn:1:3",},
"0022" => {name=>"WS888", chn=>"",}, "0022" => {name=>"WS888" ,rxt=>'' ,chn=>"",},
"0026" => {name=>"HM-SEC-KEY-S", chn=>"",}, "0026" => {name=>"HM-SEC-KEY-S" ,rxt=>'' ,chn=>"",},
"0027" => {name=>"HM-SEC-KEY-O", chn=>"",}, "0027" => {name=>"HM-SEC-KEY-O" ,rxt=>'' ,chn=>"",},
"0028" => {name=>"HM-SEC-WIN", chn=>"",}, "0028" => {name=>"HM-SEC-WIN" ,rxt=>'b' ,chn=>"",},
"0029" => {name=>"HM-RC-12", chn=>"Btn:1:12",}, "0029" => {name=>"HM-RC-12" ,rxt=>'c' ,chn=>"Btn:1:12",},
"002A" => {name=>"HM-RC-12-B", chn=>"Btn:1:12",}, "002A" => {name=>"HM-RC-12-B" ,rxt=>'c' ,chn=>"Btn:1:12",},
"002D" => {name=>"HM-LC-SW4-PCB", chn=>"Sw:1:4",}, "002D" => {name=>"HM-LC-SW4-PCB" ,rxt=>'' ,chn=>"Sw:1:4",},
"002E" => {name=>"HM-LC-DIM2L-SM", chn=>"",}, "002E" => {name=>"HM-LC-DIM2L-SM" ,rxt=>'' ,chn=>"Sw:1:2",},
"002F" => {name=>"HM-SEC-SC", chn=>"",}, "002F" => {name=>"HM-SEC-SC" ,rxt=>'c:w' ,chn=>"",},
"0030" => {name=>"HM-SEC-RHS", chn=>"",}, "0030" => {name=>"HM-SEC-RHS" ,rxt=>'c:w' ,chn=>"",},
"0034" => {name=>"HM-PBI-4-FM", chn=>"Btn:1:4",}, "0034" => {name=>"HM-PBI-4-FM" ,rxt=>'c' ,chn=>"Btn:1:4",},
"0035" => {name=>"HM-PB-4-WM", chn=>"Btn:1:4",}, "0035" => {name=>"HM-PB-4-WM" ,rxt=>'c' ,chn=>"Btn:1:4",},
"0036" => {name=>"HM-PB-2-WM", chn=>"Btn:1:2",}, "0036" => {name=>"HM-PB-2-WM" ,rxt=>'c' ,chn=>"Btn:1:2",},
"0037" => {name=>"HM-RC-19", chn=>"Btn:1:17,Disp:18",}, "0037" => {name=>"HM-RC-19" ,rxt=>'c:b' ,chn=>"Btn:1:17,Disp:18",},
"0038" => {name=>"HM-RC-19-B", chn=>"Btn:1:17,Disp:18",}, "0038" => {name=>"HM-RC-19-B" ,rxt=>'c:b' ,chn=>"Btn:1:17,Disp:18",},
"0039" => {name=>"HM-CC-TC", chn=>"",}, "0039" => {name=>"HM-CC-TC" ,rxt=>'c:w' ,chn=>"",},
"003A" => {name=>"HM-CC-VD", chn=>"",}, "003A" => {name=>"HM-CC-VD" ,rxt=>'c:w' ,chn=>"",},
"003B" => {name=>"HM-RC-4-B", chn=>"Btn:1:4",}, "003B" => {name=>"HM-RC-4-B" ,rxt=>'c' ,chn=>"Btn:1:4",},
"003C" => {name=>"HM-WDS20-TH-O", chn=>"",}, "003C" => {name=>"HM-WDS20-TH-O" ,rxt=>'c:w' ,chn=>"",},
"003D" => {name=>"HM-WDS10-TH-O", chn=>"",}, "003D" => {name=>"HM-WDS10-TH-O" ,rxt=>'c:w' ,chn=>"",},
"003E" => {name=>"HM-WDS30-T-O", chn=>"",}, "003E" => {name=>"HM-WDS30-T-O" ,rxt=>'c:w' ,chn=>"",},
"003F" => {name=>"HM-WDS40-TH-I", chn=>"",}, "003F" => {name=>"HM-WDS40-TH-I" ,rxt=>'c:w' ,chn=>"",},
"0040" => {name=>"HM-WDS100-C6-O", chn=>"",}, "0040" => {name=>"HM-WDS100-C6-O" ,rxt=>'c:w' ,chn=>"",},
"0041" => {name=>"HM-WDC7000", chn=>"",}, "0041" => {name=>"HM-WDC7000" ,rxt=>'' ,chn=>"",},
"0042" => {name=>"HM-SEC-SD", chn=>"",}, "0042" => {name=>"HM-SEC-SD" ,rxt=>'' ,chn=>"",},
"0043" => {name=>"HM-SEC-TIS", chn=>"",}, "0043" => {name=>"HM-SEC-TIS" ,rxt=>'c:w' ,chn=>"",},
"0044" => {name=>"HM-SEN-EP", chn=>"",}, "0044" => {name=>"HM-SEN-EP" ,rxt=>'c:w' ,chn=>"",},
"0045" => {name=>"HM-SEC-WDS", chn=>"",}, "0045" => {name=>"HM-SEC-WDS" ,rxt=>'c:w' ,chn=>"",},
"0047" => {name=>"KFM-Sensor", chn=>"",}, "0047" => {name=>"KFM-Sensor" ,rxt=>'' ,chn=>"",},
"0046" => {name=>"HM-SWI-3-FM", chn=>"Sw:1:3",}, "0046" => {name=>"HM-SWI-3-FM" ,rxt=>'c' ,chn=>"Sw:1:3",},
"0048" => {name=>"IS-WDS-TH-OD-S-R3", chn=>"",}, "0048" => {name=>"IS-WDS-TH-OD-S-R3" ,rxt=>'c:w' ,chn=>"",},
"0049" => {name=>"KFM-Display", chn=>"",}, "0049" => {name=>"KFM-Display" ,rxt=>'' ,chn=>"",},
"004A" => {name=>"HM-SEC-MDIR", chn=>"",}, "004A" => {name=>"HM-SEC-MDIR" ,rxt=>'c:w' ,chn=>"",},
"004B" => {name=>"HM-Sec-Cen", chn=>"",}, "004B" => {name=>"HM-Sec-Cen" ,rxt=>'' ,chn=>"",},
"004C" => {name=>"HM-RC-12-SW", chn=>"Btn:1:12",}, "004C" => {name=>"HM-RC-12-SW" ,rxt=>'c' ,chn=>"Btn:1:12",},
"004D" => {name=>"HM-RC-19-SW", chn=>"Btn:1:17,Disp:18",}, "004D" => {name=>"HM-RC-19-SW" ,rxt=>'c:b' ,chn=>"Btn:1:17,Disp:18",},
"004E" => {name=>"HM-LC-DDC1-PCB", chn=>"",}, "004E" => {name=>"HM-LC-DDC1-PCB" ,rxt=>'' ,chn=>"",},
"004F" => {name=>"HM-SEN-MDIR-SM", chn=>"",}, "004F" => {name=>"HM-SEN-MDIR-SM" ,rxt=>'c:w' ,chn=>"",},
"0050" => {name=>"HM-SEC-SFA-SM", chn=>"",}, "0050" => {name=>"HM-SEC-SFA-SM" ,rxt=>'' ,chn=>"",},
"0051" => {name=>"HM-LC-SW1-PB-FM", chn=>"",}, "0051" => {name=>"HM-LC-SW1-PB-FM" ,rxt=>'' ,chn=>"",},
"0052" => {name=>"HM-LC-SW2-PB-FM", chn=>"Sw:1:2",}, "0052" => {name=>"HM-LC-SW2-PB-FM" ,rxt=>'' ,chn=>"Sw:1:2",},
"0053" => {name=>"HM-LC-BL1-PB-FM", chn=>"",}, "0053" => {name=>"HM-LC-BL1-PB-FM" ,rxt=>'' ,chn=>"",},
"0056" => {name=>"HM-CC-SCD", chn=>"",}, "0054" => {name=>"DORMA_RC-H" ,rxt=>'c' ,chn=>"",},
"0057" => {name=>"HM-LC-DIM1T-PL", chn=>"",}, "0056" => {name=>"HM-CC-SCD" ,rxt=>'c:w' ,chn=>"",},
"0058" => {name=>"HM-LC-DIM1T-CV", chn=>"",}, "0057" => {name=>"HM-LC-DIM1T-PL" ,rxt=>'' ,chn=>"",},
"0059" => {name=>"HM-LC-DIM1T-FM", chn=>"",}, "0058" => {name=>"HM-LC-DIM1T-CV" ,rxt=>'' ,chn=>"",},
"005A" => {name=>"HM-LC-DIM2T-SM", chn=>"",}, "0059" => {name=>"HM-LC-DIM1T-FM" ,rxt=>'' ,chn=>"",},
"005C" => {name=>"HM-OU-CF-PL", chn=>"",}, "005A" => {name=>"HM-LC-DIM2T-SM" ,rxt=>'' ,chn=>"Sw:1:2",},
"005D" => {name=>"HM-Sen-MDIR-O", chn=>"",}, "005C" => {name=>"HM-OU-CF-PL" ,rxt=>'' ,chn=>"",},
"005F" => {name=>"HM-SCI-3-FM", chn=>"",}, "005D" => {name=>"HM-Sen-MDIR-O" ,rxt=>'c:w' ,chn=>"",},
"0060" => {name=>"HM-PB-4DIS-WM", chn=>"",}, "005F" => {name=>"HM-SCI-3-FM" ,rxt=>'c:w' ,chn=>"",},
"0061" => {name=>"HM-LC-SW4-DR", chn=>"Sw:1:4",}, "0060" => {name=>"HM-PB-4DIS-WM" ,rxt=>'c' ,chn=>"",},
"0062" => {name=>"HM-LC-SW2-DR", chn=>"Sw:1:2",}, "0061" => {name=>"HM-LC-SW4-DR" ,rxt=>'' ,chn=>"Sw:1:4",},
"0066" => {name=>"HM_LC_Sw4-WM", chn=>"Sw:1:4",}, "0062" => {name=>"HM-LC-SW2-DR" ,rxt=>'' ,chn=>"Sw:1:2",},
"0067" => {name=>"HM-LC_Dim1PWM-CV", chn=>"",}, "0064" => {name=>"DORMA_atent" ,rxt=>'c' ,chn=>"",},
"0068" => {name=>"HM-LC_Dim1TPBU-FM", chn=>"",}, "0065" => {name=>"DORMA_BRC-H" ,rxt=>'c' ,chn=>"",},
"0069" => {name=>"HM-LC_Sw1PBU-FM", chn=>"",}, "0066" => {name=>"HM_LC_Sw4-WM" ,rxt=>'b' ,chn=>"Sw:1:4",},
"006A" => {name=>"HM-LC_Bl1PBU-FM", chn=>"",}, "0067" => {name=>"HM-LC_Dim1PWM-CV" ,rxt=>'' ,chn=>"",},
"006C" => {name=>"HM-LC-SW1-BA-PCB", chn=>"",}, "0068" => {name=>"HM-LC_Dim1TPBU-FM" ,rxt=>'' ,chn=>"",},
"006D" => {name=>"HM-OU-LED16", chn=>"Led:1:16",}, "0069" => {name=>"HM-LC_Sw1PBU-FM" ,rxt=>'' ,chn=>"",},
"0075" => {name=>"HM-OU-CFM-PL", chn=>"Led:1:1,Mp3:2:2",}, "006A" => {name=>"HM-LC_Bl1PBU-FM" ,rxt=>'' ,chn=>"",},
"0x7A" => {name=>"ZEL-STG-RM-FSA", chn=>"",}, "006B" => {name=>"HM-PB-2-WM55" ,rxt=>'c:w' ,chn=>"",},
"007B" => {name=>"ZEL-STG-RM-FEP-230V", chn=>"",}, "006C" => {name=>"HM-LC-SW1-BA-PCB" ,rxt=>'b' ,chn=>"",},
"0086" => {name=>"263-146", chn=>"",}, "006D" => {name=>"HM-OU-LED16" ,rxt=>'' ,chn=>"Led:1:16",},
"0075" => {name=>"HM-OU-CFM-PL" ,rxt=>'' ,chn=>"Led:1:1,Mp3:2:2",},
"0078" => {name=>"HM-Dis-TD-T" ,rxt=>'b' ,chn=>"",},
"0079" => {name=>"ROTO_ZEL-STG-RM-FWT" ,rxt=>'c:w' ,chn=>"",},
"0x7A" => {name=>"ROTO_ZEL-STG-RM-FSA" ,rxt=>'' ,chn=>"",},
"007B" => {name=>"ROTO_ZEL-STG-RM-FEP-230V",rxt=>'' ,chn=>"",},
"007D" => {name=>"ROTO_ZEL-STG-RM-WT-2" ,rxt=>'c:w' ,chn=>"",},
"007E" => {name=>"ROTO_ZEL-STG-RM-DWT-10" ,rxt=>'c' ,chn=>"",},
"007F" => {name=>"ROTO_ZEL-STG-RM-FST-UP4" ,rxt=>'c' ,chn=>"",},
"0080" => {name=>"ROTO_ZEL-STG-RM-HS-4" ,rxt=>'c' ,chn=>"",},
"0081" => {name=>"ROTO_ZEL-STG-RM-FDK" ,rxt=>'c:w' ,chn=>"",},
"0082" => {name=>"Roto_ZEL-STG-RM-FFK" ,rxt=>'c:w' ,chn=>"",},
"0083" => {name=>"Roto_ZEL-STG-RM-FSS-UP3" ,rxt=>'c' ,chn=>"",},
"0084" => {name=>"Schueco_263-160" ,rxt=>'c:w' ,chn=>"",},
"0086" => {name=>"263-146" ,rxt=>'' ,chn=>"",},
"008D" => {name=>"Schueco_263-1350" ,rxt=>'c:w' ,chn=>"",},
"008E" => {name=>"263-155" ,rxt=>'c' ,chn=>"",},
"008F" => {name=>"263-145" ,rxt=>'c' ,chn=>"",},
"0090" => {name=>"Schueco_263-162" ,rxt=>'c:w' ,chn=>"",},
"0092" => {name=>"Schueco_263-144" ,rxt=>'c' ,chn=>"",},
"0093" => {name=>"263-158" ,rxt=>'c:w' ,chn=>"",},
"0094" => {name=>"263-157" ,rxt=>'c:w' ,chn=>"",},
); );
sub sub
CUL_HM_Initialize($) CUL_HM_Initialize($)
@ -178,7 +203,7 @@ CUL_HM_Initialize($)
"hmClass:receiver,sender serialNr firmware devInfo ". "hmClass:receiver,sender serialNr firmware devInfo ".
"rawToReadable unit ". "rawToReadable unit ".
"chanNo device ". "chanNo device ".
"protCmdPend protLastRcv protSndCnt protSndLast protCmdDel protNackCnt protNackLast ". "protCmdPend protLastRcv protSndCnt protSndLast protCmdDel protNackCnt protNackLast rxType ".
"channel_01 channel_02 channel_03 channel_04 channel_05 channel_06 ". "channel_01 channel_02 channel_03 channel_04 channel_05 channel_06 ".
"channel_07 channel_08 channel_09 channel_0A channel_0B channel_0C ". "channel_07 channel_08 channel_09 channel_0A channel_0B channel_0C ".
"channel_0D channel_0E channel_0F channel_10 channel_11 channel_12 ". "channel_0D channel_0E channel_0F channel_10 channel_11 channel_12 ".
@ -344,10 +369,11 @@ CUL_HM_Parse($$)
elsif($msgType eq "00" ){ #### DEVICE_INFO, Pairing-Request elsif($msgType eq "00" ){ #### DEVICE_INFO, Pairing-Request
CUL_HM_infoUpdtDevData($name, $shash,$p);#update data CUL_HM_infoUpdtDevData($name, $shash,$p);#update data
if($shash->{cmdStack}) { if($shash->{cmdStack} && ($attr{$name}{rxType} =~ m/config/)) {
CUL_HM_ProcessCmdStack($shash);# sender devices may have msgs stacked CUL_HM_ProcessCmdStack($shash);# sender devices may have msgs stacked
push @event,"";
} else { }
else {
push @event, CUL_HM_Pair($name, $shash,$cmd,$src,$dst,$p); push @event, CUL_HM_Pair($name, $shash,$cmd,$src,$dst,$p);
} }
$sendAck = ""; #todo why is this special? $sendAck = ""; #todo why is this special?
@ -523,6 +549,7 @@ CUL_HM_Parse($$)
CUL_HM_SendCmd($shash, $msgcnt."8002$id${src}00",1,0) # Send Ack CUL_HM_SendCmd($shash, $msgcnt."8002$id${src}00",1,0) # Send Ack
} }
$sendAck = ""; #todo why is this special? $sendAck = ""; #todo why is this special?
CUL_HM_ProcessCmdStack($shash);
} }
elsif($model eq "HM-CC-VD") { ################### elsif($model eq "HM-CC-VD") { ###################
# CMD:8202 SRC:13F251 DST:15B50D 010100002A # CMD:8202 SRC:13F251 DST:15B50D 010100002A
@ -596,7 +623,7 @@ CUL_HM_Parse($$)
if (($msgType eq "02" && $p =~ m/^01/) || # handle Ack_Status if (($msgType eq "02" && $p =~ m/^01/) || # handle Ack_Status
($msgType eq "10" && $p =~ m/^06/)) { # or Info_Status message here ($msgType eq "10" && $p =~ m/^06/)) { # or Info_Status message here
my ($subType,$chn,$level,$add) = ($1,$2,$3,$4) my ($subType,$chn,$level,$addVal) = ($1,$2,$3,hex($4))
if($p =~ m/^(..)(..)(..)(..)/); if($p =~ m/^(..)(..)(..)(..)/);
# Multi-channel device: Use channel if defined # Multi-channel device: Use channel if defined
$shash = $modules{CUL_HM}{defptr}{"$src$chn"} $shash = $modules{CUL_HM}{defptr}{"$src$chn"}
@ -617,7 +644,6 @@ CUL_HM_Parse($$)
$eventName = "motor" if($st eq "blindActuator"); $eventName = "motor" if($st eq "blindActuator");
$eventName = "dim" if($st eq "dimmer"); $eventName = "dim" if($st eq "dimmer");
my $action; #determine action my $action; #determine action
my $addVal = hex($add);
push @event, "$eventName:up:$val" if($addVal&0x10);# see HM-CC-VDstates push @event, "$eventName:up:$val" if($addVal&0x10);# see HM-CC-VDstates
push @event, "$eventName:down:$val" if($addVal&0x20);# align names push @event, "$eventName:down:$val" if($addVal&0x20);# align names
push @event, "$eventName:stop:$val" if($addVal&0x40 || (($addVal == 0) && push @event, "$eventName:stop:$val" if($addVal&0x40 || (($addVal == 0) &&
@ -629,7 +655,6 @@ CUL_HM_Parse($$)
} }
} }
elsif($st eq "remote" || $st eq "pushButton" || $st eq "swi") { ############# elsif($st eq "remote" || $st eq "pushButton" || $st eq "swi") { #############
if($msgType =~ m/^4./ && $p =~ m/^(..)(..)$/) { if($msgType =~ m/^4./ && $p =~ m/^(..)(..)$/) {
my ($buttonField, $bno) = (hex($1), hex($2));# button number/event count my ($buttonField, $bno) = (hex($1), hex($2));# button number/event count
my $buttonID = $buttonField&0x3f;# only 6 bit are valid my $buttonID = $buttonField&0x3f;# only 6 bit are valid
@ -670,7 +695,12 @@ CUL_HM_Parse($$)
} }
$sendAck = ""; #todo why is this special? $sendAck = ""; #todo why is this special?
} }
}
elsif($st eq "virtual"){#####################################################
# possibly add code to count all acks that are paired.
if($msgType eq "02") {
push @event, "ackFrom ".$name;
}
} }
elsif($st eq "outputUnit"){################################################## elsif($st eq "outputUnit"){##################################################
if($msgType eq "40" && $p =~ m/^(..)(..)$/){ if($msgType eq "40" && $p =~ m/^(..)(..)$/){
@ -684,7 +714,6 @@ CUL_HM_Parse($$)
} }
my $btn = int($button&0x3f); my $btn = int($button&0x3f);
push @event, "state:Btn$btn on$target"; push @event, "state:Btn$btn on$target";
push @event, "Btn$btn:on$target";
} }
elsif(($msgType eq "02" && $p =~ m/^01/) || # handle Ack_Status elsif(($msgType eq "02" && $p =~ m/^01/) || # handle Ack_Status
($msgType eq "10" && $p =~ m/^06/)){ # or Info_Status message ($msgType eq "10" && $p =~ m/^06/)){ # or Info_Status message
@ -692,23 +721,29 @@ CUL_HM_Parse($$)
my $chnHash = $modules{CUL_HM}{defptr}{$src.$msgChn}; my $chnHash = $modules{CUL_HM}{defptr}{$src.$msgChn};
if ($model eq "HM-OU-LED16") { if ($model eq "HM-OU-LED16") {
#special: all LEDs map to device state #special: all LEDs map to device state
my $devState = $shash->{READINGS}{state}{VAL}; my $devState = $shash->{READINGS}{color}{VAL};
$devState = "00000000" if (!$devState); $devState = "00000000" if (!$devState);
if($parse eq "powerOn"){# reset LEDs after power on
CUL_HM_PushCmdStack($shash,sprintf("++A011%s%s8100%s",$id,$src,$devState));
CUL_HM_ProcessCmdStack($shash);
}
else {# just update datafields in storage
my $bitLoc = ((hex($msgChn)-1)*2);#calculate bit location my $bitLoc = ((hex($msgChn)-1)*2);#calculate bit location
my $mask = 3<<$bitLoc; my $mask = 3<<$bitLoc;
my $value = (hex($devState) &~$mask)|($msgState<<$bitLoc); my $value = (hex($devState) &~$mask)|($msgState<<$bitLoc);
$shash->{READINGS}{state}{TIME} = $tn; $shash->{READINGS}{color}{TIME} = $tn;
$shash->{READINGS}{state}{VAL} = sprintf("%08X",$value); $shash->{READINGS}{color}{VAL} = sprintf("%08X",$value);
if ($chnHash){ if ($chnHash){
$shash = $chnHash; $shash = $chnHash;
my %colorTable=("00"=>"off","01"=>"red","02"=>"green","03"=>"orange"); my %colorTable=("00"=>"off","01"=>"red","02"=>"green","03"=>"orange");
my $actColor = $colorTable{$msgState}; my $actColor = $colorTable{$msgState};
$actColor = "unknown" if(!$actColor); $actColor = "unknown" if(!$actColor);
$chnHash->{READINGS}{state}{TIME} = $tn; $chnHash->{READINGS}{color}{TIME} = $tn;
$chnHash->{READINGS}{state}{VAL} = $actColor; $chnHash->{READINGS}{color}{VAL} = $actColor;
push @event, "state:$actColor"; push @event, "state:$actColor";
} }
} }
}
elsif ($model eq "HM-OU-CFM-PL"){ elsif ($model eq "HM-OU-CFM-PL"){
if ($chnHash){ if ($chnHash){
$shash = $chnHash; $shash = $chnHash;
@ -725,12 +760,12 @@ CUL_HM_Parse($$)
# Code with help of Bassem # Code with help of Bassem
my $state; my $state;
if($msgType eq "10" && $p =~ m/^06..(..)(..)/) {#InfoLevel if($msgType eq "10" && $p =~ m/^06..(..)(..)/) {#InfoLevel
my $addInfo; my $addVal;
($state, $addInfo) = ($1, $2); ($state, $addVal) = ($1, hex($2));
push @event, "brightness:".hex($state); push @event, "brightness:".hex($state);
push @event, "state:alive"; push @event, "state:alive";
push @event, "cover:closed" if($addInfo eq "00"); # By peterp push @event, "cover:". (($addVal&0x0E eq "00")?"closed":"open");
push @event, "cover:open" if($addInfo eq "0E"); push @event, "battery:". (($addVal&0x80) ?"low" :"ok" );
} }
elsif($msgType eq "41" && $p =~ m/^..(......)/) { elsif($msgType eq "41" && $p =~ m/^..(......)/) {
$state = $1; $state = $1;
@ -788,12 +823,9 @@ CUL_HM_Parse($$)
push @event, "alive:yes"; push @event, "alive:yes";
if($err) { if($err) {
push @event, "battery:". ((hex($err) & 0x80) ? "low" : "ok"); push @event, "battery:". ((hex($err) & 0x80) ? "low" : "ok");
if ($model eq "HM-SEC-WDS"){ if (!$model eq "HM-SEC-WDS"){
$addState =" cover: ".(($err =~ m/^.E/) ? "open" : "closed"); $addState =" cover: ".(($err =~ m/^.E/) ? "open" : "closed");
} }
else{
$addState =" sabotage: ".(($err =~ m/^.E/) ? "yes" : "no");
}
} }
} }
@ -1038,7 +1070,6 @@ my %culHmRegSupported = (
DecalHr =>1,DecalMin =>1, DecalHr =>1,DecalMin =>1,
BacklOnTime =>1,BacklOnMode =>1,BtnLock =>1, BacklOnTime =>1,BacklOnMode =>1,BtnLock =>1,
}, },
outputUnit=>{ outputUnit=>{
OnDlySh =>1,OnTimeSh =>1,OffDlySh =>1,OffTimeSh =>1, OnDlySh =>1,OnTimeSh =>1,OffDlySh =>1,OffTimeSh =>1,
OnDlyLg =>1,OnTimeLg =>1,OffDlyLg =>1,OffTimeLg =>1, OnDlyLg =>1,OnTimeLg =>1,OffDlyLg =>1,OffTimeLg =>1,
@ -1149,7 +1180,7 @@ CUL_HM_Get($@)
if (ref($entityHash->{$entAttr}) eq "HASH"){ if (ref($entityHash->{$entAttr}) eq "HASH"){
foreach my $entAttr2 (keys %{$entityHash->{$entAttr}}){ foreach my $entAttr2 (keys %{$entityHash->{$entAttr}}){
if ($entAttr eq "READINGS" && $entAttr2 eq $a[2]){ if ($entAttr eq "READINGS" && $entAttr2 eq $a[2]){
return "4:".$entityHash->{$entAttr}{$entAttr2}{VAL};# if ($entAttr2{VAL}); return $entityHash->{$entAttr}{$entAttr2}{VAL};# if ($entAttr2{VAL});
} }
if (ref($entityHash->{$entAttr}{$entAttr2}) eq "HASH"){ if (ref($entityHash->{$entAttr}{$entAttr2}) eq "HASH"){
foreach my $entAttr3 (keys %{$entityHash->{$entAttr}{$entAttr2}}){ foreach my $entAttr3 (keys %{$entityHash->{$entAttr}{$entAttr2}}){
@ -1194,7 +1225,8 @@ CUL_HM_Get($@)
$hash->{STATE} = $state if($state); $hash->{STATE} = $state if($state);
Log GetLogLevel($name,2), "CUL_HM set $name " . join(" ", @a[1..$#a]); Log GetLogLevel($name,2), "CUL_HM set $name " . join(" ", @a[1..$#a]);
CUL_HM_ProcessCmdStack($devHash) if(!$isSender); CUL_HM_ProcessCmdStack($devHash)
if(!$attr{$name}{rxType}||$attr{$name}{rxType}=~ m/burst/);
return ""; return "";
} }
################################### ###################################
@ -1211,20 +1243,27 @@ my %culHmGlobalSets = (
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>",
); );
my %culHmSubTypeSets = ( my %culHmSubTypeSets = (
switch => switch =>
{ "on-for-timer"=>"sec", on=>"", off=>"", toggle=>"" }, { "on-for-timer"=>"sec", "on-till"=>"time",
on=>"", off=>"", toggle=>"" },
dimmer => dimmer =>
{ "on-for-timer"=>"sec", on=>"", off=>"", toggle=>"", pct=>"", stop=>""}, { "on-for-timer"=>"sec", , "on-till"=>"time",
on=>"", off=>"", toggle=>"", pct=>"", stop=>""},
blindActuator=> blindActuator=>
{ on=>"", off=>"", toggle=>"", pct=>"", stop=>""}, { on=>"", off=>"", toggle=>"", pct=>"", stop=>""},
remote => remote =>
{ devicepair => "<btnNumber> device ... [single|dual] [set|unset] [actor|remote|both]",}, { devicepair => "<btnNumber> device ... [single|dual] [set|unset] [actor|remote|both]",},
pushButton => pushButton =>
{ devicepair => "<btnNumber> device ... [single|dual] [set|unset] [actor|remote|both]",}, { devicepair => "<btnNumber> device ... [single|dual] [set|unset] [actor|remote|both]",},
virtual =>
{ devicepair => "<btnNumber> device ... [single|dual] [set|unset] [actor|remote|both]",
press => "[long|short]...",
virtual =>"<noButtons>",}, #redef necessary for virtual
smokeDetector => smokeDetector =>
{ test => "", "alarmOn"=>"", "alarmOff"=>"" }, { test => "", "alarmOn"=>"", "alarmOff"=>"", },
winMatic => winMatic =>
{ matic => "<btn>", { matic => "<btn>",
read => "<btn>", read => "<btn>",
@ -1292,20 +1331,20 @@ CUL_HM_Set($@)
my $chash = CUL_HM_getDeviceHash($hash); my $chash = CUL_HM_getDeviceHash($hash);
my $h = $culHmGlobalSets{$cmd}; my $h = $culHmGlobalSets{$cmd} if($st ne "virtual");
$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});
my @h; my @h;
@h = split(" ", $h) if($h); @h = split(" ", $h) if($h);
my $isSender = ($class eq "sender" || $md eq "HM-CC-TC"); my $isSender = ($class eq "sender");
if(!defined($h) && defined($culHmSubTypeSets{$st}{pct}) && $cmd =~ m/^\d+/) { if(!defined($h) && defined($culHmSubTypeSets{$st}{pct}) && $cmd =~ m/^\d+/) {
$cmd = "pct"; $cmd = "pct";
} }
elsif(!defined($h)) { elsif(!defined($h)) {
my @arr = keys %culHmGlobalSets; my @arr = keys %culHmGlobalSets if($st ne "virtual");
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});
my $usg = "Unknown argument $cmd, choose one of ".join(" ",sort @arr); my $usg = "Unknown argument $cmd, choose one of ".join(" ",sort @arr);
@ -1394,6 +1433,7 @@ CUL_HM_Set($@)
} }
elsif($cmd eq "getConfig") { ################################################ elsif($cmd eq "getConfig") { ################################################
CUL_HM_PushCmdStack($hash, "++A112$id$dst") if($attr{$name}{rxType} =~ m/wakeup/); # Wakeup...
CUL_HM_PushCmdStack($hash,sprintf("++A001%s%s00040000000000",$id,$dst)) CUL_HM_PushCmdStack($hash,sprintf("++A001%s%s00040000000000",$id,$dst))
if (length($dst) == 6); if (length($dst) == 6);
my $chnFound; my $chnFound;
@ -1556,11 +1596,21 @@ CUL_HM_Set($@)
sprintf("++%s11%s%s02%s000000", $headerbytes, $id,$dst,$chn)); sprintf("++%s11%s%s02%s000000", $headerbytes, $id,$dst,$chn));
} }
elsif($cmd eq "on-for-timer") { ############################################# elsif($cmd eq "on-for-timer"||$cmd eq "on-till") { ##########################
$tval = CUL_HM_encodeTime16((@a > 2)?$a[2]:0 );# onTime 0.0..85825945.6, 0=forever my (undef,undef,$duration,$edate) = @a; #date prepared extention to entdate
if ($cmd eq "on-till"){
# to be extended to handle end date as well
my ($eH,$eM,$eSec) = split(':',$duration);
$eSec += $eH*3600 + $eM*60;
my @lt = localtime;
my $ltSec = $lt[2]*3600+$lt[1]*60+$lt[0];# actually strip of date
$eSec += 3600*24 if ($ltSec > $eSec); # go for the next day
$duration = $eSec - $ltSec;
}
return "please enter the duration in seconds" if (!defined ($duration));
$tval = CUL_HM_encodeTime16($duration);# onTime 0.0..85825945.6, 0=forever
CUL_HM_PushCmdStack($hash, CUL_HM_PushCmdStack($hash,
sprintf("++A011%s%s02%sC80000%s",$id,$dst,$chn,$tval)); sprintf("++A011%s%s02%sC80000%s",$id,$dst,$chn,$tval));
} }
elsif($cmd eq "toggle") { ################################################### elsif($cmd eq "toggle") { ###################################################
$hash->{toggleIndex} = 1 if(!$hash->{toggleIndex}); $hash->{toggleIndex} = 1 if(!$hash->{toggleIndex});
@ -1842,7 +1892,45 @@ CUL_HM_Set($@)
elsif($cmd =~ m/alarm(.*)/) { ############################################### elsif($cmd =~ m/alarm(.*)/) { ###############################################
CUL_HM_SendCmd($hash, sprintf("++9441%s%s01%s", CUL_HM_SendCmd($hash, sprintf("++9441%s%s01%s",
$dst,$dst, $1 eq "On" ? "0BC8" : "0C01"), 1, 0); $dst,$dst, $1 eq "On" ? "0BC8" : "0C01"), 1, 0);
}
elsif($cmd eq "virtual") { ##################################################
my (undef,undef,$maxBtnNo) = @a;
return "please give a number between 1 and 255"
if ($maxBtnNo < 1 ||$maxBtnNo > 255);# arbitrary - 255 should be max
return $name." already defines as ".$attr{$name}{subType}
if ($attr{$name}{subType} && $attr{$name}{subType} ne "virtual");
$attr{$name}{subType} = "virtual";
$attr{$name}{hmClass} = "sender";
$attr{$name}{model} = "virtual_".$maxBtnNo;
my $devId = $hash->{DEF};
for (my $btn=1;$btn < $maxBtnNo;$btn++){
my $chnName = $name."_Btn".$btn;
my $chnId = $devId.sprintf("%02X",$btn);
DoTrigger("global", "UNDEFINED $chnName CUL_HM $chnId")
if (!$modules{CUL_HM}{defptr}{$chnId});
}
}
elsif($cmd eq "press") { ####################################################
my (undef,undef,$mode) = @a;
my ($srcId,$srcChn) = ($1,$2) if ($hash->{DEF} =~ m/(......)(..)/);
return "invalid channel:".$srcId.$srcChn if (!$srcChn);
my $rcvId = "000000"; #may have to change
my $btn = sprintf("%02X",$srcChn+(($mode && $mode eq "long")?64:0));
my $pressCnt = (!$hash->{helper}{count})?1:$hash->{helper}{count}+1;
$pressCnt %= 256;
my @peerList;
foreach my $peer (sort(split(',',$attr{$name}{peerList}))) {
$peer =~ s/ .*//;
push (@peerList,substr(CUL_HM_Name2Id($peer),0,6));
}
my $oldPeer; # only once to device, not channel!
foreach my $peer (sort @peerList){
next if ($oldPeer eq $peer);
CUL_HM_SendCmd($hash, sprintf("++8440%s%s%s%s%02X",
$srcId,$peer,$srcChn,$btn,$pressCnt),1,0);
$oldPeer = $peer;
}
$hash->{helper}{count}=$pressCnt;
} }
elsif($cmd eq "devicepair") { ############################################### elsif($cmd eq "devicepair") { ###############################################
#devicepair => "<btnNumber> device ... [single|dual] [set|unset] [actor|remote|both]" #devicepair => "<btnNumber> device ... [single|dual] [set|unset] [actor|remote|both]"
@ -1867,17 +1955,18 @@ CUL_HM_Set($@)
if ($single){ if ($single){
$b2 = $b1; $b2 = $b1;
$nrCh2Pair = 1; $nrCh2Pair = 1;
}else{ }
else{
$b2 = $b1 + 1; $b2 = $b1 + 1;
$nrCh2Pair = 2; $nrCh2Pair = 2;
} }
my $cmd = ($set)?"01":"02";# do we set or remove? my $cmd = ($set)?"01":"02";# do we set or remove?
my $peerDst = $peerHash->{DEF}; my $peerDst = $peerHash->{DEF};
my $peerChn = "01"; my $peerChn = "01";
if(length($peerDst) == 8) { # shadow switch device for multi-channel switch if(length($peerDst) == 8) { # shadow switch device for multi-channel switch
$peerChn = substr($peerDst, 6, 2); ($peerDst,$peerChn) = ($1,$2) if($peerDst =~ m/(......)(..)/);
$peerDst = substr($peerDst, 0, 6);
$peerHash = $modules{CUL_HM}{defptr}{$peerDst}; $peerHash = $modules{CUL_HM}{defptr}{$peerDst};
} }
@ -1886,24 +1975,42 @@ CUL_HM_Set($@)
for(my $i = 1; $i <= $nrCh2Pair; $i++) { for(my $i = 1; $i <= $nrCh2Pair; $i++) {
my $b = ($i==1 ? $b1 : $b2); my $b = ($i==1 ? $b1 : $b2);
my $devhash = CUL_HM_getDeviceHash($hash);
my $devName = $devhash->{NAME};
if ($attr{$devName}{subType} eq "virtual"){
my $btnName = CUL_HM_id2Name($dst.sprintf("%02X",$b));
return "button ".$b." not defined for virtual remote ".$name
if (!defined $attr{$btnName});
my $peerlist = $attr{$btnName}{peerList};
$peerlist = "" if (!$peerlist);
my $repl = CUL_HM_id2Name($peerDst.$peerChn).",";
$peerlist =~ s/$repl//;#avoid duplicate
$peerlist.= $repl if($set == 1);
$attr{$btnName}{peerList} = $peerlist;
}
else{
my $bStr = sprintf("%02X",$b);
CUL_HM_PushCmdStack($hash, CUL_HM_PushCmdStack($hash,
"++A001${id}${dst}${b}$cmd${peerDst}${peerChn}00"); "++A001${id}${dst}${bStr}$cmd${peerDst}${peerChn}00");
CUL_HM_pushConfig($hash,$id, $dst,hex($b), CUL_HM_pushConfig($hash,$id, $dst,$b,
$peerDst,hex($peerChn),4,"0100"); $peerDst,hex($peerChn),4,"0100");
} }
}
} }
if (!$target || $target eq "actor" || $target eq "both"){ if (!$target || $target eq "actor" || $target eq "both"){
CUL_HM_PushCmdStack($peerHash, sprintf("++A001%s%s%s%s%s%02X%02X", CUL_HM_PushCmdStack($peerHash, sprintf("++A001%s%s%s%s%s%02X%02X",
$id,$peerDst,$peerChn,$cmd,$dst,$b2,$b1 )); $id,$peerDst,$peerChn,$cmd,$dst,$b2,$b1 ));
} }
$chash = $peerHash; # Exchange the hash, as the switch is always alive. $chash = $peerHash; # Exchange the hash, as the switch is always alive.
$isSender=0; # the other device is a switch. ahem.
} }
$hash->{STATE} = $state if($state); #todo: this is not the device state $hash->{STATE} = $state if($state); #todo: this is not the device state
Log GetLogLevel($name,2), "CUL_HM set $name " . join(" ", @a[1..$#a]); Log GetLogLevel($name,2), "CUL_HM set $name " . join(" ", @a[1..$#a]);
CUL_HM_ProcessCmdStack($chash) if(!$isSender); CUL_HM_ProcessCmdStack($chash)
if(!$attr{$chash->{NAME}}{rxType}||
$attr{$chash->{NAME}}{rxType}=~ m/burst/);
return ""; return "";
} }
@ -1924,6 +2031,16 @@ CUL_HM_infoUpdtDevData($$$){
sprintf("%d.%d", hex(substr($p,0,1)),hex(substr($p,1,1))); sprintf("%d.%d", hex(substr($p,0,1)),hex(substr($p,1,1)));
$attr{$name}{devInfo} = $devInfo; $attr{$name}{devInfo} = $devInfo;
delete $attr{$name}{rxType};
if ($culHmModel{$mId}{rxt}){
foreach my $rxt (split(':',$culHmModel{$mId}{rxt})){
$attr{$name}{rxType} .= "config," if ($rxt eq "c");
$attr{$name}{rxType} .= "wakeup," if ($rxt eq "w");
$attr{$name}{rxType} .= "burst," if ($rxt eq "b");
}
}
#set rxType
# autocreate undefined channels # autocreate undefined channels
my @chanTypesList = split(',',$culHmModel{$mId}{chn}); my @chanTypesList = split(',',$culHmModel{$mId}{chn});
foreach my $chantype (@chanTypesList){ foreach my $chantype (@chanTypesList){
@ -2010,7 +2127,6 @@ CUL_HM_SendCmd($$$$)
$mn = hex($mn); $mn = hex($mn);
} }
$io->{HM_CMDNR} = $mn; $io->{HM_CMDNR} = $mn;
$cmd = sprintf("As%02X%02X%s", length($cmd2)/2+1, $mn, $cmd2); $cmd = sprintf("As%02X%02X%s", length($cmd2)/2+1, $mn, $cmd2);
IOWrite($hash, "", $cmd); IOWrite($hash, "", $cmd);
@ -2159,8 +2275,7 @@ CUL_HM_PushCmdStack($$)
$hash->{cmdStack} = \@arr if(!$hash->{cmdStack}); $hash->{cmdStack} = \@arr if(!$hash->{cmdStack});
push(@{$hash->{cmdStack}}, $cmd); push(@{$hash->{cmdStack}}, $cmd);
my $entries = scalar @{$hash->{cmdStack}}; my $entries = scalar @{$hash->{cmdStack}};
$attr{$hash->{NAME}}{protCmdPend} = $entries ." CMDs pending. Please activate learning" $attr{$hash->{NAME}}{protCmdPend} = $entries." CMDs pending";
if("sender" eq $attr{$hash->{NAME}}{hmClass});
} }
################################### ###################################
@ -2174,7 +2289,7 @@ CUL_HM_ProcessCmdStack($)
if(@{$hash->{cmdStack}}) { if(@{$hash->{cmdStack}}) {
CUL_HM_SendCmd($hash, shift @{$hash->{cmdStack}}, 1, 1); CUL_HM_SendCmd($hash, shift @{$hash->{cmdStack}}, 1, 1);
$sent = 1; $sent = 1;
$attr{$hash->{NAME}}{protCmdPend} = scalar @{$hash->{cmdStack}} ."CMDs pending"; $attr{$hash->{NAME}}{protCmdPend} = scalar @{$hash->{cmdStack}} ." CMDs pending";
CUL_HM_eventP($hash,"Snd"); CUL_HM_eventP($hash,"Snd");
} }
if(!@{$hash->{cmdStack}}) { if(!@{$hash->{cmdStack}}) {
@ -2456,8 +2571,7 @@ CUL_HM_parseCommon(@){
$shash->{helper}{respWait}{Pending}:""; $shash->{helper}{respWait}{Pending}:"";
if ($msgType eq "02"){# Ack/Nack ####################################### if ($msgType eq "02"){# Ack/Nack #######################################
if ($shash->{helper}{respWait}{msgId} && if ($shash->{helper}{respWait}{msgId} &&
$shash->{helper}{respWait}{msgId} eq $msgId ){#&& $shash->{helper}{respWait}{msgId} eq $msgId ){
# $pendType eq "Ack" ){
#ack we waited for - stop Waiting #ack we waited for - stop Waiting
CUL_HM_respPendRm($shash); CUL_HM_respPendRm($shash);
} }
@ -2480,12 +2594,9 @@ CUL_HM_parseCommon(@){
delete($attr{$shash->{NAME}}{protCmdPend}); delete($attr{$shash->{NAME}}{protCmdPend});
CUL_HM_respPendRm($shash); CUL_HM_respPendRm($shash);
$reply = "NACK"; $reply = "NACK";
}else{ #ACK
if ($subType eq "01"){ #AckStatus
$reply = "ACKStatus"; # will be passed on to module
}else{
$reply = "ACK";
} }
else{ #ACK
$reply = ($subType eq "01")?"ACKStatus":"ACK";
$success = "yes"; $success = "yes";
} }
$chnhash->{READINGS}{CommandAccepted}{TIME} = TimeNow(); $chnhash->{READINGS}{CommandAccepted}{TIME} = TimeNow();
@ -2606,6 +2717,10 @@ CUL_HM_parseCommon(@){
return "powerOn" if ($chn eq "00");# check dst eq "000000" as well? return "powerOn" if ($chn eq "00");# check dst eq "000000" as well?
} }
} }
elsif($msgType eq "70"){ #wakeup #######################################
CUL_HM_ProcessCmdStack($shash)
if ($attr{$shash->{NAME}}{rxType} =~ m/wakeup/);
}
return ""; return "";
} }

View File

@ -3383,6 +3383,18 @@ A line ending with \ will be concatenated with the next one, so long lines
</li> </li>
<li><B>unpair</B><a name="CUL_HMunpair"></a><br> <li><B>unpair</B><a name="CUL_HMunpair"></a><br>
"Unpair" the device, i.e. make it available to pair with other master devices. See <a href="#CUL_HMpair">pair</a> for description.</li> "Unpair" the device, i.e. make it available to pair with other master devices. See <a href="#CUL_HMpair">pair</a> for description.</li>
<li><B>virtual &lt;number of buttons&gt;</B><a name="CUL_HMvirtual"></a><br>
configures a defined curcuit as virtual remote controll. Then number of button being added is 1 to 255. If the command is issued a second time for the same entity additional buttons will be added. <br>
Example for usage:
<ul><code>
define vRemote CUL_HM 100000 # the selected HMid must not be in use<br>
set vRemote virtual 20 # define 20 button remote controll<br>
set vRemote_Btn4 devicepair 0 &lt;actorchannel&gt; # pairs Button 4 and 5 to the given channel<br>
set vRemote_Btn4 press<br>
set vRemote_Btn5 press long<br>
</code></ul>
see also <a href="#CUL_HMpress">press</a></li>
</ul> </ul>
<br> <br>
subType (i.e family) dependent commands: subType (i.e family) dependent commands:
@ -3392,8 +3404,11 @@ A line ending with \ will be concatenated with the next one, so long lines
<ul> <ul>
<li><B>on</B> - set the switch on</li> <li><B>on</B> - set the switch on</li>
<li><B>off</B> - set the switch off</li> <li><B>off</B> - set the switch off</li>
<li><B>on-for-timer sec</B> - set the switch on for the given seconds. Note: <li><B>on-for-timer &lt;sec&gt;</B><a name="CUL_HMonForTimer"></a> - set the switch on for the given seconds [0-85825945].<br>
the protocol does not support an off-for-timer like FS20.</li> Note: off-for-timer like FS20 is not supported. It needs to be programmed on link level.</li>
<li><B>on-till &lt;time&gt;</B><a name="CUL_HMonTill"></a> - set the switch on for the given end time.<br>
<ul><code>set &lt;name&gt; on-till 20:32:10<br></code></ul>
Currently a max of 24h is supported with endtime.<br></li>
<li><B>toggle</B> - toggle the switch.</li> <li><B>toggle</B> - toggle the switch.</li>
</ul> </ul>
<br></li> <br></li>
@ -3402,17 +3417,16 @@ A line ending with \ will be concatenated with the next one, so long lines
<li><B>0 - 100 [on-time] [ramp-time]</B><br> <li><B>0 - 100 [on-time] [ramp-time]</B><br>
set the actuator to the given value (in percent) set the actuator to the given value (in percent)
with a resolution of 0.5.<br> with a resolution of 0.5.<br>
Optional for dimmer you can give on-time and ramp time, both in seconds with 0.1s granularity.<br> Optional for dimmer on-time and ramp time can be choosen, both in seconds with 0.1s granularity.<br>
On-time is analog "on-for-timer", 0 means infinite.<br> On-time is analog "on-for-timer".<br>
Ramp-time default is 2.5s, 0 means instantanous<br> Ramp-time default is 2.5s, 0 means instantanous<br>
</li> </li>
<li><B>on / off</B><br> <li><B>on</B> set level to 100%<br>
this corresponds to 100 or 0 %. <li><B>off</B> set level to 0%<br></li>
</li>
<li><B>toggle</B> - toggle between off and the last on-value <li><B>toggle</B> - toggle between off and the last on-value
</li> </li>
<li><B>on-for-timer sec</B> - Dimmer only. Set on for given seconds. <li><B><a href="#CUL_HMonForTimer">on-for-timer &lt;sec&gt;</a></B> - Dimmer only! <br>
Redundant with 0-100 and on/off for compatability purposes</li> <li><B><a href="#CUL_HMonForTimer">on-till &lt;time&gt;</a></B> - Dimmer only! <br>
<li><B>stop</B> - stop motion or dim ramp</li> <li><B>stop</B> - stop motion or dim ramp</li>
</ul> </ul>
<br></li> <br></li>
@ -3454,6 +3468,13 @@ A line ending with \ will be concatenated with the next one, so long lines
</li> </li>
</ul> </ul>
<br></li> <br></li>
<li>virtual<a name="CUL_HMvirtual"></a><br>
<ul>
<li><B><a href="#CUL_HMdevicepair">devicepair</a></B> see remote</li>
<li><B>press [long|short]<a name="CUL_HMpress"></a></B>
simulates a button press short (default) or long. Note that the current implementation will not specify the duration for long. Only one trigger will be sent of type "long".
</ul>
</li>
<li>smokeDetector<br> <li>smokeDetector<br>
Note: All these commands work right now only if you have more then one Note: All these commands work right now only if you have more then one
smoekDetector, and you paired them to form a group. For issuing the smoekDetector, and you paired them to form a group. For issuing the
@ -3509,15 +3530,17 @@ A line ending with \ will be concatenated with the next one, so long lines
<ul> <ul>
<li><B>led [off|red|green|yellow]</B><br> <li><B>led [off|red|green|yellow]</B><br>
switches the LED of the channel to the color. If the command is executed on a device it will set all LEDs to the specified color<br></li> switches the LED of the channel to the color. If the command is executed on a device it will set all LEDs to the specified color<br></li>
<li><B>ilum [0-15] [0-127]</B><br> <li><B>ilum &lt;brightness&gt;&lt;duration&gt; </B><br>
set the backlight ilumination of the device to a level between 0 and 15 an on-duration to up to 127 sec<br></li> &lt;brightness&gt; [0-15] of backlight.<br>
&lt;duration&gt; [0-127] in sec. 0 is permanent 'on'.<br>
</li>
</ul><br></li> </ul><br></li>
<li>OutputUnit (HM-OU-CFM-PL) <li>OutputUnit (HM-OU-CFM-PL)
<ul> <ul>
<li><B>led &lt;color&gt;[,&lt;color&gt;..]</B><br> <li><B>led &lt;color&gt;[,&lt;color&gt;..]</B><br>
Possible colors are [redL|greenL|yellowL|redS|greenS|yellowS]. A sequence of colors can be given separating the color entries by ','. White spaces must not be used in the list. 'S' indicates short and 'L' long ilumination. <br></li> Possible colors are [redL|greenL|yellowL|redS|greenS|yellowS]. A sequence of colors can be given separating the color entries by ','. White spaces must not be used in the list. 'S' indicates short and 'L' long ilumination. <br></li>
<li><B>playTone &lt;MP3No&gt[,&lt;MP3No&gt..]</B><br> <li><B>playTone &lt;MP3No&gt[,&lt;MP3No&gt..]</B><br>
Play a series of tones. List is to be entered separated by ','. White spaces must not be used in the list. <br></li> Play a series of tones. List is to be entered separated by ','. White spaces must not be used in the list.<br></li>
</ul><br></li> </ul><br></li>
<li>HM-RC-19xxx <li>HM-RC-19xxx
<ul> <ul>
@ -3548,7 +3571,6 @@ A line ending with \ will be concatenated with the next one, so long lines
set FB1 display 12345 comma Watt 2 fast scene,phone,bell,clock </ul></code> set FB1 display 12345 comma Watt 2 fast scene,phone,bell,clock </ul></code>
</li> </li>
</ul></li> </ul></li>
</ul> </ul>
<br> <br>
@ -9493,6 +9515,7 @@ KlikAanKlikUit, NEXA, CHACON, HomeEasy UK. <br> You need to define an RFXtrx433
<b>Get</b> <b>Get</b>
<ul> <ul>
<li>icon &lt;logical icon&gt;<br> <li>icon &lt;logical icon&gt;<br>
returns the absolute path to the logical icon. Example: returns the absolute path to the logical icon. Example:
<ul> <ul>
<code>get myFHEMWEB icon FS20.on<br> <code>get myFHEMWEB icon FS20.on<br>
@ -9505,7 +9528,6 @@ KlikAanKlikUit, NEXA, CHACON, HomeEasy UK. <br> You need to define an RFXtrx433
</ul> </ul>
<a name="FHEMWEBattr"></a> <a name="FHEMWEBattr"></a>
<b>Attributes</b> <b>Attributes</b>
<ul> <ul>