Zipato/Wintop keypad & RFID Tag Reader

Hello,
I am kind of a newbee with Home Assistant but I am a pretty experienced user with ZWave.
I am using zwave js and not zwave2mqtt

For the Zipato keypad I found that I could call ZWave API using this service zwave_js.invoke_cc_api
So in order to add a RFID tag, the ZWave command would be about

- command_class: 99
       method_name: set
      with 3 parameters:
        - first one with 1 for the user id / slot
        - second one with 1 to enable the RFID tag / user code on keyboard
        - third one with the raw data for the code / RFID tag: 
                 [b'49', b'52', b'52', b'49', b'0', b'0', b'0', b'0', b'0', b'0']    for "1441"  user code
or
                 [b'43', b'79', b'54', b'173', b'41', b'0', b'1', b'4', b'0', b'0']   for my RFID Tag

in ZWave API frame build in python it would be something like

            .......
            frame += COMMAND_CLASS_USER_CODE (99)
            frame += USER_CODE_SET
            frame += int(uid).to_bytes(1, "big")
            frame += int(1).to_bytes(1, "big")          # 1 activate or 0 do not activate
            for i in range(0, 10):
                frame += tag[i]                         # 10 bytes
            .......

in Home Assistant I use

- service: zwave_js.invoke_cc_api
    metadata: {}
    data:
      command_class: 99
      method_name: set
      parameters:
        - 1
        - 1
        - "1441"
    target:
      device_id: d93123d26ef067d9f8d0c8da14b249cc

This works for string like “1441”, but I can’t get it work for raw datas [b’43’, b’79’, b’54’, b’173’, b’41’, b’0’, b’1’, b’4’, b’0’, b’0’]

I tried something like

- service: zwave_js.invoke_cc_api
    metadata: {}
    data:
      command_class: 99
      method_name: set
      parameters:
        - 1
        - 1
        - [ 43, 79, 54, 173, 41, 0, 1, 4, 0, 0 ]
    target:
      device_id: d93123d26ef067d9f8d0c8da14b249cc

This does not work, it seems I cannot pass some thing if it is not a string
Do you have any solution, another way of doing it ?
Any help would be appreciated.

Have you tried the zwave_js.set_value service instead? That might be easier. You should have a userCode value ID.

What’s wrong with the string argument, BTW?

If you want to pass in a Buffer argument to this service call, you need to use a special JSON object to indicate the type. There’s actually an example of this CC method here: https://github.com/zwave-js/zwave-js-server/?tab=readme-ov-file#invoke-a-command-classes-api-method

      parameters:
        - 1
        - 1
        - type: Buffer
          data: [ 43, 79, 54, 173, 41, 0, 1, 4, 0, 0 ]
1 Like

Thanks freshcoast, it works perfectly.

So now here is how i register RFID Tag in Zipato/Wintop keypad under Home Assistant for users 3, 4 and 5.

alias: script-keypad-add-tags
description: Adding RFID tags 
sequence:
  - service: zwave_js.invoke_cc_api
    metadata: {}
    data:
      command_class: 99
      method_name: set
      parameters:
        - 3
        - 1
        - type: Buffer
          data:
            - 143
            - 68
            - 195
            - 159
            - 65
            - 0
            - 1
            - 4
            - 0
            - 0
    target:
      device_id: d93123d26ef067d9f8d0c8da14b249cc
  - service: zwave_js.invoke_cc_api
    metadata: {}
    data:
      command_class: 99
      method_name: set
      parameters:
        - 4
        - 1
        - type: Buffer
          data:
            - 143
            - 46
            - 200
            - 159
            - 65
            - 0
            - 1
            - 4
            - 0
            - 0
    target:
      device_id: d93123d26ef067d9f8d0c8da14b249cc
  - service: zwave_js.invoke_cc_api
    metadata: {}
    data:
      command_class: 99
      method_name: set
      parameters:
        - 5
        - 1
        - type: Buffer
          data:
            - 143
            - 112
            - 192
            - 159
            - 65
            - 0
            - 1
            - 4
            - 0
            - 0
    target:
      device_id: d93123d26ef067d9f8d0c8da14b249cc
mode: single
1 Like