Open Platform
Skip to content

Add human presence sensor ​

https://euapi.ttlock.com/v3/humanPresenceSensor/add

The human presence sensor can detect whether there is a person in the room and transmit the sensing data to the power-taking switch, so as to realize automatic power taking by sensing.

Call this API after adding the human presence sensor to the power-taking switch through the APP SDK, to bind the human presence sensor to the power-taking switch in the cloud. Currently, a human presence sensor can only be added to one power-taking switch; if added to another, the new binding will overwrite the previous one.

1 HTTP request method and example ​

POST, ContentType:application/x-www-form-urlencoded

javascript
curl --location -g --request POST 'https://euapi.ttlock.com/v3/humanPresenceSensor/add' \
--data-urlencode 'clientId=4773aa036f7f49c68d876bb4be85c80c' \
--data-urlencode 'accessToken=dfd5489d0cee31f0bdfaf59d0d42d71f' \
--data-urlencode 'lockId=76324' \
--data-urlencode 'name=301roomsensor' \
--data-urlencode 'mac=AA:BB:CC:DD:EE:FF' \
--data-urlencode 'number=HPS-234234' \
--data-urlencode 'sensitivity=1' \
--data-urlencode 'modelNum=xxxxxxxxxxxxx' \
--data-urlencode 'hardwareRevision=xxxxxxxxxxxxx' \
--data-urlencode 'firmwareRevision=xxxxxxxxxxxxx' \
--data-urlencode 'date=1625025703000'

2 Request parameters ​

NameTypeRequiredDescription
clientIdStringYclient_id from Create application
accessTokenStringYAccess token,refer to: Get access token
lockIdStringYPower switch ID
nameStringYName
macStringYHuman presence sensor MAC
numberStringYHuman presence sensor number
sensitivityStringNSensitivity: 0-off, 1-low, 2-lower, 3-medium, 4-higher, 5-high
modelNumStringNProduct model
hardwareRevisionStringNHardware version number
firmwareRevisionStringNFirmware version number
dateLongYCurrent time (timestamp in millisecond)

3 Response and example ​

ParameterTypeDescription
idIntHuman presence sensor ID
{
    "id": 2233
}
CopyRight © 2012-2026 TTLock.All Rights Reserved