diff --git a/bundles/org.openhab.binding.lcn/README.md b/bundles/org.openhab.binding.lcn/README.md index 26e6beb629c31..a0fe59c6cec66 100644 --- a/bundles/org.openhab.binding.lcn/README.md +++ b/bundles/org.openhab.binding.lcn/README.md @@ -244,6 +244,7 @@ If a special command is needed, the [Hit Key](#hit-key) action (German: "Sende T | Send Keys | Sende Tasten | N/A | N/A | N/A | Action: "hitKey": Hits a key of a key table in an LCN module. Can be used to execute commands, not supported by this binding. | | Dimmer Output Control Multiple | Mehrere Ausgänge steuern | output | 1-4 | Dimmer, Switch | Control multiple outputs simultaneously. See below. | | Transponder | Transponder | code#transponder | | Trigger | Receive transponder messages | +| Fingerprint | Fingerprint | code#fingerprint | | Trigger | Receive fingerprint code messages | | Remote Control | Fernbedienung | code#remotecontrolkey | | Trigger | Receive commands from remote control | | Access Control | Zutrittskontrolle | code#remotecontrolcode | | Trigger | Receive serial numbers from remote control | | Remote Control Battery Low | Fernbedienung Batterie schwach | code#remotecontrolbatterylow | | Trigger | Triggered when the sending remote control has a low battery | @@ -282,9 +283,9 @@ The Rollershutter Channels provide the boolean parameter `invertUpDown`, which c The Binarysensor Channels provide the boolean parameter `invertState`, which can be set to 'true' if the binary sensor connected uses reverse logic for signaling open/closed. -### Transponder +### Transponder/Fingerprints -LCN transponder readers can be integrated in openHAB e.g. for access control. +LCN transponder readers or fingerprint readers can be integrated in openHAB e.g. for access control. The transponder function must be enabled in the module's I-port properties within *LCN-PRO*. Example: When the transponder card with the ID "12ABCD" is seen by the reader connected to LCN module "S000M011", the item "M10_Relay7" is switched on: @@ -298,6 +299,17 @@ then end ``` +Example: When fingerprint with ID "AFFE12" is seen by reader connected to LCN module "S000M011", the item "M10_Relay7" is switched on: + +``` +rule "My Fingerprint" +when + Channel "lcn:module:b827ebfea4bb:S000M011:code#fingerprint" triggered "AFFE12" +then + M10_Relay7.sendCommand(ON) +end +``` + ### Remote Control To evaluate commands from LCN remote controls (e.g. LCN-RT or LCN-RT16), the module's I-port behavior must be configured as "IR access control" within *LCN-PRO*: diff --git a/bundles/org.openhab.binding.lcn/src/main/java/org/openhab/binding/lcn/internal/subhandler/LcnModuleCodeSubHandler.java b/bundles/org.openhab.binding.lcn/src/main/java/org/openhab/binding/lcn/internal/subhandler/LcnModuleCodeSubHandler.java index 69a9102013a56..cbb80a505b01d 100644 --- a/bundles/org.openhab.binding.lcn/src/main/java/org/openhab/binding/lcn/internal/subhandler/LcnModuleCodeSubHandler.java +++ b/bundles/org.openhab.binding.lcn/src/main/java/org/openhab/binding/lcn/internal/subhandler/LcnModuleCodeSubHandler.java @@ -33,6 +33,8 @@ public class LcnModuleCodeSubHandler extends AbstractLcnModuleSubHandler { private static final Pattern TRANSPONDER_PATTERN = Pattern .compile(LcnBindingConstants.ADDRESS_REGEX + "\\.ZT(?\\d{3})(?\\d{3})(?\\d{3})"); + private static final Pattern FINGERPRINT_PATTERN = Pattern.compile(LcnBindingConstants.ADDRESS_REGEX + + "\\.ZF(?[0-9A-Fa-f]{2})(?[0-9A-Fa-f]{2})(?[0-9A-Fa-f]{2})"); private static final Pattern REMOTE_CONTROL_PATTERN = Pattern.compile(LcnBindingConstants.ADDRESS_REGEX + "\\.ZI(?\\d{3})(?\\d{3})(?\\d{3})(?\\d{3})(?\\d{3})"); @@ -47,11 +49,20 @@ public void handleRefresh(LcnChannelGroup channelGroup, int number) { @Override public void handleStatusMessage(Matcher matcher) { - String code = String.format("%02X%02X%02X", Integer.parseInt(matcher.group("byte0")), - Integer.parseInt(matcher.group("byte1")), Integer.parseInt(matcher.group("byte2"))); + String code; + + if (matcher.pattern() == FINGERPRINT_PATTERN) { + code = String.format("%02X%02X%02X", Integer.parseInt(matcher.group("byte0"), 16), + Integer.parseInt(matcher.group("byte1"), 16), Integer.parseInt(matcher.group("byte2"), 16)); + } else { + code = String.format("%02X%02X%02X", Integer.parseInt(matcher.group("byte0")), + Integer.parseInt(matcher.group("byte1")), Integer.parseInt(matcher.group("byte2"))); + } if (matcher.pattern() == TRANSPONDER_PATTERN) { handler.triggerChannel(LcnChannelGroup.CODE, "transponder", code); + } else if (matcher.pattern() == FINGERPRINT_PATTERN) { + handler.triggerChannel(LcnChannelGroup.CODE, "fingerprint", code); } else if (matcher.pattern() == REMOTE_CONTROL_PATTERN) { int keyNumber = Integer.parseInt(matcher.group("key")); String keyLayer; @@ -103,6 +114,6 @@ public void handleStatusMessage(Matcher matcher) { @Override public Collection getPckStatusMessagePatterns() { - return Arrays.asList(TRANSPONDER_PATTERN, REMOTE_CONTROL_PATTERN); + return Arrays.asList(TRANSPONDER_PATTERN, FINGERPRINT_PATTERN, REMOTE_CONTROL_PATTERN); } } diff --git a/bundles/org.openhab.binding.lcn/src/main/resources/ESH-INF/i18n/lcn_de.properties b/bundles/org.openhab.binding.lcn/src/main/resources/ESH-INF/i18n/lcn_de.properties index 29ca7960c205e..17b1f505b52e9 100644 --- a/bundles/org.openhab.binding.lcn/src/main/resources/ESH-INF/i18n/lcn_de.properties +++ b/bundles/org.openhab.binding.lcn/src/main/resources/ESH-INF/i18n/lcn_de.properties @@ -166,6 +166,7 @@ channel-group-type.lcn.keyslocktabled.channel.7.label = D7 Sperre channel-group-type.lcn.keyslocktabled.channel.8.label = D8 Sperre channel-group-type.lcn.codes.label = Transponder & Fernbedienungen channel-group-type.lcn.codes.channel.transponder.label = Transponder-Code +channel-group-type.lcn.codes.channel.fingerprint.label = Fingerprint-Code channel-group-type.lcn.codes.channel.remotecontrolkey.label = Fernbedienung Tasten channel-group-type.lcn.codes.channel.remotecontrolcode.label = Fernbedienung Tasten mit Zutrittscode channel-group-type.lcn.codes.channel.remotecontrolbatterylow.label = Fernbedienung Batterie leer diff --git a/bundles/org.openhab.binding.lcn/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.lcn/src/main/resources/ESH-INF/thing/thing-types.xml index cff2bff8712e0..5e3c2691fb327 100644 --- a/bundles/org.openhab.binding.lcn/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.lcn/src/main/resources/ESH-INF/thing/thing-types.xml @@ -622,6 +622,7 @@ + @@ -634,6 +635,12 @@ + + trigger + + + + trigger