CUL_HM:DIS_EP update3

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@11859 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2016-07-28 19:56:38 +00:00
parent 95d3c4195b
commit 02c537c64a
2 changed files with 20 additions and 13 deletions

View File

@ -4859,6 +4859,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
} }
} }
elsif($cmd eq "displayEP" ) { ############################################### elsif($cmd eq "displayEP" ) { ###############################################
$state = "displayEP";
my %disp_icons = ( my %disp_icons = (
off => '80', on => '81', open => '82', closed => '83' off => '80', on => '81', open => '82', closed => '83'
,error => '84', ok => '85', info => '86', newmsg => '87' ,error => '84', ok => '85', info => '86', newmsg => '87'
@ -4899,7 +4900,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
."\n signal: ".join(" ",keys(%disp_signals)) ."\n signal: ".join(" ",keys(%disp_signals))
; ;
} }
my $cmd = '020A'; my $snd = '020A';
# Lines are separated by semicolon, empty lines are supported # Lines are separated by semicolon, empty lines are supported
my @disp_lines = (split (':', $msg.":::"),"","");# at least 3 entries - loop will use first 3 my @disp_lines = (split (':', $msg.":::"),"","");# at least 3 entries - loop will use first 3
my $lineNr=1; my $lineNr=1;
@ -4908,46 +4909,49 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
# Split line into text and icon part separated by comma # Split line into text and icon part separated by comma
my ($text, $icon) = split (',', $line.","); # add separator in case Icon is dismissed my ($text, $icon) = split (',', $line.","); # add separator in case Icon is dismissed
$cmd .= '12';# start text indicator $snd .= '12';# start text indicator
if (defined $line && $line ne '') { if (defined $line && $line ne '') {
# Hex code # Hex code
if ($text =~ /^0x[0-9A-F]{2}$/) { if ($text =~ /^0x[0-9A-F]{2}$/) {
$cmd .= substr($text,2,2); $snd .= substr($text,2,2);
} }
# Predefined text code text0-9 # Predefined text code text0-9
elsif ($text =~ /^text([0-9])$/) { elsif ($text =~ /^text([0-9])$/) {
$cmd .= sprintf ("8%1X", $1); $snd .= sprintf ("8%1X", $1);
} }
# Convert string to hex codes # Convert string to hex codes
else { else {
foreach my $ch (split ('', substr ($text, 0, 12))) { foreach my $ch (split ('', substr ($text, 0, 12))) {
$cmd .= sprintf ("%02X", ord ($ch)); $snd .= sprintf ("%02X", ord ($ch));
} }
} }
} }
else{ else{
$text = ReadingsVal($name,"line${lineNr}_text",""); $text = ReadingsVal($name,"line${lineNr}_text","");
$icon = ReadingsVal($name,"line${lineNr}_icon","off"); $icon = ReadingsVal($name,"line${lineNr}_icon","off");
foreach my $ch (split ('', substr ($text, 0, 12))) {
$snd .= sprintf ("%02X", ord ($ch));
}
} }
$icon = "off" if (!exists ($disp_icons{$icon}));# Icon $icon = "off" if (!exists ($disp_icons{$icon}));# Icon
$cmd .= '13'.$disp_icons{$icon}; $snd .= '13'.$disp_icons{$icon};
$cmd .= '0A'; $snd .= '0A';
CUL_HM_UpdtReadBulk($hash,0,"line${lineNr}_text:$text" CUL_HM_UpdtReadBulk($hash,0,"line${lineNr}_text:$text"
,"line${lineNr}_icon:$icon"); ,"line${lineNr}_icon:$icon");
$lineNr++; $lineNr++;
} }
$cmd .= '14'.$disp_sounds{$sound}.'1C'; # Sound $snd .= '14'.$disp_sounds{$sound}.'1C'; # Sound
$cmd .= sprintf ("%02X1D", 0xD0+$rep-1); # Repeat $snd .= sprintf ("%02X1D", 0xD0+$rep-1); # Repeat
$cmd .= sprintf ("E%01X16", int(($pause-1)/10));# Pause $snd .= sprintf ("E%01X16", int(($pause-1)/10));# Pause
$cmd .= $disp_signals{$sig}.'03'; # Signal $snd .= $disp_signals{$sig}.'03'; # Signal
CUL_HM_UpdtReadBulk($hash,0,"signal:$sig"); CUL_HM_UpdtReadBulk($hash,0,"signal:$sig");
CUL_HM_pushEvnts(); CUL_HM_pushEvnts();
CUL_HM_PushCmdStack($hash,"++${flag}11$id${dst}80${chn}$_") foreach (unpack('(A28)*',$cmd)); CUL_HM_PushCmdStack($hash,"++${flag}11$id${dst}80${chn}$_") foreach (unpack('(A28)*',$snd));
} }
elsif($cmd =~ m/^(controlMode|controlManu|controlParty)$/) { ################ elsif($cmd =~ m/^(controlMode|controlManu|controlParty)$/) { ################
@ -7555,7 +7559,7 @@ sub CUL_HM_updtRegDisp($$$) {
elsif ($md =~ m/HM-TC-IT-WM-W-EU/){#handle temperature readings elsif ($md =~ m/HM-TC-IT-WM-W-EU/){#handle temperature readings
CUL_HM_TCITRTtempReadings($hash,$md,$list) if ($list >= 7 && $chn eq "02"); CUL_HM_TCITRTtempReadings($hash,$md,$list) if ($list >= 7 && $chn eq "02");
} }
elsif ($md =~ m/(^HM-PB-4DIS-WM|HM-Dis-WM55|HM-RC-Dis-H-x-EU|ROTO_ZEL-STG-RM-DWT-10)/){#add text elsif ($md =~ m/(^HM-PB-4DIS-WM|HM-Dis-WM55|HM-Dis-EP-WM55|HM-RC-Dis-H-x-EU|ROTO_ZEL-STG-RM-DWT-10)/){#add text
CUL_HM_4DisText($hash) if ($list == 1) ; CUL_HM_4DisText($hash) if ($list == 1) ;
} }
elsif ($st eq "repeater"){ elsif ($st eq "repeater"){

View File

@ -1289,11 +1289,14 @@ $culHmRegModel{"ROTO_ZEL-STG-RM-DWT-10"}= $culHmRegModel{"HM-PB-4DIS-WM"};
,wat1_hour =>1,wat1_min =>1, ,wat1_hour =>1,wat1_min =>1,
,wat2_hour =>1,wat2_min =>1, ,wat2_hour =>1,wat2_min =>1,
} }
,"HM-Dis-EP-WM5501" =>{ transmitTryMax =>1}
); );
#clones - - - - - - - - - - - - - - - #clones - - - - - - - - - - - - - - -
$culHmRegChan{"HM-Dis-EP-WM5502"} = $culHmRegChan{"HM-Dis-EP-WM5501"};
$culHmRegChan{"HM-Dis-EP-WM5503"} = $culHmRegChan{"HM-Dis-EP-WM5501"};
$culHmRegChan{"SensoTimer-ST-602"} = $culHmRegChan{"SensoTimer-ST-601"}; $culHmRegChan{"SensoTimer-ST-602"} = $culHmRegChan{"SensoTimer-ST-601"};
$culHmRegChan{"HM-Sen-MDIR-WM5502"} = $culHmRegChan{"HM-Sen-MDIR-WM5501"}; $culHmRegChan{"HM-Sen-MDIR-WM5502"} = $culHmRegChan{"HM-Sen-MDIR-WM5501"};