From 0dd90e81be8aec9fb57b4f6435f9aad3bff049ab Mon Sep 17 00:00:00 2001 From: klaus-schauer Date: Sat, 29 Mar 2014 20:54:29 +0000 Subject: [PATCH] 00_TCM: commandref: further explanations added git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@5367 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/00_TCM.pm | 59 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/fhem/FHEM/00_TCM.pm b/fhem/FHEM/00_TCM.pm index d9b43755f..7f7753d50 100755 --- a/fhem/FHEM/00_TCM.pm +++ b/fhem/FHEM/00_TCM.pm @@ -59,7 +59,8 @@ TCM_Initialize($) $hash->{UndefFn} = "TCM_Undef"; $hash->{GetFn} = "TCM_Get"; $hash->{SetFn} = "TCM_Set"; - $hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 blockSenderID:own,no"; + $hash->{AttrFn} = "TCM_Attr"; + $hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 blockSenderID:own,no teachMode:always,demand,nearfield"; } # Define @@ -798,6 +799,30 @@ TCM_ReadAnswer($$) } } +sub +TCM_Attr(@) { + my ($cmd, $name, $attrName, $attrVal) = @_; + my $hash = $defs{$name}; + + if ($attrName eq "blockSenderID") { + if (!defined $attrVal) { + } elsif ($attrVal !~ m/^(own|no)$/) { + Log3 $name, 3, "EnOcean $name attribute-value [$attrName] = $attrVal wrong"; + CommandDeleteAttr(undef, "$name $attrName"); + } + + } elsif ($attrName eq "teachMode") { + if (!defined $attrVal){ + + } elsif ($attrVal !~ m/^(always|demand|nearfield)$/) { + Log3 $name, 3, "EnOcean $name attribute-value [$attrName] = $attrVal wrong"; + CommandDeleteAttr(undef, "$name $attrName"); + } + + } + return undef; +} + # Undef sub TCM_Undef($$) @@ -874,11 +899,12 @@ TCM_Undef($$) to specify the baudrate: the TCM120 should be opened with 9600 Baud, the TCM310 with 57600 baud. For Eltako FGW14 devices, type has to be set to 120 and the baudrate has to be set to 57600 baud if the FGW14 operating mode - rotary switch is on position 6.
+ rotary switch is on position 6.

+ Example: @@ -896,11 +922,11 @@ TCM_Undef($$) Deactivates TCM modem functionality
  • modem_on [0000 ... FFFF]
    Activates TCM modem functionality and sets the modem ID
  • -
  • teach <t/s> or pairForSec <t/s>
    - Set Fhem in teach-in mode.
    - The command is required for UTE and to teach-in bidirectional actuators +
  • teach <t/s>
    + Set Fhem in learning mode, see teachMode.
    + The command is always required for UTE and to teach-in bidirectional actuators e. g. EEP 4BS (RORG A5-20-XX), - see Bidirectional Teach-In / Teach-Out.
  • + see Teach-In / Teach-Out.
  • reset
    Reset the device
  • sensitivity [00|01]
    @@ -922,11 +948,11 @@ TCM_Undef($$)
  • maturity [00|01]
    Waiting till end of maturity time before received radio telegrams will transmit: radio telegrams are send immediately = 00, after the maturity time is elapsed = 01
  • -
  • teach <t/s> or pairForSec <t/s>
    - Set Fhem in teach-in mode.
    - The command is required for UTE and to teach-in bidirectional actuators +
  • teach <t/s>
    + Set Fhem in learning mode, see teachMode.
    + The command is always required for UTE and to teach-in bidirectional actuators e. g. EEP 4BS (RORG A5-20-XX), - see Bidirectional Teach-In / Teach-Out.
  • + see Teach-In / Teach-Out.
  • reset
    Reset the device
  • repeater [0000|0101|0102]
    @@ -977,13 +1003,20 @@ TCM_Undef($$) Attributes