Webhooks / HTTP(S) requests

Webhooks / HTTP(S) requests

To find a list of HTTP/action commands, just scroll to the bottom of this page.

Introduction

Scroll down to find an overview of the most used HTTP actions.

Direct Device to Device communication (DDD) enables Shelly devices to communicate with each other without a server or cloud connection. You only need your local wifi.

The main advantage by using DDD is:

  • No cloud needed – works completely locally.
  • Fast communication – reacts in a few milliseconds.
  • Ability to manage other devices that have an HTTP API or activate a scene in IFTTT.
  • Easy and fast to program basic actions.

How it works

The “action” settings can be accessed from the “settings” tap.

This can be accessed from the Shelly Smart Control app, web interface (https://control.shelly.cloud), or from the device IP (might look a little different).

From here, you need to “ADD ACTION”.

To create your DDD action, you need to go through the following four steps.

NAME

Give your action a name.

TIME

Define the time period when the action can be triggered.

CONDITION

Chose on which condition you want your URL action to be triggered.

URL

Insert the URL action you want to run when the condition has been triggered. In this case, I will toggle a Shelly Duo RGBW.

URL action description

We can basically split up the devices in four categories:

  • Relays
  • Rollers
  • Lights
  • Color lights

Description of the command syntax

The command syntax to control the devices is built up like this:
http://[deviceIP]/[deviceType]/[channel]?[command]&[command]

If you use authorization syntax it is:
http://user:pass@[deviceIP]/[deviceType]/[channel]?[command]&[command]

 

[device IP] and [channel]

Device IP is the IP address of the device you would like to control. The device IP and the channel can be found under Settings -> Device info.

Channels start from 0, which means that if you have a multi-channel relay (like Plus 2PM, Pro 4, etc), the channels will be named:

  • Output 1: Channel 0
  • Output 2: Channel 1
  • Output 3: Channel 2
  • Output 4: Channel 3

 

[deviceType]

The device type is the type of device you would like to control:

  • Relay
  • Light
  • Roller
  • Color

 

[command]

You can add one or more commands to the syntax. Depending on the device type, there will be different commands.

“Relay”, “Light” and “Color” light main commands:

  • turn=on – switch output ON
  • turn=off – switch output OFF
  • turn=toggle – reverse state

“Roller” main commands:

  • go=open – open roller
  • go=close – close roller
  • go=stop – stop roller
  • roller_pos=0-100 – open the roller to this position. Need to calibrate it before that.

Secondary commands:

  • timer=X – where X is the time in seconds. Switch output will be turned on or off for X seconds and will be switched back to the preview state after that.
  • brightness=X – where X is the brightness in percentage.
  • kelvin=X – where X is the color temperature. Shelly Duo goes from 3000 – 6500 Kelvin.
  • duration=X – move the roller X seconds.
  • red=0-255 – change red color intensity
  • blue=0-255 – change blue color intensity
  • green=0-255 – change green color intensity
  • white=0-255 – change white color intensity
  • gain=0-100 – change intensity for RGB

 

Action URL examples

Relay examples

http://192.168.X.X/relay/0?turn=on

http://192.168.X.X/relay/0?turn=on&timer=10

 

Light examples

http://192.168.X.X/light/0?turn=on

http://192.168.X.X/light/0?turn=on&brightness=70&temp=3000

 

Color light examples

http://192.168.X.X/color/0?turn=on&red=255&green=86&blue=112&white=0

 

Roller examples

http://192.168.X.X/roller/0?go=open

http://192.168.X.X/roller/0?roller_pos=30

 

More examples can be found by picking the device you would like to control below.

Frequently used HTTP requests

General HTTP requests

Status request:
http://192.168.xxx.xxx/status

Settings request:
http://192.168.xxx.xxx/settings

Actions request:
http://192.168.xxx.xxx/settings/actions

Update request:
http://192.168.xxx.xxx/ota?update=1

Reboot:
http://192.168.xxx.xxx/reboot

Factory reset:
http://192.168.xxx.xxx/reset

Shelly Plus 1

Get status:
http://192.168.xxx.xxx/rpc/Shelly.GetStatus

Relay on:
http://192.168.xxx.xxx/relay/0?turn=on

Relay off:
http://192.168.xxx.xxx/relay/0?turn=off

Toggle:
http://192.168.xxx.xxx/relay/0?turn=toggle

Relay on with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=on&timer=30

Relay off with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=off&timer=30

Shelly Plus 1PM

Get status:
http://192.168.xxx.xxx/rpc/Shelly.GetStatus

Relay on:
http://192.168.xxx.xxx/relay/0?turn=on

Relay off:
http://192.168.xxx.xxx/relay/0?turn=off

Toggle:
http://192.168.xxx.xxx/relay/0?turn=toggle

Relay on with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=on&timer=30

Relay off with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=off&timer=30

Shelly Plus 2PM

Relay mode

Get status:
http://192.168.xxx.xxx/rpc/Switch.GetStatus?id=0
0 = channel 1
1 = channel 2

Relay on:
http://192.168.xxx.xxx/relay/0?turn=on
0 = channel 1
1 = channel 2

Relay off:
http://192.168.xxx.xxx/relay/0?turn=off
0 = channel 1
1 = channel 2

Toggle:
http://192.168.xxx.xxx/relay/0?turn=toggle
0 = channel 1
1 = channel 2

Relay on with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=on&timer=30
0 = channel 1
1 = channel 2

Relay off with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=off&timer=30
0 = channel 1
1 = channel 2

Cover-Mode

Cover configuration:
http://192.168.xxx.xxx/rpc/Cover.GetConfig?id=0

Cover state:
http://192.168.xxx.xxx/rpc/Cover.GetStatus?id=0

Cover open:
http://192.168.xxx.xxx/roller/0?go=open

Cover close:
http://192.168.xxx.xxx/roller/0?go=close

Cover stop:
http://192.168.xxx.xxx/roller/0?go=stop

Cover open with timer (in seconds):
http://192.168.xxx.xxx/roller/0?go=open&duration=10
10 = 10 seconds

Cover close with timer (in seconds):
http://192.168.xxx.xxx/roller/0?go=close&duration=10
10 = 10 seconds

Cover position in %:
http://192.168.xxx.xxx/roller/0?go=to_pos&roller_pos=75
75 = 75 %

Cover calibration:
http://192.168.xxx.xxx/rpc/Cover.Calibrate?id=0

Shelly Dimmer 2

Light on:
http://192.168.xxx.xxx/light/0?turn=on

Light off:
http://192.168.xxx.xxx/light/0?turn=off

Light toggle:
http://192.168.xxx.xxx/light/0?turn=toggle

Light on with timer (in seconds):
http://192.168.xxx.xxx/light/0?turn=on&timer=30

Light off with timer (in seconds):
http://192.168.xxx.xxx/light/0?turn=off&timer=30

Light on and set brightness in %:
http://192.168.xxx.xxx/light/0?turn=on&brightness=70

Set brightness in %:
http://192.168.xxx.xxx/light/0?brightness=70

Increase brightness
http://192.168.xxx.xxx/light/0?dim=up&step=10
Will increase brightness until another command is received.

Decrease brightness:
http://192.168.xxx.xxx/light/0?dim=down&step=10
Will decrease brightness until another command is received.

Stop dimming:
http://192.168.xxx.xxx/light/0?dim=stop

Shelly RGBW 2

Color mode

Light on:
http://192.168.xxx.xxx/color/0?turn=on

Light off:
http://192.168.xxx.xxx/color/0?turn=off

Light toggle:
http://192.168.xxx.xxx/color/0?turn=toggle

Light on with timer (in seconds):
http://192.168.xxx.xxx/color/0?turn=on&timer=30

Light off with timer (in seconds):
http://192.168.xxx.xxx/color/0?turn=off&timer=30

Light on and set RGBW colors (red, green, blue, white):
http://192.168.xxx.xxx/color/0?turn=on&red=255&green=86&blue=112&white=0

Light on and set white only:
http://192.168.xxx.xxx/color/0?turn=on&white=20

Light on and set intensity:
http://192.168.xxx.xxx/color/0?turn=on&gain=27

White mode

Channel 1: 0/R
Channel 2: 1/G
Channel 3: 2/B
Channel 4: 3/W

Light on:
http://192.168.xxx.xxx/white/0?turn=on

Light off:
http://192.168.xxx.xxx/white/0?turn=off

Light toggle:
http://192.168.xxx.xxx/white/0?turn=toggle

Light on and set brightness in %:
http://192.168.xxx.xxx/white/0?brightness=70

Set brightness in %:
http://192.168.xxx.xxx/white/0?brightness=70

Switch on with timer (in seconds):
http://192.168.xxx.xxx/white/0?turn=on&timer=30

Switch off with timer (in seconds):
http://192.168.xxx.xxx/white/0?turn=off&timer=30

Shelly Pro 1

Get status:
http://192.168.xxx.xxx/rpc/Shelly.GetStatus

Relay on:
http://192.168.xxx.xxx/relay/0?turn=on

Relay off:
http://192.168.xxx.xxx/relay/0?turn=off

Relay toggle:
http://192.168.xxx.xxx/relay/0?turn=toggle

Relay on with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=on&timer=30

Relay off with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=off&timer=30

 

Shelly Pro 1PM

Get status:
http://192.168.xxx.xxx/rpc/Shelly.GetStatus

Relay on:
http://192.168.xxx.xxx/relay/0?turn=on

Relay off:
http://192.168.xxx.xxx/relay/0?turn=off

Relay toggle:
http://192.168.xxx.xxx/relay/0?turn=toggle

Relay on with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=on&timer=30

Relay off with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=off&timer=30

 

Shelly Pro 2

Channel 1: 0
Channel 2: 1

Get status:
http://192.168.xxx.xxx/rpc/Shelly.GetStatus

Relay on:
http://192.168.xxx.xxx/relay/0?turn=on

Relay off:
http://192.168.xxx.xxx/relay/0?turn=off

Relay toggle:
http://192.168.xxx.xxx/relay/0?turn=toggle

Relay on with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=on&timer=30

Relay off with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=off&timer=30

Shely Pro 2PM

Channel 1: 0
Channel 2: 1

Get status:
http://192.168.xxx.xxx/rpc/Shelly.GetStatus

Relay on:
http://192.168.xxx.xxx/relay/0?turn=on

Relay off:
http://192.168.xxx.xxx/relay/0?turn=off

Relay toggle:
http://192.168.xxx.xxx/relay/0?turn=toggle

Relay on with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=on&timer=30

Relay off with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=off&timer=30

Shelly Pro 3

Channel 1: 0
Channel 2: 1
Channel 3: 2

Get status:
http://192.168.xxx.xxx/rpc/Shelly.GetStatus

Relay on:
http://192.168.xxx.xxx/relay/0?turn=on

Relay off:
http://192.168.xxx.xxx/relay/0?turn=off

Relay toggle:
http://192.168.xxx.xxx/relay/0?turn=toggle

Relay on with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=on&timer=30

Relay off with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=off&timer=30

Shelly Pro 4PM

Channel 1: 0
Channel 2: 1
Channel 3: 2
Channel 4: 3

Get status:
http://192.168.xxx.xxx/rpc/Shelly.GetStatus

Relay on:
http://192.168.xxx.xxx/relay/0?turn=on

Relay off:
http://192.168.xxx.xxx/relay/0?turn=off

Relay toggle:
http://192.168.xxx.xxx/relay/0?turn=toggle

Relay on with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=on&timer=30

Relay off with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=off&timer=30

Set display brightness (0-100)
http://192.168.xxx.xxx/rpc/Ui.SetConfig?config={“idle_brightness”:10}

Shelly 3EM

Relay on:
http://192.168.xxx.xxx/relay/0?turn=on

Relay off:
http://192.168.xxx.xxx/relay/0?turn=off

Relay toggle:
http://192.168.xxx.xxx/relay/0?turn=toggle

Relay on with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=on&timer=30

Relay off with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=off&timer=30

Measurement data

Read values from channel 0:
http://192.168.xxx.xxx/emeter/0/3em_data

Read values from channel 1:
http://192.168.xxx.xxx/emeter/1/3em_data

Read values from channel 2:
http://192.168.xxx.xxx/emeter/2/3em_data

Download .csv file from channel 0:
http://192.168.xxx.xxx/emeter/0/3em_data.csv

Download .csv file from channel 1:
http://192.168.xxx.xxx/emeter/1/3em_data.csv

Download .csv file from channel 2:
http://192.168.xxx.xxx/emeter/2/3em_data.csv

Shelly Uni

Channel 1: 0
Channel 2: 1

Relay on:
http://192.168.xxx.xxx/relay/0?turn=on

Relay off:
http://192.168.xxx.xxx/relay/0?turn=off

Relay toggle:
http://192.168.xxx.xxx/relay/0?turn=toggle

Relay on with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=on&timer=30

Relay off with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=off&timer=30

Shelly Plug, Plug S, Plus Plug S

Relay on:
http://192.168.xxx.xxx/relay/0?turn=on

Relay off:
http://192.168.xxx.xxx/relay/0?turn=off

Relay toggle:
http://192.168.xxx.xxx/relay/0?turn=toggle

Relay on with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=on&timer=30

Relay off with timer (in seconds):
http://192.168.xxx.xxx/relay/0?turn=off&timer=30

Shelly Duo E27 & GU10

Color mode

Light on:
http://192.168.xxx.xxx/color/0?turn=on

Light off:
http://192.168.xxx.xxx/color/0?turn=off

Light toggle:
http://192.168.xxx.xxx/color/0?turn=toggle

Light on with timer (in seconds):
http://192.168.xxx.xxx/color/0?turn=on&timer=30

Light off with timer (in seconds):
http://192.168.xxx.xxx/color/0?turn=off&timer=30

Light on and set RGB colors (red, green, blue):
http://192.168.xxx.xxx/color/0?turn=on&red=255&green=86&blue=112

Light on and set intensity:
http://192.168.xxx.xxx/color/0?turn=on&gain=27

White mode

Light on:
http://192.168.xxx.xxx/light/0?turn=on

Light off:
http://192.168.xxx.xxx/light/0?turn=off

Light toggle:
http://192.168.xxx.xxx/light/0?turn=toggle

Light on and set brightness in %:
http://192.168.xxx.xxx/light/0?brightness=70

Set brightness in %:
http://192.168.xxx.xxx/light/0?brightness=70

Switch on with timer (in seconds):
http://192.168.xxx.xxx/light/0?turn=on&timer=30

Switch off with timer (in seconds):
http://192.168.xxx.xxx/light/0?turn=off&timer=30

Shelly Vintage

Light on:
http://192.168.xxx.xxx/light/0?turn=on

Light off:
http://192.168.xxx.xxx/light/0?turn=off

Light toggle:
http://192.168.xxx.xxx/light/0?turn=toggle

Light on and set brightness in %:
http://192.168.xxx.xxx/light/0?brightness=70

Set brightness in %:
http://192.168.xxx.xxx/light/0?brightness=70

Switch on with timer (in seconds):
http://192.168.xxx.xxx/light/0?turn=on&timer=30

Switch off with timer (in seconds):
http://192.168.xxx.xxx/light/0?turn=off&timer=30

Shelly TRV

Auto temperature control:
http://192.168.xxx.xxx/settings/thermostat/0/?target_t_enabled=1
On: 1
Off: 0

Auto temperature control on and set target temp:
http://192.168.xxx.xxx/settings/thermostat/0?target_t_enabled=1&target_t=10
Target temp: 4-31

Auto temp off and set valve position:
http://192.168.xxx.xxx/thermostat/0?pos=10
Valve position: 0-100 %

Schedule on/off:
http://192.168.xxx.xxx/settings/thermostat/0?schedule=0
On: 1
Off: 0

Boost start (in minutes):
http://192.168.xxx.xxx/thermostat/0?boost_minutes=10

Calibration:
http://192.168.xxx.xxx/calibrate