This commit is contained in:
Marc Hoppe
2012-01-29 18:41:51 +01:00
parent 0c772d4224
commit 776a4e28c5

View File

@@ -169,6 +169,28 @@ EnOcean_Set($@)
} }
###########################
} elsif($st eq "eltakoRollCtrl") {
if($cmd eq "teach") {
my $data=sprintf("A5FFF80D80%s00", $hash->{DEF});
Log $ll2, "eltakoRollCtrl.Teach: " . $data;
IOWrite($hash, "000A0001", $data); # len:000a optlen:00 pakettype:1(radio)
} else {
my %eltakoRollCtrlCommands = ( down=>0x02, up=>0x01, stop=>0x00 );
my $usage = "Usage: (" . join("|", sort keys %eltakoRollCtrlCommands) . ") [time 0-255 sek]";
my $rollcmd= $eltakoRollCtrlCommands{$cmd}
return $usage if( (!defined($rollcmd)) or (@a<1) );
my $time=0;
if(defined($a[1])) { $time=$a[1]; } # time
shift(@a);
# EEP: A5/3F/7F Universal ???
my $data=sprintf("A5%02X%02X%02X%02X%s00", 0, $time, $rollcmd, 0x08, $hash->{DEF});
IOWrite($hash, "000A0001", $data);
Log $ll2, "eltakoRollCtrl.$cmd" . $data;
}
########################### ###########################
} else { # Simulate a PTM } else { # Simulate a PTM
my ($c1,$c2) = split(",", $cmd, 2); my ($c1,$c2) = split(",", $cmd, 2);
@@ -180,14 +202,14 @@ EnOcean_Set($@)
my ($db_3, $status) = split(":", $ptm200btn{$c1}, 2); my ($db_3, $status) = split(":", $ptm200btn{$c1}, 2);
$db_3 <<= 5; $db_3 <<= 5;
$db_3 |= 0x10 if($c1 ne "released"); # set the pressed flag $db_3 |= 0x10 if($c1 ne "released"); # set the pressed flag
if($c2) { if($c2) {
my ($d2, undef) = split(":", $ptm200btn{$c2}, 2); my ($d2, undef) = split(":", $ptm200btn{$c2}, 2);
$db_3 |= ($d2<<1) | 0x01; $db_3 |= ($d2<<1) | 0x01;
} }
IOWrite($hash, "", IOWrite($hash, "",
sprintf("6B05%02X000000%s%s", $db_3, $hash->{DEF}, $status)); sprintf("6B05%02X000000%s%s", $db_3, $hash->{DEF}, $status));
} }
select(undef, undef, undef, 0.1) if($i < int(@a)-1); select(undef, undef, undef, 0.1) if($i < int(@a)-1);
} }
@@ -275,6 +297,8 @@ EnOcean_Parse($$)
} }
} }
# eltakoRoll: BI: unten / B0: oben / released:running/stopped
# released events are disturbing when using a remote, since it overwrites # released events are disturbing when using a remote, since it overwrites
# the "real" state immediately # the "real" state immediately
@@ -348,7 +372,6 @@ EnOcean_Parse($$)
push @event, "3:measured-temp:". sprintf "%.1f", ($db_1*40/255); push @event, "3:measured-temp:". sprintf "%.1f", ($db_1*40/255);
EnOcean_MD15Cmd($hash, $name, $db_1); EnOcean_MD15Cmd($hash, $name, $db_1);
} elsif($st eq "eltakoDimmer") { } elsif($st eq "eltakoDimmer") {
# response command from (Eltako-)Actor ( Central-Command:A5/38/08 ) # response command from (Eltako-)Actor ( Central-Command:A5/38/08 )
if($db_3 eq 0x01) { # switch if($db_3 eq 0x01) { # switch