Shelly 1/1PM/EM
Examples are without external sensor, document with examples and settings with sensors:

Fetch Status

Request URL:
1
POST /provider/fetch
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number" : "{Shelly Serial Number}"
3
}
Copied!
Response:
1
{
2
"provider": {
3
"online": true,
4
"isok": true,
5
"data": {
6
"online": true,
7
"device_status": {
8
"ram_free": 38924,
9
"has_update": true,
10
"wifi_sta": {
11
"connected": true,
12
"ssid": "",
13
"ip": "",
14
"rssi": -44
15
},
16
"update": {
17
"status": "pending",
18
"has_update": true,
19
"new_version": "",
20
"old_version": ""
21
},
22
"ext_sensors": [],
23
"actions_stats": {
24
"skipped": 0
25
},
26
"cfg_changed_cnt": 2,
27
"fs_free": 146333,
28
"getinfo": {
29
"fw_info": {
30
"device": "shelly1-E0*******33",
31
"fw": ""
32
}
33
},
34
"inputs": [
35
{
36
"input": 0,
37
"event": "",
38
"event_cnt": 0
39
}
40
],
41
"_updated": "2020-11-09 16:33:16",
42
"ram_total": 50736,
43
"fs_size": 233681,
44
"ext_humidity": [],
45
"relays": [
46
{
47
"ison": false,
48
"has_timer": false,
49
"timer_started": 0,
50
"timer_duration": 0,
51
"timer_remaining": 0,
52
"source": "input"
53
}
54
],
55
"mac": "E09*******33",
56
"meters": [
57
{
58
"power": 0,
59
"is_valid": true
60
}
61
],
62
"serial": 3,
63
"ext_temperature": [],
64
"unixtime": 1604946495,
65
"cloud": {
66
"enabled": true,
67
"connected": true
68
},
69
"time": "18:28",
70
"uptime": 108,
71
"mqtt": {
72
"connected": false
73
}
74
}
75
}
76
},
77
"_links": {
78
"self": {
79
"href": "/v1/provider/fetch"
80
}
81
}
82
}
Copied!

Fetch Settings

Request URL:
1
POST /provider/fetch
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number" : "{Shelly Serial Number}",
3
"settings":true
4
}
Copied!
Response:
1
{
2
"provider": {
3
"coiot": {
4
"update_period": 15
5
},
6
"factory_reset_from_switch": true,
7
"wifi_sta": {
8
"enabled": true,
9
"ssid": "",
10
"ipv4_method": "dhcp",
11
"ip": null,
12
"gw": null,
13
"mask": null,
14
"dns": null
15
},
16
"timezone": "Europe/Sofia",
17
"fw": "20201102-092207/[email protected]",
18
"tz_dst_auto": true,
19
"wifi_ap": {
20
"enabled": false,
21
"ssid": "shelly1-E09*******33",
22
"key": ""
23
},
24
"_updated": "2020-11-09 16:28:13",
25
"longpush_time": 800,
26
"device": {
27
"type": "SHSW-1",
28
"mac": "E**********3",
29
"hostname": "shelly1-E***********3",
30
"num_outputs": 1
31
},
32
"sntp": {
33
"server": "time.google.com",
34
"enabled": true
35
},
36
"ext_humidity": [],
37
"mode": "relay",
38
"tz_utc_offset": 7200,
39
"build_info": {
40
"build_id": "20201102-092207/[email protected]",
41
"build_timestamp": "2020-11-02T09:22:07Z",
42
"build_version": "1.0"
43
},
44
"ext_switch": [
45
{
46
"relay_num": -1
47
}
48
],
49
"login": {
50
"enabled": false,
51
"unprotected": false,
52
"username": "admin"
53
},
54
"tz_dst": false,
55
"ext_temperature": [],
56
"unixtime": 1604946493,
57
"time": "18:28",
58
"wifi_sta1": {
59
"enabled": false,
60
"ssid": null,
61
"ipv4_method": "dhcp",
62
"ip": null,
63
"gw": null,
64
"mask": null,
65
"dns": null
66
},
67
"ext_sensors": [],
68
"ext_switch_enable": false,
69
"lng": 26.514299,
70
"actions": {
71
"active": false,
72
"names": [
73
"btn_on_url",
74
"btn_off_url",
75
"longpush_url",
76
"shortpush_url",
77
"out_on_url",
78
"out_off_url",
79
"lp_on_url",
80
"lp_off_url",
81
"ext_temp_over_url",
82
"ext_temp_under_url",
83
"ext_temp_over_url",
84
"ext_temp_under_url",
85
"ext_temp_over_url",
86
"ext_temp_under_url",
87
"ext_hum_over_url",
88
"ext_hum_under_url"
89
]
90
},
91
"tzautodetect": true,
92
"relays": [
93
{
94
"name": null,
95
"appliance_type": "General",
96
"ison": false,
97
"has_timer": false,
98
"default_state": "switch",
99
"btn_type": "toggle",
100
"btn_reverse": 0,
101
"auto_on": 0,
102
"auto_off": 0,
103
"power": 0,
104
"schedule": false,
105
"schedule_rules": []
106
}
107
],
108
"discoverable": false,
109
"lat": 43.525501,
110
"name": null,
111
"hwinfo": {
112
"hw_revision": "prod-191217",
113
"batch_id": 1
114
},
115
"cloud": {
116
"enabled": true,
117
"connected": true
118
},
119
"pin_code": "",
120
"mqtt": {
121
"enable": false,
122
"server": "192.168.33.3:1883",
123
"user": "",
124
"id": "shelly1-E09806963933",
125
"reconnect_timeout_max": 60,
126
"reconnect_timeout_min": 2,
127
"clean_session": true,
128
"keep_alive": 60,
129
"max_qos": 0,
130
"retain": false,
131
"update_period": 30
132
}
133
},
134
"_links": {
135
"self": {
136
"href": "/v1/provider/fetch"
137
}
138
}
139
}
Copied!

Fetch Statistics (1PM, EM)

Request URL:
1
POST /provider/fetch
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number" : "{Shelly Serial Number}",
3
"statistics": true,
4
"channel":0, // optional
5
"value": {
6
"date_range": "custom", // day, week, month, year, custom
7
"date_from": "", // only if its custom
8
"date_to": "" // only if its custom
9
}
10
}
Copied!
Response:
1
{
2
"provider": {
3
"isok": true,
4
"data": {
5
"history": [
6
{
7
"datetime": "2020-11-29 12:00:00",
8
"consumption": 0,
9
"available": false
10
},
11
{.....},
12
{
13
"datetime": "2020-11-30 11:00:00",
14
"consumption": 0,
15
"available": false
16
}
17
],
18
"timezone": "",
19
"history_interval": "hour",
20
"total": 0,
21
"units": {
22
"consumption": "Wh"
23
}
24
}
25
},
26
"_links": {
27
"self": {
28
"href": "/v1/provider/fetch"
29
}
30
}
31
}
Copied!

Switch Shelly 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": “{Shelly Serial Number}”,
3
"command" : "switch_on_off",
4
"state" : "on" //receives values “on”/“off”
5
}
Copied!
Response:
1
{
2
"provider": {
3
"isok": true,
4
"data": {
5
"device_id": "e***********3"
6
}
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": “{Shelly Serial Number}”,
3
"command" : "relay_settings",
4
"setting" : "default_state",
5
"value" : "last" // Default power-on state on/off/last
6
}
Copied!
Response:
1
{
2
"provider": {
3
"isok": true,
4
"data": {
5
"device_id": "e*********3"
6
}
7
},
8
"_links": {
9
"self": {
10
"href": "/v1/provider/send"
11
}
12
}
13
}
Copied!

Button Type

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{Shelly Serial Number}”,
3
"command" : "relay_settings",
4
"setting" : "button_type",
5
"value" : "momentary" // momentary, edge, toggle
6
}
Copied!
Response:
1
{
2
"provider": {
3
"isok": true,
4
"data": {
5
"device_id": "e*********3"
6
}
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": “{Shelly Serial Number}”,
3
"command" : "relay_settings",
4
"setting": "auto_turn",
5
"channel": 0, // optional
6
"value": {
7
"timeout":20,// in seconds , 0 = OFF
8
"state": "on" // on/off
9
}
10
}
Copied!
Response:
1
{
2
"provider": {
3
"isok": true,
4
"data": {
5
"device_id": "e*********3"
6
}
7
},
8
"_links": {
9
"self": {
10
"href": "/v1/provider/send"
11
}
12
}
13
}
Copied!

Consumption Correction (1PM only)

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{Shelly Serial Number}”,
3
"command" : "relay_settings",
4
"setting": "power_correction",
5
"value": 1.05 // (0.85 - 1.15)
6
}
Copied!
Response:
1
{
2
"provider": {
3
"isok": true,
4
"data": {
5
"device_id": "e*********3"
6
}
7
},
8
"_links": {
9
"self": {
10
"href": "/v1/provider/send"
11
}
12
}
13
}
Copied!

Transformer Type (EM Only)

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{Shelly Serial Number}”,
3
"command" : "relay_settings",
4
"setting": "transformer_type",
5
"value": 50,
6
"channel":1
7
}
Copied!
Response:
1
{
2
"provider": {
3
"isok": true,
4
"data": {
5
"device_id": "e*********3"
6
}
7
},
8
"_links": {
9
"self": {
10
"href": "/v1/provider/send"
11
}
12
}
13
}
Copied!

Last modified 5mo ago