Webhooks / HTTP(S) requests

Introduction

Scroll down to see an overview of the most commonly used HTTP actions, or try the RPC Command Generator.

Please note that this guide only covers the legacy HTTP command format.
All Shelly Gen2 devices also support HTTP RPC commands, which offer extended functionality and improved flexibility.

For more information, visit the official documentation:
https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/HTTP

Legacy HTTP vs. RPC Commands

Shelly devices support two main types of control commands: Legacy HTTP actions and HTTP RPC (Remote Procedure Call) commands.
Understanding the difference between the two is essential when integrating Shelly devices into automation systems or custom scripts.

1. Legacy HTTP Actions

Legacy HTTP actions are the original command format used across early Shelly generations (Gen1).
They are simple, URL-based requests that can trigger specific device behaviors such as turning relays ON/OFF, setting brightness, etc.

Example (Legacy HTTP):

http://192.168.33.1/relay/0/on

Legacy HTTP actions are ideal for basic integrations and backward compatibility.
However, they are gradually being replaced by RPC-based communication, which provides more flexibility and precision.

2. HTTP RPC Commands

The new RPC (Remote Procedure Call) protocol was introduced with Shelly Gen2 devices.
It allows structured JSON-based communication, making it easier to exchange data and manage complex configurations through both local and cloud APIs.

Example (RPC Command):

http://192.168.33.1/rpc/Switch.Set?id=0&on=true

RPC commands support a wide range of components such as Switch, Light, Cover, Input, and Thermostat, offering full parameter control and more reliable communication.

3. Choosing Between the Two

  • Use Legacy HTTP actions when working with Gen1 devices or when backward compatibility is required.
  • Use RPC commands for Gen2 devices to benefit from structured data, advanced features, and extended automation options.

How it works

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 of 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.

The Action settings can be accessed from the Settings tab.

You can open it via the Shelly Smart Control app, the web interface at https://control.shelly.cloud, or directly through the device’s local IP address (the layout may vary slightly).

From there, select Add Action to create a new 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.

How to build a URL Action

We can generally divide the devices into four main categories:

  • Relays
  • Roller Shutters
  • 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 (WiFi model)

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

DDD Command Generator

Our colleagues in Poland have developed a DDD Wizard, a convenient tool that helps you generate RPC commands for local device control.
The generator will be continuously updated with new features and improvements.

Link to the original GitHub repository:

https://github.com/pietia28/shelly-ddd-wizard-2.0/tree/main