WTRFID Mini Keypad RFID/Z-Wave

Perfect. Thanks a lot!
I obviously missed the last sentence (=> shame on me).
Nevertheless I tried it (once or twice) but I gave up as I thougt that it simply could not work.
Will give it a try (including the suggested workaround) this weekend.

Thanks!

I had the same Problem, adding a rfid tag to OH

I use a Zipato Mini Keypad RFID / ZWAVE
The Keypad has the Node ID 4
=============== node4.xml =======================


ROUTING_SLAVE
ENTRY_CONTROL
NOT_USED

0xf4d909c4
4
4
0x97
0x4501
0x6131
false
: .

=============== END node4.xml ==================

i solved it in the following way

Problem 1)
######################

how to get the Code from the RFID Tag:

ZWave Binding runs in Debug Level
Try to use the Tag at te mini Keypad
returns a payload with the key from the RFID Tag

====================LOG Begin ==============================
2017-04-01 18:18:02.156 [DEBUG] [ve.internal.protocol.ZWaveController:209] - Message: class=ApplicationCommandHandler[0x04], type=Request[0x00], priority=High, dest=255, callback=0, payload=00 04 0E 6
3 03 00 00 8F C1 4A 10 3D 50 01 04 00 00
2017-04-01 18:18:02.157 [DEBUG] [ssage.ApplicationCommandMessageClass:42] - NODE 4: Application Command Request (ALIVE:DONE)
2017-04-01 18:18:02.158 [DEBUG] [alization.ZWaveNodeInitStageAdvancer:188] - NODE 4: Starting initialisation from DONE
2017-04-01 18:18:02.159 [DEBUG] [ve.internal.protocol.ZWaveController:1140] - Event Listener org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer@1847bf2 already regis
tered
2017-04-01 18:18:02.160 [DEBUG] [ssage.ApplicationCommandMessageClass:152] - NODE 4: Incoming command class USER_CODE
2017-04-01 18:18:02.161 [DEBUG] [mmandclass.ZWaveUserCodeCommandClass:99] - NODE 4: Received UserCode Request
2017-04-01 18:18:02.161 [DEBUG] [mmandclass.ZWaveUserCodeCommandClass:111] - NODE 4: USER_CODE_REPORT 0 is AVAILABLE
2017-04-01 18:18:02.164 [DEBUG] [WaveSerialHandler$ZWaveReceiveThread:302] - Receive Message = 01 08 00 04 00 04 02 84 07 76
2017-04-01 18:18:02.166 [DEBUG] [ve.internal.protocol.ZWaveController:564] - Notifying event listeners: ZWaveUserCodeValueEvent
2017-04-01 18:18:02.171 [DEBUG] [ding.zwave.handler.ZWaveThingHandler:931] - NODE 4: Got an event from Z-Wave network: ZWaveUserCodeValueEvent
2017-04-01 18:18:02.173 [DEBUG] [ding.zwave.handler.ZWaveThingHandler:940] - NODE 4: Got a value event from Z-Wave network, endpoint = 0, command class = USER_CODE, value =
====================Log End ===========================================================
This is the Log File after using the unknown RFID Tag at the key PAD

payload=00 04 0E 63 03 00 00 8F C1 4A 10 3D 50 01 04 00 00
This is the TAG ID: 8F C1 4A 10 3D 50 01 04 00 00

I checked it again and entered a KeyCode via the keybord These keys were 1 4 2 3 1 4 2 3

=======================Log Begin ======================================================
2017-04-01 16:34:26.568 [DEBUG] [ve.internal.protocol.ZWaveController] - Message: class=ApplicationCommandHandler[0x04], type=Request[0x00], priority=High, dest=255, callback=0, payload=00 04 0E 63 03
00 00 31 34 32 33 31 34 32 33 00 00
2017-04-01 16:34:26.569 [DEBUG] [ssage.ApplicationCommandMessageClass] - NODE 4: Application Command Request (ALIVE:DONE)
2017-04-01 16:34:26.569 [DEBUG] [alization.ZWaveNodeInitStageAdvancer] - NODE 4: Starting initialisation from DONE
2017-04-01 16:34:26.570 [DEBUG] [ve.internal.protocol.ZWaveController] - Event Listener org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer@12ec829 already registered
2017-04-01 16:34:26.570 [DEBUG] [ssage.ApplicationCommandMessageClass] - NODE 4: Incoming command class USER_CODE
2017-04-01 16:34:26.571 [DEBUG] [mmandclass.ZWaveUserCodeCommandClass] - NODE 4: Received UserCode Request
2017-04-01 16:34:26.571 [DEBUG] [mmandclass.ZWaveUserCodeCommandClass] - NODE 4: USER_CODE_REPORT 0 is AVAILABLE
2017-04-01 16:34:26.571 [DEBUG] [ve.internal.protocol.ZWaveController] - Notifying event listeners: ZWaveUserCodeValueEvent
=======================Log End ============================================================================

Key Payload payload=00 04 0E 63 03 00 00 31 34 32 33 31 34 32 33 00 00
TAG Payload payload=00 04 0E 63 03 00 00 8F C1 4A 10 3D 50 01 04 00 00

Problem 2)
##########################
Send the User Code to the Keypad

i patched in 2.0.0 Snapshot the the ZwaveUserCodeCommandClass

here is mey changed Method
===============Begin SNIP ====================

public SerialMessage setUserCode(int id, String code) {
boolean codeIsZeros = false;
boolean isHexCode=false;
logger.info(ā€œ############# code is ā€œ+code+ā€#############################ā€);
if (!StringUtils.isEmpty(code)) {
code=code.trim();
} else {
code=ā€œā€;
}
if (code.startsWith(ā€œ0xā€)) {
isHexCode = true;
} else {
// Zeros means delete the code
try {
codeIsZeros = Integer.parseInt(code) == 0;
} catch (NumberFormatException e) {
logger.debug(ā€œNODE {}: Error parsing user code. Code will be removedā€);
}

        if (codeIsZeros) {
            code = ""; // send no code since we will set UserIdStatusType.AVAILBLE
        }
    } // END else ((code.startsWith("x")))

    if (codeIsZeros || userCodeIsValid(code)|| isHexCode) {
        logger.debug("NODE {}: {} user code for {}", this.getNode().getNodeId(),
                codeIsZeros ? "Removing" : "Setting", id);
        SerialMessage message = new SerialMessage(this.getNode().getNodeId(), SerialMessageClass.SendData,
                SerialMessageType.Request, SerialMessageClass.SendData, SerialMessagePriority.Get);
        ByteArrayOutputStream outputData = new ByteArrayOutputStream();
        outputData.write((byte) this.getNode().getNodeId());
        outputData.write(4 + code.length());
        outputData.write((byte) getCommandClass().getKey());
        outputData.write(USER_CODE_SET);
        outputData.write(id); // identifier, must be 1 or higher
        if (codeIsZeros) {
            outputData.write(UserIdStatusType.AVAILABLE.key); // status
        } else {
            outputData.write(UserIdStatusType.OCCUPIED.key); // status
            try {
                if (isHexCode) {
                    code=code.replace("0x","");
                    int len=code.length();
                    if (! (len%2 == 0)) {
                        logger.info("code length must be a vielfaches of 2");
                        return null;
                    }
                    int countBytes=len;
                    for (int i1=0;i1< countBytes;i1=i1+2) {
                        int i3=i1+2;
                        String byteString=code.substring(i1,i3);
                        byte byteToWrite=(byte)Integer.parseInt(byteString,16);
                        outputData.write(byteToWrite);
                        logger.info("########### write "+byteString);
                    }


                } else {
                    for (Byte aCodeDigit : code.getBytes("UTF-8")) {
                        outputData.write(aCodeDigit);
                    }
                }
            } catch (UnsupportedEncodingException e) {
                logger.error("Got UnsupportedEncodingException", e);
            }
        }
        message.setMessagePayload(outputData.toByteArray());
        return message;
    }

    return null;
}

=============== END SNIP =====================

I compiled the zawave Binding and put i into my openhab / open the karaf console and update the bundle

and set the usercode with habmin for the Keypad the usercode 2

0x8FC14A103D5001040000

================================================ BEGIN LOG ====================================================
2017-04-01 18:24:58.811 [DEBUG] [ding.zwave.handler.ZWaveThingHandler:498] - NODE 4: Configuration update received
2017-04-01 18:24:58.833 [DEBUG] [ding.zwave.handler.ZWaveThingHandler:514] - NODE 4: Configuration update usercode_2 to 0x8FC14A103D5001040000
2017-04-01 18:24:58.835 [INFO ] [mmandclass.ZWaveUserCodeCommandClass:175] - ############# code is 0x8FC14A103D5001040000#############################
2017-04-01 18:24:58.836 [DEBUG] [mmandclass.ZWaveUserCodeCommandClass:248] - NODE 4: Ignoring user code 0x8FC14A103D5001040000: was 22 digits but must be between 4 and 10
2017-04-01 18:24:58.838 [DEBUG] [mmandclass.ZWaveUserCodeCommandClass:197] - NODE 4: Setting user code for 2
2017-04-01 18:24:58.839 [INFO ] [mmandclass.ZWaveUserCodeCommandClass:225] - ########### write 8F
2017-04-01 18:24:58.841 [INFO ] [mmandclass.ZWaveUserCodeCommandClass:225] - ########### write C1
2017-04-01 18:24:58.842 [INFO ] [mmandclass.ZWaveUserCodeCommandClass:225] - ########### write 4A
2017-04-01 18:24:58.843 [INFO ] [mmandclass.ZWaveUserCodeCommandClass:225] - ########### write 10
2017-04-01 18:24:58.845 [INFO ] [mmandclass.ZWaveUserCodeCommandClass:225] - ########### write 3D
2017-04-01 18:24:58.846 [INFO ] [mmandclass.ZWaveUserCodeCommandClass:225] - ########### write 50
2017-04-01 18:24:58.848 [INFO ] [mmandclass.ZWaveUserCodeCommandClass:225] - ########### write 01
2017-04-01 18:24:58.849 [INFO ] [mmandclass.ZWaveUserCodeCommandClass:225] - ########### write 04
2017-04-01 18:24:58.850 [INFO ] [mmandclass.ZWaveUserCodeCommandClass:225] - ########### write 00
2017-04-01 18:24:58.852 [INFO ] [mmandclass.ZWaveUserCodeCommandClass:225] - ########### write 00
2017-04-01 18:24:58.853 [DEBUG] [ve.internal.protocol.ZWaveController:547] - Message queued. Queue length = 1. Queue={}
2017-04-01 18:24:58.855 [DEBUG] [mmandclass.ZWaveUserCodeCommandClass:158] - NODE 4: Creating new message for application command USER_CODE_GET(2)
===================================== END LOG ==================================

Now i can use my Tag and asking the keypad for used codes returns the right HEX Code

I have marked the RFID code >>>>>>>8F C1 4A 10 3D 50 01 04 00 00<<<<<< to see it better in the Log
=============================== Begin Log ====================================

2017-04-01 18:25:50.797 [DEBUG] [ve.internal.protocol.ZWaveController:1320] - Receive queue TAKE: Length=0
2017-04-01 18:25:50.800 [DEBUG] [wave.internal.protocol.SerialMessage:255] - Assembled message buffer = 01 14 00 04 00 04 0E 63 03 02 01 >>>>>>>8F C1 4A 10 3D 50 01 04 00 00<<<<<< FA
2017-04-01 18:25:50.803 [DEBUG] [ve.internal.protocol.ZWaveController:1321] - Process Message = 01 14 00 04 00 04 0E 63 03 02 01 8F C1 4A 10 3D 50 01 04 00 00 FA
2017-04-01 18:25:50.805 [DEBUG] [ve.internal.protocol.ZWaveController:209] - Message: class=ApplicationCommandHandler[0x04], type=Request[0x00], priority=High, dest=255, callback=0, payload=00 04 0E 63 03 02 01 8F C1 4A 10 3D 50 01 04 00 00
2017-04-01 18:25:50.807 [DEBUG] [ssage.ApplicationCommandMessageClass:42] - NODE 4: Application Command Request (ALIVE:DONE)
2017-04-01 18:25:50.808 [DEBUG] [alization.ZWaveNodeInitStageAdvancer:188] - NODE 4: Starting initialisation from DONE
2017-04-01 18:25:50.809 [DEBUG] [ve.internal.protocol.ZWaveController:1140] - Event Listener org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer@1847bf2 already registered
2017-04-01 18:25:50.810 [DEBUG] [ssage.ApplicationCommandMessageClass:152] - NODE 4: Incoming command class USER_CODE
2017-04-01 18:25:50.811 [DEBUG] [mmandclass.ZWaveUserCodeCommandClass:99] - NODE 4: Received UserCode Request
2017-04-01 18:25:50.812 [DEBUG] [mmandclass.ZWaveUserCodeCommandClass:111] - NODE 4: USER_CODE_REPORT 2 is OCCUPIED
2017-04-01 18:25:50.813 [DEBUG] [mmandclass.ZWaveUserCodeCommandClass:128] - NODE 4: USER_CODE_REPORT 2 is OCCUPIED [ļæ½ļæ½J^P=P^A^D^@^@]
2017-04-01 18:25:50.814 [DEBUG] [ve.internal.protocol.ZWaveController:564] - Notifying event listeners: ZWaveUserCodeValueEvent
2017-04-01 18:25:50.815 [DEBUG] [ding.zwave.handler.ZWaveThingHandler:931] - NODE 4: Got an event from Z-Wave network: ZWaveUserCodeValueEvent
2017-04-01 18:25:50.817 [DEBUG] [ding.zwave.handler.ZWaveThingHandler:940] - NODE 4: Got a value event from Z-Wave network, endpoint = 0, command class = US

================================ END LOG =====================================

Now i can use the RFID Tag like a usercode with pressing keys on the keypad

@chris:
is it possible to show the key code in HEX and ASCII
ad to use the Hex Input (showd in my patched Version) for the next Versions

    Yes a read the Documentation, but in my opinion it is not so clear to use only 10 Ascii DIGITS
    in my case also 10 Hex Digits working to 
    
    the Zipato Documentation says 
    "After sending the User Code Set , including a Unique User Indentifier (UID) the in use State (0x01) and the TAG Code 
    or a keypad sequence using ascii codes. the mini keypad will accept the code and notify other devices using the alarm command class.  ...."
    
    
    It seems to be that only the keypad sequence is in asccii code    
    
    
    thanks in advance 

Alexander

Itā€™s a little difficult to read your mail due to the formatting changes, but your solution looks ok - maybe with a few changes it could be ok (again, itā€™s difficult to really comment in detail as itā€™s very hard to read).

Iā€™m a little hesitant as it will be non-compliant to zwave spec and Iā€™m currently moving toward a system that is auto coded directly from the spec for the command classes - Iā€™ll need to check how this fits in with this (it might still be ok).

I asked ZWave Alliance some time back, and they confirmed that these devices are non-compliant to the standard.

Please raise an issue on github with this and add your implementation suggestion - I would probably look to add this to the development branch rather than the current master. Or if you prefer, you could raise a PR against the development branch.

Would it be possible to temporarily set up a rule or a script that would program the used codes into the keypad?
For example trigger an event ā€œOn system startedā€ or other and in the event code send the commands to set the user codes?

No - the binding doesnā€™t support this non-compliant use of the protocol at the moment, so any solution would require an update to the binding.

I confess that I am outside my area of expertise, but instead of tweaking the z-wave binding maybe it could be possible to create a separate Zipato user-code binding that specifically solves this problem and the z-wave binding can remain untouched.

That would be a lot of work, but certainly do-able.

I went the FHEM route for registering RFID tags and can confirm it works as per instructions above from @DocFraggle . Did the install via apt-get on my pi rather than compile it locally as per the FHEM install instructions on their web page and had to install libcrypt-rijndael-perl as it gave errors. If you do it this way, make sure you remove the startup file at /etc/init.d/fhem.

Ill keep it around for now so that i can add other tags from time to time but it would be nice to have a method in openhab to set these, even though its not standard. Perhaps an advanced user binding or backdoor mode that allows you to set properties directly on zwave devices which pass right through without validation.

Iā€™m not completely sure what youā€™re referring to here, but the RFID readers are supported in the development version of the binding, so it should work ok. I donā€™t personally have one to test against, but it has been tested.

Ah ok, so you can set the non ASCII RFID tags using the dev version? I havenā€™t looked how to build / install the dev version but will keep that in mind.

Correct. Only the development version includes the security classes.

@chris, @DocFraggle

I just bought this tinny keypad and have a few questions about the functionalities.
Is there a way to notify the controller:

  1. with the user ID which triggered Home/Away change?
  2. if the incorrect code was entered and rejected?

For me, these functions seem basic, but from what I see now - thereā€™s only one channel for Home/Away (6/5) state communication.

Thanks

@chris, @bryzi
Hi,

Iā€™m new in openhab and Iā€™ve ordered the keypad.

I read all the posts in here but anyways Iā€™m confused now.
So please tell me, is the tag adding working with the newest version now or do I need some special dev bindings?

Thanks in advance!

3 Likes

@chris and all

I am considering to buy this keypad but honestly I could not find out from the posts in this forum or other sources, if I can register an RFID tag in the reader with openhab.

@chris, I understand that the dev version of the zwave binding should be able to do this? But your comment is from July 2017 - more than two years old. So I would assume that this functionality has in the meanwhile merged into the most recent OH version (2.4)?

I would really appreciate to get a short summary on the current status of adding RFID tags to the reader with the help of OH.

Thanks to all who can bring some light into this. :slight_smile:

I am not familiar with the RFID devices so canā€™t really comment on them specifically. However, the binding now supports security so based on the comments in this thread it should work fine with this device.

Thanks, @chris, for your fast response! Understand. Letā€™s see if I can get more clarity from the individuals using this RFID device.

@DocFraggle, @casperleenheer and @bryzi: You were discussing in 2017 how to register RFID tags to the WTRFID. You were using a workaround with FHEM.

Can you quickly let me know if this workaround (involving FHEM or any other) is still required to register RFID tags to WTRFID or if this is possible with OpenHab in the meanwhile (v2.4).

Many thanks for giving me an answer on this, since I am considering to buy the WTRFID.

Bodo

Hi Bodo,

I didnā€™t try registering new RFIDs latelyā€¦ I guess you will still have to use the workaround

Christian

1 Like

Ohā€¦ ok.
Is there potentially any easier way to register an RFID key than using FHEM?

If the device complies with the standards, then I think there should be no problem. The issue here is that the device used a non-standard system. Maybe the standards have changed now - Iā€™ve not checked - in which case it may be possible to add it to the binding.

1 Like

Ok. Thanks to you all. I have ordered WTRFID. Letā€™s see how far I come. Maybe I will use the keypad only if it gets to complicated to register a RFID tag.

@chris I fully understand and support, that you do not want to implement something which is not based on the standard. My interpretation (or my hoping :wink: of the 2017/18 discussion in this thread was, that registration is possible with the help of the at that time new security classesā€¦

Lets see how things developā€¦

Thanks, Bodo.