Shelly 2.5 Power Monitoring Relay

Shelly 2.5

Available from:


GPIO #Component
GPIO00 Led1i
GPIO01 User
GPIO02 Button1
GPIO03 User
GPIO04 Relay1
GPIO05 Switch2n
GPIO09 None
GPIO10 None
GPIO13 Switch1n
GPIO15 Relay2
FLAG Temperature


{"NAME":"Shelly 2.5","GPIO":[56,255,17,255,21,83,0,0,6,82,5,22,156],"FLAG":2,"BASE":18}
For more accurate energy consumption measurements this device requires power monitoring calibration.

⚠️️Special Shelly Attention⚠️️

Do not connect AC power and the serial connection at the same time The GND connection of the Shelly has a 50% chance of being connected to the live AC wire. Connecting serial with your PC will fry your PC.

Do not connect any additional sensors to serial pins. It can at least destroy your Shelly!

Shelly 2.5

Warning (April 10, 2019): https://www.facebook.com/groups/ShellyIoTCommunitySupport/permalink/2029876037111750/

This appears to affect a percentage of their entire first run production. Check your device before powering it on.

An ESP8266 with 2MB flash dual relay device with Energy Monitoring. Slightly smaller than the original Shelly 2.


Serial Flashing

New Shelly 2.5 model comes with a partially exposed programming/debug header which can be used to flash Tasmota on the device. A USB-to-UART adapter is needed as well as a reliable 3.3V with at least 350 mA drive capability. The following diagram shows the device pinout.

To be able to flash the Tasmota firmware you need to get into flash mode. Therefore connect a wire from GPIO0 to ground. For further information have a look at bringing-the-module-in-flash-mode.

Device Configuration

As the Temperature sensor uses the Analog input the firmware needs to be compiled with //#define USE_ADC_VCC.

If you connect momentary switches and want press/double press/hold functionality, use the following template:

{"NAME":"Shelly 2.5 (buttons)","GPIO":[56,255,17,255,21,127,0,0,6,128,5,22,156],"FLAG":2,"BASE":18}

and run command

backlog SetOption1 1; SetOption11 1; SetOption32 1

to enable all three states. Button1 is the button on the back of the device, Button2 and Button3 are the externally connected buttons.


Tasmota will disable serial logging after a restart as the communication between Tasmota and the Energy Monitoring chip is using the same serial interface. Make sure not to enable SerialLog as it will interfere with the Energy Monitoring functionality.

To calibrate the Energy monitoring feature connect a known load and execute the commands shown below. Assumed an AC voltage of 240V, a resistive load of 60W and a line frequency of 50Hz. With a load of 60W the current should be 60W / 240V = 0.25A.

FrequencySet 50.000
PowerSet 60.00
VoltageSet 240.0
CurrentSet 250.0

Pause a few seconds between executing the commands as the communication between Tasmota and the Energy Monitoring chip is a serial interface which can take over a second to complete.


The manufacturer’s maximum operating internal temperature is 90 degrees Centigrade. For safe operation, Tasmota overtemp is set to 73C which will power off relays when reached.

Use rules to control shutter endpoints

As the Shelly 2.5 contains energy monitoring you can use rules to power off the shutter when too much current is drawn at the end point. The below rule will power off both directions when the current becomes more than 500mA.

rule on energy#current>0.500 do backlog power1 0; power2 0 endon
rule 1
rule 5

Video tutorial by Jelle Peters