Keypad Touch

May 16, 2026 ยท View on GitHub


Device List Information

KeyValue TypeDescription
deviceIdStringdevice ID
deviceNameStringdevice name
deviceTypeStringdevice type. Keypad Touch
enableCloudServiceBooleandetermines if Cloud Service is enabled or not for the current device
hubDeviceIdStringdevice's parent Hub ID
lockDeviceIdStringMAC address of the Lock that the current device is paired with
keyListObjecta list of passcodes

keyList maintains a list of passcodes,

KeyValue TypeDescription
idIntegerpasscode ID
nameStringname of the passcode
typeStringtype of the passcode. permanent, a permanent passcode. timeLimit, a temporary passcode. disposable, a one-time passcode. urgent, an emergency passcode.
passwordStringthe passcode string encrypted with the developer secret key using the aes-128-cbc algorithm
ivStringan arbitrary number used for the encryption
statusStringvalidity of the passcode. normal, the passcode is valid. expired, the passcode is invalid.
createTimeLongthe time when the passcode is generated

Device Status

KeyValue TypeDescription
deviceIdStringdevice ID
deviceTypeStringdevice type. Keypad Touch
hubDeviceIdStringdevice's parent Hub ID

Control Commands

The control commands for this product work differently than the other products. Due to security concerns, the passcodes are stored locally. This mechanism dramatically prolongs the time needed to successfully create a passcode and get the correct result through the Web API. Hence, the actual results of the following commands are returned from the SwitchBot server asynchronously and are delivered through a webhook.

You need to configure a webhook to receive the correct result. Refer to this product's webhook definition.

deviceTypecommandTypeCommandcommand parameterDescription
Keypad TouchcommandcreateKey{ "name": passcode _name_str, "type": passcode_type_str, "password": passcode_str, "startTime": valid_from_long, "endTime": valid_to_long }create a new passcode
Keypad TouchcommanddeleteKey{ "id": passcode_id_int }delete an existing passcode

The following table describes the parameter object for createKey,

Key NameValue TypeDescription
nameStringa unique name for the passcode. duplicates under the same device are not allowed.
typeStringtype of the passcode. permanent, a permanent passcode. timeLimit, a temporary passcode. disposable, a one-time passcode. urgent, an emergency passcode.
passwordStringa 6 to 12-digit passcode in plain text
startTimeLongset the time the passcode becomes valid from, mandatory for one-time passcode and temporary passcode. a 10-digit timestamp.
endTimeLongset the time the passcode becomes expired, mandatory for one-time passcode and temporary passcode. a 10-digit timestamp.

The following table describes the parameter object for deleteKey,

Key NameValue TypeDescription
idStringthe id of the passcode

Webhook Events

Key NameValue TypeDescription
eventTypeStringthe type of events
eventVersionStringthe current event version
contextObjectthe detail info of the event
deviceTypeStringattributes of the context object. the type of the device
deviceMacStringattributes of the context object. the MAC address of the device
eventNameStringattributes of the context object. the name of the command being sent
commandIdStringattributes of the context object. the command id
resultStringattributes of the context object. the result of the command. success, failed, or timeout. timeout duration is 1 minute
timeOfSampleLongattributes of the context object. the time stamp when the event is sent
Create a passcode
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoKeypadTouch",
        "deviceMac": DEVICE_MAC_ADDR,
        "eventName": "createKey",
        "commandId": "CMD-1663558451952-01",
        "result": "success",
        "timeOfSample": 123456789
    }
}
Delete a passcode
{
    "eventType": "changeReport",
    "eventVersion": "1",
    "context": {
        "deviceType": "WoKeypadTouch",
        "deviceMac": DEVICE_MAC_ADDR,
        "eventName": "deleteKey ",
        "commandId": "CMD-1663558451952-01",
        "result": "success",
        "timeOfSample": 123456789
    }
}