Smart Home LockUnlock Trait Schema

action.devices.traits.LockUnlock - This trait belongs to any devices that support locking and unlocking, and/or reporting a locked state.

Device ATTRIBUTES

None.

Device STATES

Devices with this trait may report the following states as part of the QUERY operation. To learn more about handling QUERY intents, see Intent fulfillment.

States Type Description
isLocked Boolean

Whether the device is currently locked.

isJammed Boolean

Whether the device is currently jammed and therefore its locked state cannot be determined.

Examples

Device that is locked

{
  "isLocked": true
}

Device that is jammed

{
  "isJammed": true
}

Device COMMANDS

Devices with this trait may respond to the following commands as part of the EXECUTE operation. To learn more about handling EXECUTE intents, see Intent fulfillment.

action.devices.commands.LockUnlock

Lock or unlock the device.

Parameters

Parameters Type Description
lock Boolean

Required.

True when command is to lock, false to unlock.

followUpToken String

Google-provided token for follow-up response.

Examples

Lock the front door.

{
  "command": "action.devices.commands.LockUnlock",
  "params": {
    "lock": true,
    "followUpToken": "123"
  }
}

Unlock the front door.

{
  "command": "action.devices.commands.LockUnlock",
  "params": {
    "lock": false,
    "followUpToken": "567"
  }
}

An error occurred locking or unlocking the device.

Supported values:

remoteSetDisabled
deviceJammingDetected
notSupported
alreadyLocked
alreadyUnlocked

Device ERRORS

See the full list of errors and exceptions.