Smart Plug

Fetch

Request URL:
1
POST /provider/fetch
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number" : "{Smart Plug Serial Number}"
3
}
Copied!
Response:
1
{
2
"provider": {
3
"online": true,
4
"power": [
5
0
6
]
7
},
8
"_links": {
9
"self": {
10
"href": "/v1/provider/fetch"
11
}
12
}
13
}
Copied!

Switch Plug On/Off

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{Smart Plug Serial Number}”,
3
"command" : "switch_on_off",
4
"state" : "on" //receives values “on”/“off”
5
}
Copied!
Response:
1
{
2
"provider": {
3
"isok": true,
4
"id": 8****3,
5
"type": "relay",
6
"code": "SHPLG-1"
7
},
8
"_links": {
9
"self": {
10
"href": "/v1/provider/send"
11
}
12
}
13
}
Copied!

Default State

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{Smart Plug Serial Number}”,
3
"command" : "default_switch",
4
"state" : "last" // Default power-on state ("off", "on", "last")
5
}
Copied!
Response:
1
{
2
"provider": {
3
"isok": true,
4
"id": 81****3,
5
"type": "relay",
6
"code": "SHPLG-1"
7
},
8
"_links": {
9
"self": {
10
"href": "/v1/provider/send"
11
}
12
}
13
}
Copied!

Max Power Turn Off

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{Smart Plug Serial Number}”,
3
"command" : "max_power_turn_off",
4
"max_power" : 3000 // overpower threshold in Watts
5
}
Copied!
Response:
1
{
2
"provider": {
3
"isok": true,
4
"id": 8*****93,
5
"type": "relay",
6
"code": "SHPLG-1"
7
},
8
"_links": {
9
"self": {
10
"href": "/v1/provider/send"
11
}
12
}
13
}
Copied!

Automatic Turn On/Off

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{Smart Plug Serial Number}”,
3
"command" : "auto_switch",// Automatic flip back timer, seconds.
4
"state" : "on", // Will engage after turning the plug ON or OFF
5
"timeout": 5 // Seconds, 0 = OFF
6
}
Copied!
Response:
1
{
2
"provider": {
3
"isok": true,
4
"id": 8*****3,
5
"type": "relay",
6
"code": "SHPLG-1"
7
},
8
"_links": {
9
"self": {
10
"href": "/v1/provider/send"
11
}
12
}
13
}
Copied!
Last modified 5mo ago