From 56ee1a1b93b13e9cf7614cd267bc24664c69b4e4 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Tue, 12 Feb 2013 12:43:56 +0000 Subject: [PATCH] # 2013-02-12 klaus.schauer # new attr switchMode: released will sent after switch if attr set to pushbutton # Eltako FSG70: only commands on|off possible, special query inserted # Eltako FTN14: switch type "Staircase off-delay timer" defined [Eltako FTN14] # commandref: further explanations added and text reorganized. git-svn-id: https://svn.fhem.de/fhem/trunk@2706 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_EnOcean.pm | 366 +++++++++++++++++++++++----------------- 1 file changed, 213 insertions(+), 153 deletions(-) diff --git a/fhem/FHEM/10_EnOcean.pm b/fhem/FHEM/10_EnOcean.pm index 124ae6dfa..467c0b566 100755 --- a/fhem/FHEM/10_EnOcean.pm +++ b/fhem/FHEM/10_EnOcean.pm @@ -1,10 +1,11 @@ ############################################## # $Id$ -# 2013-01-31 klaus.schauer -# eltakoDimmer: dimspeed corrections ($dimTime) -# Log $ll2: patch Rocker Switch logging -# attr subDef: $subDef = $hash->{DEF} if attr subDef is not defined -# Rocker Switch (PTM200): enable attr subDef +# 2013-02-12 klaus.schauer +# new attr switchMode: released will sent after switch if attr set to pushbutton +# Eltako FSG70: only commands on|off possible, special query inserted +# Eltako FTN14: switch type "Staircase off-delay timer" defined [Eltako FTN14] +# commandref: further explanations added and text reorganized. + package main; use strict; @@ -78,9 +79,13 @@ my @EnO_models = qw ( FAH60 FAH63 FIH63 FABH63 FBH63 FIBH63 PM101 + FSB12 FSB14 FSB61 FSB70 + FSG70 + FSM12 FSM61 FTF55 - FSB61 - FSM61 + FTN14 + FTS12 + FUD12 FUD14 FUD61 FUD70 ); sub @@ -96,7 +101,7 @@ EnOcean_Initialize($) "showtime:1,0 loglevel:0,1,2,3,4,5,6 ". "model:".join(",",@EnO_models)." ". "subType:".join(",",values %EnO_subType)." ". - "subDef actualTemp dimTime shutTime ". + "actualTemp dimTime shutTime subDef switchMode ". $readingFnAttributes; for(my $i=0; $i<@EnO_ptm200btn;$i++) { @@ -134,6 +139,7 @@ EnOcean_Set($@) my $updateState = 1; my $name = $hash->{NAME}; my $st = AttrVal($name, "subType", ""); + my $model = AttrVal($name, "model", ""); my $ll2 = GetLogLevel($name, 2); shift @a; @@ -172,7 +178,7 @@ EnOcean_Set($@) $hash->{READINGS}{$cmd}{VAL} = $arg; ########################### - } elsif($st eq "eltakoDimmer") { + } elsif($st eq "eltakoDimmer" && $model ne "FSG70") { my $sendDimCmd=0; my $dimTime=AttrVal($name, "dimTime", 0); @@ -313,8 +319,13 @@ EnOcean_Set($@) $db_3 |= ($d2<<1) | 0x01; } my $subDef = AttrVal($name, "subDef", "$hash->{DEF}"); + my $switchMode = AttrVal($name, "switchMode", "switch"); IOWrite($hash, "", sprintf("6B05%02X000000%s%s", $db_3, $subDef, $status)); Log $ll2, "EnOcean: set $name $cmd"; + if ($switchMode eq "pushbutton") { + IOWrite($hash, "", sprintf("6B0500000000%s20", $subDef)); + Log $ll2, "EnOcean: set $name released"; + } } select(undef, undef, undef, 0.2); # Tested by joerg. He prefers 0.3 :) @@ -393,23 +404,22 @@ EnOcean_Parse($$) } else { if($st eq "keycard") { $msg = "keycard removed"; - - } else { - $msg = (($db_3&0x10) ? "pressed" : "released"); - } - + else { + $msg = (($db_3&0x10) ? "pressed" : "released"); + } } - } # released events are disturbing when using a remote, since it overwrites # the "real" state immediately. - # In the case of an ElTako FSB61 the state should remain released (by Thomas) + # In the case of an Eltako FSB14, FSB61 the state should remain released (by Thomas) my $event = "state"; $event = "buttons" if($msg =~ m/released$/ && - $model ne "FSB61" && - $model ne "FSM61"); + $model ne "FSB14" && + $model ne "FSB61" && $model ne "FSB70" && + $model ne "FSM12" && $model ne "FSM61" && + $model ne "FTS12"); push @event, "3:$event:$msg"; @@ -491,9 +501,7 @@ EnOcean_Parse($$) } elsif($st eq "FAH" || $model =~ /^(FAH60|FAH63|FIH63)$/) { #################################### - # Eltako FAH60+FAH63+FIH63 - # (EEP: 07-06-01 plus Data_byte3) - #################################### + # Eltako FAH60, FAH63, FIH63 (EEP: 07-06-01 plus Data_byte3) # $db_3 is the illuminance where min 0x00 = 0 lx, max 0xFF = 100 lx; # $db_2 must be 0x00 @@ -512,9 +520,7 @@ EnOcean_Parse($$) } elsif($st eq "FBH" || $model =~ /^(FABH63|FBH55|FBH63|FIBH63)$/) { #################################### - # Eltako FABH63+FBH55+FBH63+FIBH63 - # (EEP: similar 07-08-01) - #################################### + # Eltako FABH63, FBH55, FBH63, FIBH63 (EEP: similar 07-08-01) # $db_0 motion detection where 0x0D = motion and 0x0F = no motion # (DB0_Bit1 = 1 or 0) @@ -535,9 +541,7 @@ EnOcean_Parse($$) } elsif($st eq "FTF" || $model eq "FTF55") { #################################### - # Eltako FTF55 - # (EEP: 07-02-05) - #################################### + # Eltako FTF55 (EEP: 07-02-05) # $db_1 is the temperature where 0x00 = 40?C and 0xFF 0?C my $temp = sprintf "%3d", $db_1; $temp = sprintf "%0.1f", ( 40 - $temp * 40 / 255 ) ; @@ -559,9 +563,7 @@ EnOcean_Parse($$) push @event, "3:D2:".(($db_0&0x4)?1:0); push @event, "3:D1:".(($db_0&0x2)?1:0); push @event, "3:D0:".(($db_0&0x1)?1:0); - } - } readingsBeginUpdate($hash); @@ -640,91 +642,130 @@ EnOcean_A5Cmd($$$) Example: +
+ Note: In order to control devices, you cannot reuse the ID's of other + devices (like remotes), instead you have to create your own, which must be + in the allowed ID-Range of the underlying IO device. For this first query the + TCM with the "get <tcm> idbase" command. You can use + up to 128 ID's starting with the base shown there. If you are using an + ID outside of the allowed range, you'll see an ERR_ID_RANGE message in the + fhem log.
+ In order to control bidirectional actors you can use the attribute + subDef.

Set - +
  • Staircase off-delay timer [Eltako FTN14] (Tested with Eltako FTN14 only.)
    + Set attr eventMap to B0:on BI:off, attr subType to switch, attr + webCmd to on:released and if needed attr switchMode to pushbutton manually.
    +
      +
    • on
      + issue switch on command
    • +
    • released
      + start timer
    • +

    + Note: Use the sensor type "Schalter" for Eltako devices. The Staircase + off-delay timer is switched on when pressing "on" and the time will be started + when pressing "released". "released" immediately after "on" is sent if + the attr switchMode is set to "pushbutton". +
  • +
    +
    + +
  • Dimmer [Eltako FUD12, FUD14, FUD61, FUD70] (Tested with Eltako devices only.)
    + Set attr subType to eltakoDimmer manually.
    +
      +
    • teach
      + initiate teach-in mode
    • +
    • on
      + issue switch on command
    • +
    • off
      + issue switch off command
    • +
    • dim percent [time 1-100]
      + issue dim command
    • +
    • dimup percent [time 1-100]
      + issue dim command
    • +
    • dimdown percent [time 1-100]
      + issue dim command
    • +
    • set extensions are supported.
    • +

    + Note: Use the sensor type "PC/FVS" for Eltako devices. +
  • +
    +
    +
  • Dimmer for fluorescent lamps [Eltako FSG70] + (Tested with Eltako FSG70 only.)
    + Set attr eventMap to B0:on BI:off, attr model to FSG70 , attr subType + to eltakoDimmer and attr switchMode to pushbutton manually.
    +
      +
    • on
      + issue switch on command
    • +
    • off
      + issue switch off command
    • +
    • set extensions are supported.

    • +

    + Note: Use the sensor type "Richtungstaster" for Eltako devices. +
  • +
    +
    +
  • Heating/Valve Regulator [MD15-FtL-HE]
    + The attr subType must be MD15. This is done if the device was created by + autocreate.
    +
      +
    • actuator <value>
      + Set the actuator to the specifed percent value (0-100)
    • +
    • desired-temp <value>
      + Use the builtin PI regulator, and set the desired temperature to the + specified degree. The actual value will be taken from the temperature + reported by the MD15 or from the attribute actualTemp if it is set
    • +
    • unattended
      + Do not regulate the MD15.
    • +

    + Note: The command is not sent until the MD15 wakes up and sends a mesage, + usually every 10 minutes. +
  • +
    +
    +
  • Shutter [Eltako FSB12, FSB14, FSB61, FSB70] (Tested with Eltako devices only.)
    + Set attr subType to eltakoShutter and attr model to FSB12|FSB14|FSB61|FSB70 + manually.
    +
      +
    • teach
      + initiate teach-in mode
    • +
    • up [percent]
      + issue roll up command
    • +
    • down [percent]
      + issue roll down command
    • +
    • stop
      + issue stop command
    • +

    + Note: Use the sensor type "Szenentaster/PC" for Eltako devices. +

  • @@ -734,36 +775,47 @@ EnOcean_A5Cmd($$$) Attributes
    Generated events: