diff --git a/fhem/FHEM/10_CUL_HM.pm b/fhem/FHEM/10_CUL_HM.pm index c88f4fad7..3b2fd7273 100755 --- a/fhem/FHEM/10_CUL_HM.pm +++ b/fhem/FHEM/10_CUL_HM.pm @@ -58,7 +58,7 @@ my %culHmDevProps=( "70" => { st => "THSensor", cl => "sender" }, # Parse,unfinished "80" => { st => "threeStateSensor",cl => "sender" }, # e.g.HM-SEC-RHS "81" => { st => "motionDetector", cl => "sender" }, - "C0" => { st => "keyMatic", cl => "sender" }, + "C0" => { st => "keyMatic", cl => "receiver" }, "C1" => { st => "winMatic", cl => "receiver" }, "CD" => { st => "smokeDetector", cl => "receiver" }, # Parse,set unfinished ); @@ -379,7 +379,7 @@ CUL_HM_Parse($$) $sendAck = ""; #todo why is this special? } - elsif($cmd =~ m/^A0[01]{2}$/ && $dst eq $id) {#### Pairing-Request-Convers. + elsif(($cmd =~ m/^A0[01]{2}$/ && $dst eq $id) && $st ne "keyMatic") {#### Pairing-Request-Convers. push @event, ""; #todo why end here? } @@ -897,6 +897,24 @@ CUL_HM_Parse($$) } } + elsif($st eq "keyMatic") { #################################### + if($msgType eq "10" && $p =~ m/^(..)(..)(..)(..)(.*)/) {#subtype+chn+value+err + my ($val, $err) = (hex($3), hex($4)); + + my $error = 'none'; + $error = 'motor aborted' if ($err & 0x04); + $error = 'clutch failure' if ($err & 0x02); # Todo: check this value + $error = 'unknown' if ($err & 0x40); # Todo: unknown error? + push @event, "error: " . $error; + + push @event, "battery: ". (($err & 0x80) ? "low" : "ok"); + push @event, "lock: " . (($val == 1) ? "unlocked" : "locked"); + + push @event, "uncertain: " . (($err & 0x30) ? "yes" : "no"); + my $state = ($err & 0x30) ? " (uncertain)" : ""; + push @event, "state: " . (($val == 1) ? "unlocked" : "locked") . $state; + } + } else{##################################### ; # no one wants the message } @@ -1091,13 +1109,13 @@ CUL_HM_fltCvT($) #float config time last if ($inValue < $fltCvT{$div}); $exp++; } - return ($exp<<5)+int($inValue/$div2); + return ($exp << 5)+int($inValue/$div2); } sub CUL_HM_CvTflt($) # config time -> float { my ($inValue) = @_; - return ($inValue & 0x1f)*((sort {$a <=> $b} keys(%fltCvT))[$inValue>>5]); + return ($inValue & 0x1f)*((sort {$a <=> $b} keys(%fltCvT))[$inValue >> 5]); } @@ -1269,6 +1287,15 @@ my %culHmSubTypeSets = ( read => "", keydef => " ", create => "" }, + + keyMatic => { + "lock"=>"", + "unlock"=>"[sec] ...", + "open"=>"[sec] ...", + "inhibit-set"=>"", + "inhibit-clear"=>"", + }, + ); my %culHmModelSets = ( "HM-CC-TC"=>{ @@ -1407,7 +1434,11 @@ CUL_HM_Set($@) CUL_HM_pushConfig($hash, $id, $dst, $chn,0,0,$chn, "08" . ($a[2] eq "on" ? "01":"02")); - } + } + elsif($cmd eq "statusRequest" && $st eq "keyMatic") { ######################## + CUL_HM_PushCmdStack($hash, sprintf("++B001%s%s010E",$id,$dst)); # LEVEL_GET + + } elsif($cmd eq "statusRequest") { ############################################ my $chnFound; foreach my $channel (keys %{$attr{$name}}){ @@ -1617,8 +1648,34 @@ CUL_HM_Set($@) $hash->{toggleIndex} = (($hash->{toggleIndex}+1) % 128); CUL_HM_PushCmdStack($hash, sprintf("++A03E%s%s%s40%s%02X", $id, $dst, $dst, $chn, $hash->{toggleIndex})); + + } + elsif($cmd eq "lock") { ################################################### + CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s800100FF",$id,$dst)); # LEVEL_SET - } + } + elsif($cmd eq "unlock") { ################################################### + $tval = (@a > 2) ? int($a[2]) : 0; + my $delay = ($tval > 0) ? CUL_HM_encodeTime8($tval) : "FF"; # RELOCK_DELAY (255=never) + CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s800101%s",$id,$dst,$delay)); # LEVEL_SET + + } + elsif($cmd eq "open") { ################################################### + $tval = (@a > 2) ? int($a[2]) : 0; + my $delay = ($tval > 0) ? CUL_HM_encodeTime8($tval) : "FF"; # RELOCK_DELAY (255=never) + CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s8001C8%s",$id,$dst,$delay)); # OPEN + + } + elsif($cmd eq "inhibit-set") { ############################################### + CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s0101",$id,$dst)); # SET_LOCK + + } + + elsif($cmd eq "inhibit-clear") { ############################################# + CUL_HM_PushCmdStack($hash, sprintf("++B011%s%s0001",$id,$dst)); # SET_LOCK + + } + elsif($cmd eq "pct") { ###################################################### $a[1] = 100 if ($a[1] > 100); $tval = CUL_HM_encodeTime16((@a > 2)?$a[2]:85825945);# onTime 0.0..85825945.6, 0=forever diff --git a/fhem/contrib/1-Wire/commandref.html b/fhem/contrib/1-Wire/commandref.html index 90e85b8f7..2f049a3c8 100755 --- a/fhem/contrib/1-Wire/commandref.html +++ b/fhem/contrib/1-Wire/commandref.html @@ -1,647 +1,660 @@ - - - - - -

OWX

-
    FHEM module to commmunicate with 1-Wire bus devices
      -
    • via an active DS2480/DS2482/DS2490/DS9097U bus master interface attached to an - USB port or
    • -
    • via a passive DS9097 interface attached to an USB port or
    • -
    • via a network-attached CUNO
    • -
    Internally these interfaces are vastly different, read the corresponding Wiki pages -
    -
    - Example
    -
      - define OWio OWX /dev/ttyUSB1 -
      -
    -
    - - Define -
      - define <name> OWX <serial-device> or
      - define <name> OWX <cuno-device> -

      Define a 1-Wire interface to communicate with a 1-Wire bus.
      -
      -
    • - <serial-device> The serial device (e.g. USB port) to which - the 1-Wire bus is attached.
    • -
    • - <cuno-device> The previously defined CUNO to which the 1-Wire - bus is attached.
    • -
    -
    - - Set -
      -
    • - set <name> interval <value> - -

      sets the time period in seconds for "kicking" the 1-Wire bus - (default is 300 seconds). This means:
        -
      • With 1-Wire bus interfaces that do not supply power to the 1-Wire bus - (attr buspower parasitic), the 1-Wire bus is reset at these intervals.
      • -
      • With 1-Wire bus interfaces that supply power to the 1-Wire bus (attr - buspower = real), all temperature measurement devices on the bus receive - the command to start a temperature conversion (saves a lot of time when - reading)
      • -
      • With 1-Wire bus interfaces that contain a busmaster chip, the response - to a reset pulse contains information about alarms.
      • -

      -
    • -
    • - set <name> followAlarms on|off - -

      instructs the module to start an alarm search in case a reset pulse - discovers any 1-Wire device which has the alarm flag set.
    • -
    -
    - - Get -
      -
    • - get <name> alarms -

      performs an "alarm search" for devices on the 1-Wire bus and, if - found, generates an event in the log (not with CUNO).
    • -
      -
    • - get <name> devices -

      redicovers all devices on the 1-Wire bus. If a device found has a - previous definition, this is automatically used. If a device is found but has no - definition, it is autocreated. If a defined device is not on the 1-Wire bus, it - is autodeleted.
    • -
      -
      -
    - - Attributes - -
- - -

OWAD

-
    FHEM module to commmunicate with 1-Wire A/D converters

    Note:
    This - 1-Wire module so far works only with the OWX interface module. Please define an OWX device first.
    -
    Example
    -
      - define OWX_AD OWAD 724610000000 45 -
      - attr OWX_AD DAlarm high -
      - attr OWX_AD DFactor 31.907097 -
      - attr OWX_AD DHigh 50.0 -
      - attr OWX_AD DName RelHumidity|humidity -
      - attr OWX_AD DOffset -0.8088 -
      - attr OWX_AD DUnit percent|% -
      -

    - - Define -
      - define <name> OWAD [<model>] <id> [<interval>] -

      Define a 1-Wire A/D converter.

      -
    • - [<model>]
      Defines the A/D converter model (and thus - 1-Wire family id), currently the following values are permitted:
        -
      • model DS2450 with family id 20 (default if the model parameter is - omitted)
      • -
      -
    • -
    • - <id> -
      12-character unique ROM id of the converter device without family id and - CRC code
    • -
    • - <interval> -
      Measurement interval in seconds. The default is 300 seconds.
    • -
      -
    -
    - - Set - -
    - - Get - -
    - - Attributes -
      -
    • attr <name> stateAL0 - <string> -
      character string for denoting low normal condition, default is green down - triangle, e.g. the code <span - style="color:green">&#x25BE;</span> leading to the sign -
    • -
    • attr <name> stateAH0 - <string> -
      character string for denoting high alarm condition, default is green - upward triangle, e.g. the code <span - style="color:green">&#x25B4;</span> leading to the sign -
    • -
    • attr <name> stateAL1 - <string> -
      character string for denoting low alarm condition, default is red down - triangle, e.g. the code <span style="color:red">&#x25BE;</span> - leading to the sign
    • -
    • attr <name> stateAH1 - <string> -
      character string for denoting high alarm condition, default is red upward - triangle, e.g. the code <span style="color:red">&#x25B4;</span> - leading to the sign -
    • -
    For each of the following attributes, the channel identification A,B,C,D may be - used. -
- - -

OWCOUNT

- - - -

OWID

-
    FHEM module for 1-Wire devices that know only their unique ROM ID
    -
    Note:
    This 1-Wire module so far works only with the OWX interface module. - Please define an OWX device first.
    -
    Example
    -
      - define ROM1 OWX_ID OWCOUNT CE780F000000 -
      -

    - - Define -
      - define <name> OWID <id> -

      Define a 1-Wire device.

      -
    • - <id> -
      12-character unique ROM id of the converter device without family id and - CRC code
    • -
    -
    - - Get - -
    -
- - -

OWLCD

- - - -

OWSWITCH

-
    FHEM module to commmunicate with 1-Wire Programmable Switches

    Note:
    - This 1-Wire module so far works only with the OWX interface module. Please define an OWX device first.
    -
    Example
    -
      - define OWX_S OWSWITCH DS2413 B5D502000000 60 -
      - attr OWX_S AName Lampe|light -
      - attr OWX_S AUnit AN|AUS -
      -
    -
    - - Define -
      - define <name> OWSWITCH [<model>] <id> - [<interval>] -

      Define a 1-Wire switch.

      -
    • - [<model>]
      Defines the switch model (and thus 1-Wire - family id), currently the following values are permitted:
        -
      • model DS2413 with family id 3A (default if the model parameter is - omitted)
      • -
      -
    • -
    • - <id> -
      12-character unique ROM id of the converter device without family id and - CRC code
    • -
    • - <interval> -
      Measurement interval in seconds. The default is 300 seconds.
    • -
    -
    - - Set - -
    - - Get - -
    - - Attributes For each of the following attributes, the channel - identification A,B may be used. -
- - -

OWTHERM

-
    FHEM module to commmunicate with 1-Wire bus digital thermometer devices

    - Note:
    This is the only 1-Wire module which so far works with both the OWFS and the - OWX interface module. Please define an OWFS device or an OWX device first.
    -
    Example
    -
      - define OWX_T OWTHERM DS18B20 E8D09B030000 300 -
      - attr OWX_T tempUnit Kelvin -
      -

    - - Define -
      - define <name> OWTHERM [<model>] <id> - [<interval>] -

      Define a 1-Wire digital thermometer device.

      -
    • - [<model>]
      Defines the thermometer model (and thus - 1-Wire family id) currently the following values are permitted:
        -
      • model DS1820 with family id 10 (default if the model parameter is - omitted)
      • -
      • model DS1822 with family id 22
      • -
      • model DS18B20 with family id 28
      • -
      -
    • -
    • - <id> -
      12-character unique ROM id of the thermometer device without family id and - CRC code
    • -
    • - <interval> -
      Temperature measurement interval in seconds. The default is 300 seconds.
    • -
      Example:
      - define Temp1 OWTHERM 14B598010800 300
      -
    -
    - - Set - -
    - - Get - -
    - - Attributes - -
+ + + + + +

OWX

+
    + FHEM module to commmunicate with 1-Wire bus devices +
      +
    • via an active DS2480/DS2482/DS2490/DS9097U bus master + interface attached to an USB port or
    • +
    • via a passive DS9097 interface attached to an USB port or
    • +
    • via a network-attached CUNO
    • +
    + Internally these interfaces are vastly different, read the + corresponding + Wiki + pages +
    +
    + Example +
    +
      + define OWio OWX /dev/ttyUSB1 +
      +
    +
    + Define +
      + define <name> OWX <serial-device> + or +
      + define <name> OWX <cuno-device> +
      +
      Define a 1-Wire interface to communicate with a 1-Wire bus. +
      +
      +
    • <serial-device> The serial device (e.g. + USB port) to which the 1-Wire bus is attached.
    • +
    • <cuno-device> The previously defined CUNO + to which the 1-Wire bus is attached.
    • +
    +
    + Set +
      +
    • set <name> + interval <value> +
      +
      sets the time period in seconds for "kicking" the 1-Wire bus + (default is 300 seconds). This means: +
        +
      • With 1-Wire bus interfaces that do not supply power to the + 1-Wire bus (attr buspower parasitic), the 1-Wire bus is reset at + these intervals.
      • +
      • With 1-Wire bus interfaces that supply power to the 1-Wire + bus (attr buspower = real), all temperature measurement devices on + the bus receive the command to start a temperature conversion + (saves a lot of time when reading)
      • +
      • With 1-Wire bus interfaces that contain a busmaster chip, + the response to a reset pulse contains information about alarms.
      • +
      +
    • +
    • set + <name> followAlarms on|off +
      +
      instructs the module to start an alarm search in case a reset + pulse discovers any 1-Wire device which has the alarm flag set.
    • +
    +
    + Get +
      +
    • get <name> + alarms
      +
      performs an "alarm search" for devices on the 1-Wire bus and, + if found, generates an event in the log (not with CUNO).
    • +
      +
    • get <name> + devices
      +
      redicovers all devices on the 1-Wire bus. If a device found + has a previous definition, this is automatically used. If a device + is found but has no definition, it is autocreated. If a defined + device is not on the 1-Wire bus, it is autodeleted.
    • +
      +
      +
    + Attributes + +
+ + +

OWAD

+
    + FHEM module to commmunicate with 1-Wire A/D converters +
    +
    Note: +
    This 1-Wire module so far works only with the OWX interface + module. Please define an + OWX device first. +
    +
    + Example +
    +
      + define OWX_AD OWAD 724610000000 45 +
      + attr OWX_AD DAlarm high +
      + attr OWX_AD DFactor 31.907097 +
      + attr OWX_AD DHigh 50.0 +
      + attr OWX_AD DName RelHumidity|humidity +
      + attr OWX_AD DOffset -0.8088 +
      + attr OWX_AD DUnit percent|% +
      +
    +
    + + Define +
      + define <name> OWAD [<model>] <id> + [<interval>] +
      +
      Define a 1-Wire A/D converter. +
      +
      +
    • [<model>]
      Defines the A/D + converter model (and thus 1-Wire family id), currently the following + values are permitted: +
        +
      • model DS2450 with family id 20 (default if the model + parameter is omitted)
      • +
    • +
    • <id>
      12-character unique ROM id of + the converter device without family id and CRC code
    • +
    • <interval>
      Measurement interval in + seconds. The default is 300 seconds.
    • +
      +
    +
    + Set + +
    + Get + +
    + Attributes +
      +
    • attr <name> + stateAL0 <string>
      character string for denoting low + normal condition, default is green down triangle, e.g. the code + <span style="color:green">&#x25BE;</span> leading to + the sign
    • +
    • attr <name> + stateAH0 <string>
      character string for denoting high + alarm condition, default is green upward triangle, e.g. the code + <span style="color:green">&#x25B4;</span> leading to + the sign
    • +
    • attr <name> + stateAL1 <string>
      character string for denoting low + alarm condition, default is red down triangle, e.g. the code + <span style="color:red">&#x25BE;</span> leading to + the sign
    • +
    • attr <name> + stateAH1 <string>
      character string for denoting high + alarm condition, default is red upward triangle, e.g. the code + <span style="color:red">&#x25B4;</span> leading to + the sign
    • +
    + For each of the following attributes, the channel identification + A,B,C,D may be used. + +
+ + +

OWCOUNT

+ + + +

OWID

+
    + FHEM module for 1-Wire devices that know only their unique ROM ID +
    +
    Note: +
    This 1-Wire module so far works only with the OWX interface + module. Please define an + OWX device first. +
    +
    + Example +
    +
      + define ROM1 OWX_ID OWCOUNT CE780F000000 +
      +
    +
    + + Define +
      + define <name> OWID <id> +
      +
      Define a 1-Wire device. +
      +
      +
    • <id>
      12-character unique ROM id of + the converter device without family id and CRC code
    • +
    +
    + Get + +
    +
+ + +

OWLCD

+ + + +

OWSWITCH

+
    + FHEM module to commmunicate with 1-Wire Programmable Switches +
    +
    Note: +
    This 1-Wire module so far works only with the OWX interface + module. Please define an + OWX device first. +
    +
    + Example +
    +
      + define OWX_S OWSWITCH DS2413 B5D502000000 60 +
      + attr OWX_S AName Lampe|light +
      + attr OWX_S AUnit AN|AUS +
      +
    +
    + + Define +
      + define <name> OWSWITCH [<model>] <id> + [<interval>] +
      +
      Define a 1-Wire switch. +
      +
      +
    • [<model>]
      Defines the switch model + (and thus 1-Wire family id), currently the following values are + permitted: +
        +
      • model DS2413 with family id 3A (default if the model + parameter is omitted)
      • +
    • +
    • <id>
      12-character unique ROM id of + the converter device without family id and CRC code
    • +
    • <interval>
      Measurement interval in + seconds. The default is 300 seconds.
    • +
    +
    + Set + +
    + Get + +
    + Attributes For each of the + following attributes, the channel identification A,B may be used. + +
+ + +

OWTHERM

+
    + FHEM module to commmunicate with 1-Wire bus digital thermometer + devices +
    +
    Note: +
    This is the only 1-Wire module which so far works with both + the OWFS and the OWX interface module. Please define an + OWFS device or an + OWX device first. +
    +
    + Example +
    +
      + define OWX_T OWTHERM DS18B20 E8D09B030000 300 +
      + attr OWX_T tempUnit Kelvin +
      +
    +
    + + Define +
      + define <name> OWTHERM [<model>] <id> + [<interval>] +
      +
      Define a 1-Wire digital thermometer device. +
      +
      +
    • [<model>]
      Defines the thermometer + model (and thus 1-Wire family id) currently the following values are + permitted: +
        +
      • model DS1820 with family id 10 (default if the model + parameter is omitted)
      • +
      • model DS1822 with family id 22
      • +
      • model DS18B20 with family id 28
      • +
    • +
    • <id>
      12-character unique ROM id of + the thermometer device without family id and CRC code
    • +
    • <interval>
      Temperature + measurement interval in seconds. The default is 300 seconds.
    • +
      Example: +
      + define Temp1 OWTHERM 14B598010800 300 +
      +
    +
    + Set + +
    + Get + +
    + Attributes + +
-
- +
+ diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html index f46154ea5..d45aac9a7 100644 --- a/fhem/docs/commandref.html +++ b/fhem/docs/commandref.html @@ -3570,6 +3570,29 @@ A line ending with \ will be concatenated with the next one, so long lines # "1234,5" in display with unit 'W'. Symbols scene,phone,bell and clock are active. Backlight flashing fast, Beep is second tone
set FB1 display 12345 comma Watt 2 fast scene,phone,bell,clock +
+
  • keyMatic

    +
      The Keymatic uses the AES signed communication. Therefore the control of the Keymatic is only together with the HM-LAN adapter possible. But the CUL can read and react on the status information of the Keymatic.

    +
      +
    • lock
      + The lock bolt moves to the locking position
    • +
    • unlock [sec]
      + The lock bolt moves to the unlocking position.
      + [sec]: Sets the delay in seconds after the lock automatically locked again.
      0 - 65535 seconds
    • +
    • open [sec]
      + Unlocked the door so that the door can be opened.
      + [sec]: Sets the delay in seconds after the lock automatically locked again.
      0 - 65535 seconds
    • +
    • inhibit-set
      + Blocked all directly paired remotes and the hardware buttons of the keyMatic. Now the door lock drive can be controlled only by FHEM.
    • +
    • inhibit-clear
      + Deletes the previously set inhibit-flag again.

      + Example: +
        + # Lock the lock
        + set keymatic lock

        + # open the door and relock the lock after 60 seconds
        + set keymatic unlock 60
      +