8 Commits

Author SHA1 Message Date
Marc Hoppe
776a4e28c5 ... 2012-01-29 18:44:41 +01:00
Marc Hoppe
0c772d4224 Merge remote-tracking branch 'vdr/eo_baseid' into enocean
Conflicts:
	FHEM/10_EnOcean.pm
2012-01-29 18:37:28 +01:00
Marc Hoppe
06da7b1621 Merge branch 'master' into enocean 2012-01-29 18:17:20 +01:00
Marc Hoppe
94de56a72b Merge remote-tracking branch 'origin/master' into enocean 2012-01-07 11:01:35 +01:00
Marc Hoppe
dc8be92ede Merge remote-tracking branch 'origin/master' into enocean
Conflicts:
	FHEM/10_EnOcean.pm
2012-01-01 18:50:57 +01:00
Marc Hoppe
6778594581 Merge remote branch 'origin/master' into enocean 2011-12-27 11:34:13 +01:00
Marc Hoppe
7d9d7ca20e Enocean: new subType dimmCtrl - To send dimm-value directly to (Eltako-)Dimm-actor.
There are 2 new Commands for this subtype:
  - teach
  - dimm dimmVal [time] [on/off]
       dimmVal(%): 0-100
       time: 0-255 dimm-time, where 0:default 1:fastest 255:slowest
       on/off: on:lamp on off:lamp off

Usage:
-define an Enocean device with id from your idbase-range:
   define mydimctrl EnOcean ffabcd81
-set subtype:
   attr mydimctrl subType dimmCtrl
-set the actor to learn mode
-send the teach command:
   set mydimctrl teach
-actor back to normal-mode
-now you can control the dimmer
   set mydimctrl dimm 50 100 on

time is optional (then 0 is used)
on/off is optional (then on is used)

The commands (A5/38/08) are not 100% compliant to the EEP, I think it will only work with eltako-Dimmers
2011-12-26 19:59:00 +01:00
Marc Hoppe
4a1c808cd4 Enocean: added new subType 'dimmer'. The responses of a (Eltako-FUD61NPN)-Dimmer
are evaluated and the data is added to the events state:(on/off) and
 dimmValue:(Percent-Value)

After you defined the device (here:mydimmer) you need to set some attributes:

attr mydimmer subType dimmer
attr mydimmer eventMap B0:on BI:off
2011-12-26 12:42:02 +01:00

View File

@@ -1,5 +1,5 @@
##############################################
# $Id$
# $Id: 10_EnOcean.pm 1130 2011-12-14 07:57:59Z rudolfkoenig $
package main;
use strict;
@@ -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
my ($c1,$c2) = split(",", $cmd, 2);
@@ -180,14 +202,14 @@ EnOcean_Set($@)
my ($db_3, $status) = split(":", $ptm200btn{$c1}, 2);
$db_3 <<= 5;
$db_3 |= 0x10 if($c1 ne "released"); # set the pressed flag
if($c2) {
my ($d2, undef) = split(":", $ptm200btn{$c2}, 2);
$db_3 |= ($d2<<1) | 0x01;
}
IOWrite($hash, "",
sprintf("6B05%02X000000%s%s", $db_3, $hash->{DEF}, $status));
if($c2) {
my ($d2, undef) = split(":", $ptm200btn{$c2}, 2);
$db_3 |= ($d2<<1) | 0x01;
}
IOWrite($hash, "",
sprintf("6B05%02X000000%s%s", $db_3, $hash->{DEF}, $status));
}
}
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
# the "real" state immediately
@@ -348,7 +372,6 @@ EnOcean_Parse($$)
push @event, "3:measured-temp:". sprintf "%.1f", ($db_1*40/255);
EnOcean_MD15Cmd($hash, $name, $db_1);
} elsif($st eq "eltakoDimmer") {
# response command from (Eltako-)Actor ( Central-Command:A5/38/08 )
if($db_3 eq 0x01) { # switch