Operating the meter to turn it on/off
https://euapi.ttlock.com/v3/electricMeter/controlOnOff
Power on/off via the gateway. If Bluetooth operation is required, please refer to the corresponding APP's SDK.
1 Request example
POST, ContentType:application/x-www-form-urlencoded
json
curl --location -g --request POST 'https://euapi.ttlock.com/v3/electricMeter/controlOnOff'\
--data-urlencode 'clientId=4773aa036f7f49c68d876bb4be85c80c' \
--data-urlencode 'accessToken=dfd5489d0cee31f0bdfaf59d0d42d71f' \
--data-urlencode 'electricMeterId=3001' \
--data-urlencode 'onOff=1' \
--data-urlencode 'date=1625025703000'2 Request parameters
| Name | Type | Required | Description |
|---|---|---|---|
| clientId | String | Y | Assigned client_id from created application |
| accessToken | String | Y | Access token, obtain by calling get access token API |
| date | Long | Y | Current time (timestamp, in milliseconds) |
| electricMeterId | String | Y | Electricity meter ID |
| onOff | Int | Y | Power-on status: 0 - No 1 - Yes |
3 Response and example
| Name | Type | Description |
|---|---|---|
| errcode | Int | Error code |
| errmsg | String | Error message |
| description | String | Error Description |
json
{
"errcode": 0,
"errmsg": "none error message or means yes",
"description": "表示成功或是"
}