From 057dd5e08e65edb07db2c49101f5629575f50fa8 Mon Sep 17 00:00:00 2001 From: klaus-schauer Date: Sat, 29 Mar 2014 20:59:20 +0000 Subject: [PATCH] 10_EnOcean: # subType actuator.01: bugfix # commandref: further explanations added git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@5368 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_EnOcean.pm | 42 +++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/fhem/FHEM/10_EnOcean.pm b/fhem/FHEM/10_EnOcean.pm index 2c6fe5b90..41b00cd54 100755 --- a/fhem/FHEM/10_EnOcean.pm +++ b/fhem/FHEM/10_EnOcean.pm @@ -356,27 +356,29 @@ EnOcean_Get ($@) my $channel = shift(@a); if (!defined $channel || $channel eq "all") { $channel = 30; - } elsif ($channel >= 0 || $channel <= 29) { - } elsif ($channel eq "input") { $channel = 31; + } elsif ($channel >= 0 && $channel <= 29) { + } else { return "$cmd wrong, choose 0...29|all|input."; } if ($cmd eq "state") { $cmdID = 3; + Log3 $name, 3, "EnOcean $name get $cmdID $channel."; $data = sprintf "%02X%02X", $cmdID, $channel; } elsif ($cmd eq "measurement") { $cmdID = 6; my $query = shift(@a); + Log3 $name, 3, "EnOcean $name get $cmdID $channel $query."; if ($query eq "energy") { $query = 0; } elsif ($query eq "power") { $query = 1; } else { - return "$cmd wrong, choose energy|power."; + return "$cmd wrong, choose 0...30|all|input energy|power."; } $data = sprintf "%02X%02X", $cmdID, $query << 5 | $channel; @@ -2114,6 +2116,8 @@ EnOcean_Parse($$) { my ($iohash, $msg) = @_; my (undef, $packetType, $rorg, $data, $id, $status, $odata) = split(":", $msg); + $odata =~ m/^(..)(........)(..)(..)$/; + my ($subTelNum, $destinationID, $RSSI, $securityLevel) = (hex($1), $2, hex($3), hex($4)); my $rorgname = $EnO_rorgname{$rorg}; if (!$rorgname) { Log3 undef, 2, "EnOcean RORG ($rorg) received from $id unknown."; @@ -2126,7 +2130,7 @@ EnOcean_Parse($$) Log3 undef, 3, "EnOcean Unknown device with ID $id and RORG $rorgname, please define it."; return "UNDEFINED EnO_${rorgname}_$id EnOcean $id $msg"; } else { - Log3 undef, 3, "EnOcean Unknown device with ID $id and RORG $rorgname, set transceiver in teach mode."; + Log3 undef, 3, "EnOcean Unknown device with ID $id and RORG $rorgname, activate learning mode."; return ""; } } else { @@ -4127,6 +4131,9 @@ EnOcean_Undef($$) attributes, the behavior of the devices can be changed separately.

+ Fhem and the EnOcean devices must be trained with each other. To this, Fhem + must be in the learning mode, see Teach-In / Teach-Out + and teach_mode.
The teach-in procedure depends on the type of the devices. Switches (EEP RPS) and contacts (EEP 1BS) are recognized when receiving the first message. Contacts can also send a teach-in telegram. Fhem not need this telegram. @@ -4138,7 +4145,7 @@ EnOcean_Undef($$) model. If the EEP profile identifier and the manufacturer ID are sent the device is clearly identifiable. Fhem automatically assigns these devices to the correct profile. Some 4BS, VLD or MSC devices must be paired - bidirectional, see Bidirectional Teach-In / Teach-Out.

+ bidirectional, see Teach-In / Teach-Out.

Fhem supports many of most common EnOcean profiles and manufacturer-specific devices. Additional profiles and devices can be added if required.

@@ -4205,19 +4212,21 @@ EnOcean_Undef($$) Set
    -
  • Bidirectional Teach-In / Teach-Out +
  • Teach-In / Teach-Out
      - set <name> teach <t/s> + set <IODev> teach <t/s>

      - Set the EnOcean Transceiver module (TCM Modul) in the pairing mode. + Set Fhem in the learning mode.
      A device, which is then also put in this state is to paired with - Fhem. Pearing is used for some 4BS, VLD and MSC devices, + Fhem. Bidirectional Teach-In / Teach-Out is used for some 4BS, VLD and MSC devices, e. g. EEP 4BS, RORG A5-20-01 (Battery Powered Actuator).
      Bidirectional 4BS Teach-In and UTE - Universal Uni- and Bidirectional Teach-In are supported.
      - name is the name of the TCM Module . t/s is the - time for the teach-in period. + IODev is the name of the TCM Module.
      + t/s is the time for the learning period. +

      + Types of learning modes see teachMode

      Example:
        set TCM_0 teach 600 @@ -4278,12 +4287,15 @@ EnOcean_Undef($$) 1BS Telegram (EEP D5-00-01)
        [tested with Eltako FSR14]
          + set <name> <value> +

          + where value is
        • closed
          issue closed command
        • open
          issue open command
        • teach
          - initiate teach-in mode
        • + initiate teach-in
        The attr subType must be contact. The attribute must be set manually.

        @@ -4355,7 +4367,8 @@ EnOcean_Undef($$)
      • 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.
      • + reported by the Battery Powered Actuator, the temperatureRefDev + or from the attribute actualTemp if it is set.
      • runInit
        Maintenance Mode (service on): Run init sequence.
      • liftSet
        @@ -4369,7 +4382,7 @@ EnOcean_Undef($$)

      The attr subType must be hvac.01. This is done if the device was created by autocreate. To control the device, it must be bidirectional paired, - see Bidirectional Teach-In / Teach-Out.
      + see Teach-In / Teach-Out.
      The command is not sent until the device wakes up and sends a mesage, usually every 10 minutes. @@ -4901,6 +4914,7 @@ EnOcean_Undef($$) Name of the device whose reference value is read. The reference values is the reading temperature. +
    • verbose
    • webCmd