Skip to main content

Shelly

This service is common for all Shelly-NG devices. It handles device management. Here are listed all methods supported by the Shelly namespace.

Shelly.GetStatus#

This method returns the status of all the components of the device.

Request#

This method takes no parameters.

http://192.168.33.1/rpc/Shelly.GetStatus

Response#

Attributes in the result are the status objects of all components in the device.

{
"ble": {},
"cloud": {
"connected": false
},
"eth": {
"ip": "10.33.55.170"
},
"input:0": {
"id": 0,
"state": false
},
"input:1": {
"id": 1,
"state": false
},
"input:2": {
"id": 2,
"state": false
},
"input:3": {
"id": 3,
"state": false
},
"mqtt": {
"connected": false
},
"switch:0": {
"id": 0,
"source": "timer",
"output": true,
"timer_started_at": 1626935739.79,
"timer_duration": 60,
"apower": 8.9,
"voltage": 237.5,
"aenergy": {
"total": 6.532,
"by_minute": [
45.199,
47.141,
88.397
],
"minute_ts": 1626935779
},
"temperature": {
"tC": 23.5,
"tF": 74.4
}
},
"switch:1": {
"id": 1,
"source": "init",
"output": false,
"apower": 0.0,
"voltage": 237.5,
"aenergy": {
"total": 0,
"by_minute": [
0,
0,
0
],
"minute_ts": 1626935779
},
"temperature": {
"tC": 23.5,
"tF": 74.4
}
},
"switch:2": {
"id": 2,
"source": "timer",
"output": false,
"timer_started_at": 1626935591.8,
"timer_duration": 345,
"apower": 0.0,
"voltage": 237.5,
"aenergy": {
"total": 0.068,
"by_minute": [
0,
0,
0
],
"minute_ts": 1626935779
},
"temperature": {
"tC": 23.5,
"tF": 74.4
}
},
"switch:3": {
"id": 3,
"source": "init",
"output": false,
"apower": 0.0,
"voltage": 237.5,
"aenergy": {
"total": 0,
"by_minute": [
0,
0,
0
],
"minute_ts": 1626935779
},
"temperature": {
"tC": 23.5,
"tF": 74.4
}
},
"sys": {
"mac": "F008D1D8B8B8",
"restart_required": false,
"time": "09:36",
"unixtime": 1626935781,
"uptime": 5744,
"ram_size": 250272,
"ram_free": 109748,
"fs_size": 474641,
"fs_free": 336340,
"available_updates": {}
}
"wifi": {
"sta_ip": null,
"status": "disconnected",
"ssid": null,
"rssi": 0
}
}

Shelly.GetConfig#

This method returns the configuration of all the components of the device.

Request#

This method takes no parameters.

http://192.168.33.1/rpc/Shelly.GetConfig

Response#

Attributes in the result are the configuration objects of all components in the device.

{
"ble": {
"enable": true
},
"cloud": {
"enable": false,
"server": "iot.shelly.cloud:6012/jrpc"
},
"eth": {
"enable": true,
"ipv4mode": "dhcp",
"ip": null,
"netmask": null,
"gw": null,
"nameserver": null
},
"input:0": {
"id": 0,
"name": null,
"type": "switch",
"invert": false
},
"input:1": {
"id": 1,
"name": null,
"type": "switch",
"invert": false
},
"input:2": {
"id": 2,
"name": null,
"type": "switch",
"invert": false
},
"input:3": {
"id": 3,
"name": null,
"type": "switch",
"invert": false
},
"mqtt": {
"enable": false,
"server": null,
"user": null,
"pass": null
},
"switch:0": {
"id": 0,
"name": null,
"in_mode": "follow",
"initial_state": "match_input",
"auto_on": true,
"auto_on_delay": 60,
"auto_off": true,
"auto_off_delay": 60,
"power_limit": 3500,
"voltage_limit": 280,
"current_limit": 16.00
},
"switch:1": {
"id": 1,
"name": null,
"in_mode": "follow",
"initial_state": "match_input",
"auto_on": false,
"auto_on_delay": 60,
"auto_off": false,
"auto_off_delay": 60,
"power_limit": 3500,
"voltage_limit": 280,
"current_limit": 16.00
},
"switch:2": {
"id": 2,
"name": null,
"in_mode": "follow",
"initial_state": "match_input",
"auto_on": true,
"auto_on_delay": 345,
"auto_off": true,
"auto_off_delay": 2,
"power_limit": 3500,
"voltage_limit": 280,
"current_limit": 16.00
},
"switch:3": {
"id": 3,
"name": null,
"in_mode": "follow",
"initial_state": "match_input",
"auto_on": false,
"auto_on_delay": 60,
"auto_off": false,
"auto_off_delay": 60,
"power_limit": 3500,
"voltage_limit": 280,
"current_limit": 16.00
},
"sys": {
"device": {
"name": null
"mac": "F008D1D8B8B8",
"fw_id": "20210720-153353/0.6.7-gc36674b"
},
"location": {
"tz": "Europe/Sofia",
"lat": 42.67236,
"lon": 23.38738
},
"ui_data": {},
"sntp":{
"server": "time.google.com"
}
}
"wifi": {
"ap": {
"ssid": "ShellyPro4PM-F008D1D8B8B8",
"is_open": true,
"enable": true
},
"sta": {
"ssid": null,
"is_open": true,
"enable": false,
"ipv4mode": "dhcp",
"ip": null,
"netmask": null,
"gw": null,
"nameserver": null
},
"sta1": {
"ssid": null,
"is_open": true,
"enable": false,
"ipv4mode": "dhcp",
"ip": null,
"netmask": null,
"gw": null,
"nameserver": null
},
"roam": {
"rssi_thr": -80,
"interval": 60
}
}
}

Shelly.ListMethods#

This method lists all available RPC methods. It takes into account both ACL and authentication restrictions and only lists the methods allowed for the particular user/channel that's making the request.

Request#

This method takes no parameters.

http://192.168.33.1/rpc/Shelly.ListMethods

Response#

Attributes in the result:

  • methods: array of type string, names of the methods allowed
{
"methods": [
"Switch.SetConfig",
"Switch.GetConfig",
"Switch.GetStatus",
"Switch.Toggle",
"Switch.Set",
"Schedule.List",
"Schedule.DeleteAll",
"Schedule.Delete",
"Schedule.Update",
"Schedule.Create",
"Input.SetConfig",
"Input.GetConfig",
"Input.GetStatus",
"Webhook.ListSupported",
"Webhook.List",
"Webhook.DeleteAll",
"Webhook.Delete",
"Webhook.Update",
"Webhook.Create",
"Mqtt.SetConfig",
"Mqtt.GetConfig",
"Mqtt.GetStatus",
"Cloud.SetConfig",
"Cloud.GetConfig",
"Cloud.GetStatus",
"BLE.SetConfig",
"BLE.GetConfig",
"BLE.GetStatus",
"Eth.SetConfig",
"Eth.GetConfig",
"Eth.GetStatus",
"Wifi.Scan",
"Wifi.SetConfig",
"Wifi.GetConfig",
"Wifi.GetStatus",
"Sys.SetConfig",
"Sys.GetConfig",
"Sys.GetStatus",
"HTTP.GET",
"Shelly.ListMethods",
"Shelly.PutUserCA",
"Shelly.Reboot",
"Shelly.SetAuth",
"Shelly.Update",
"Shelly.CheckForUpdate",
"Shelly.DetectLocation",
"Shelly.ListTimezones",
"Shelly.GetStatus",
"Shelly.FactoryReset",
"Shelly.ResetWiFiConfig",
"Shelly.GetConfig",
"Shelly.GetDeviceInfo"
]
}

Shelly.GetDeviceInfo#

This method returns information about the device.

Request#

This method takes no parameters.

http://192.168.33.1/rpc/Shelly.GetDeviceInfo

Response#

Attributes in the result:

  • id: string, id of the device
  • mac: string, mac address of the device
  • model: string, model of the device
  • gen: number, generation of the device
  • fw_id: string, id of the firmware of the device
  • ver: string, version of the firmware of the device
  • app: string, application name
  • auth_en: boolean, true if authentication is enabled, false otherwise
  • auth_domain: string or null, name of the domain (null if authentication is not enabled)
{
"id": "shellypro4pm-f008d1d8b8b8",
"mac": "F008D1D8B8B8",
"model": "SPSW-004PE16EU",
"gen": 2,
"fw_id": "20210720-153353/0.6.7-gc36674b",
"ver": "0.6.7",
"app": "FourPro",
"auth_en": true,
"auth_domain": "shellypro4pm-f008d1d8b8b8"
}

Shelly.ListTimezones#

This method returns list of all timezones.

Request#

This method takes no parameters.

http://192.168.33.1/rpc/Shelly.ListTimezones

Response#

Attributes in the result:

  • timezones: array of type string, list of all timezones
{
"timezones": [
"Africa/Abidjan",
"Africa/Accra",
"Africa/Addis_Ababa",
"Africa/Algiers",
"Africa/Asmara",
"Africa/Asmera",
...
]
}

Shelly.DetectLocation#

This method detects and returns the location of the device.

Request#

This method takes no parameters.

http://192.168.33.1/rpc/Shelly.DetectLocation

Response#

Attributes in the result:

  • tz: string or null, timezone of the detected location (null if not available)
  • lat: number or null, latitude of the detected location in degrees (null if not available)
  • lon: number or null, longitude of the detected location in degrees (null if not available)
{
"tz": "Europe/Sofia",
"lat": 42.67236,
"lon": 23.38738
}

Shelly.CheckForUpdate#

This method checks for new firmware version for the device and returns information about it. If no update is available returns empty JSON object as result.

Request#

This method takes no parameters.

http://192.168.33.1/rpc/Shelly.CheckForUpdate

Response#

Attributes in the result (only the ones available are shown):

  • stable: JSON object, indicates new stable version of the firmware.
    • version: string, the new version
    • build_id: string, id of the new build
  • beta: JSON object, indicates new beta version of the firmware.
    • version: string, the new version
    • build_id: string, id of the new build
{
"beta": {
"version": "0.5.1",
"build_id": "20210610-122509/g4bbec18"
}
}

Shelly.Update#

This method updates the firmware version of the device.

Request#

Parameters:

  • stage: string, the type of the new version - either stable or beta. By default updates to stable version. Optional
http://192.168.33.1/rpc/Shelly.Update?stage=beta

Response#

The result from this method is null.

null

Shelly.FactoryReset#

This method resets the configuration to its default state.

Request#

This method takes no parameters.

http://192.168.33.1/rpc/Shelly.FactoryReset

Response#

The result from this method is null.

null

Shelly.ResetWiFiConfig#

This method resets the WiFi configuration of the device.

Request#

This method takes no parameters.

http://192.168.33.1/rpc/Shelly.ResetWiFiConfig

Response#

The result from this method is null.

null

Shelly.Reboot#

This method reboots the device.

Request#

Parameters:

  • delay_ms: number, delay until reboot in milliseconds. Any values are valid but the minimum is capped at 500 ms. Default value: 1000 ms. Optional
http://192.168.33.1/rpc/Shelly.Reboot

Response#

The result from this method is null.

null

Shelly.SetAuth#

This method sets authentication details (password) for the device. More detailed description of the authentication mechanism can be found here.

Request#

Parameters:

  • user: string, must be set to admin. Only one user is supported. Required
  • realm: string, must be the id of the device. Only one realm is supported. Required
  • ha1: string or null, "user:realm:password" encoded in SHA256 (null to disable authentication). Required
http://192.168.33.1/rpc/Shelly.SetAuth?user=admin&realm=shellypro4pm-f008d1d8b8b8&ha1=7f22c63135ab3c86d165d812fbab2ac30950ee53d86451e508c699e5de9c39ac

Response#

The result from this method is null.

null

Shelly.PutUserCA#

This method allows uploading of a custom certificate authority (CA) PEM bundle. Because the file can be larger than what can fit in a single RPC frame, the method allows uploading in chunks (for example line by line). More about the user CA support provided by Shelly can be found here.

Request#

Parameters:

  • data: string or null, contents of the PEM file (null if you want to delete the existing data). Required
  • append: boolean, true if more data will be appended afterwards, false otherwise. Required
http://192.168.33.1/rpc/Shelly.PutUserCA?data="MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEk"&append=false

Response#

The result from this method is null.

{
"len": 64
}

HTTP Endpoint: /shelly#

This resource is equivalent to invoking Shelly.GetDeviceInfo. The aim of this request is to identify a device. As the generation (gen) of the device determines the channels and methods/endpoints available, this information is useful for further integrations of Shelly devices in other systems.

Example:

Request
curl http://${SHELLY}/shelly
Response
{
"id": "shellypro4pm-f008d1d8b8b8",
"mac": "F008D1D8B8B8",
"model": "SPSW-004PE16EU",
"gen": 2,
"fw_id": "20210720-153353/0.6.7-gc36674b",
"ver": "0.6.7",
"app": "FourPro",
"auth_en": true,
"auth_domain": "shellypro4pm-f008d1d8b8b8"
}