Flash Sonoff MiniR2(firmware 3.6.0) with ESPHome Over the Air

I hope this instruction on how you can flash the Sonoff MiniR2 with with firmware 3.6.0(without the jumper) using a ESPHome .bin created from the ESPHome integration and Sonoffs DIY tool.

WARNING i don’t know if its possible to reverse the part where you unlock OTA in step 7.

All credit goes to Chad on YouTube How to flash Tasmota on a Sonoff MINIR2 with firmware 3.6.0. There is no jumper on this version - YouTube and this is mostly a write up of that video.

  1. Setup a 2.4GHz WiFi access point with;

SSID: sonoffDiy
Security Mode: WPA-Personal
Wireless password: 20170618sn

  1. Connect the Sonoff Mini R2 to power, wait for it to flash the blue LED in pulses of three, hold the button the Sonoff for approximately 5 seconds and it should start to single flash fast. After a short time it should come up as an “ITEAD-something” access point in your available networks

  2. Connect to the ITEAD-access point using
    Wireless password: 12345678

You should now have been given an IP-address of by the ITEAD-access point

  1. Open a web browser and enter the ITEAD-access points IP-address as url

You should now be presented with an overly zoomed in web page like this

  1. Click on “WIFI SETTING”

You should now be presented with

  1. Enter the following and then click “Save”

Network name(SSID): sonoffDiy
Network password: 20170618sn

The Sonoff should now connect to the SSID you set up at step one.

If you need to, look up the IP-address the Sonoff got by for example checking your routers DHCP leases, i had my DHCP pool for this network set so i got need to replace this with your Sonoffs IP-address. In my case i was doing ten of these i had to delete/clear the DHCP lease for each Sonoff as i progressed i cant tell why but if i didn’t i had to start over from step two(2) after i cleared the lease.

  1. Here i used the RESTer plugin for Chrome (RESTer - Chrome Web Store). And added the following as shown in the screenshots.

Choose Method “POST”

Enter URL:
Click “BODY”
Enter: {“data”: {}}

Click “SEND”

It should return some information like in the screenshot

To enable Over the Air (WARNING, i don’t know if its possible to set this back to false) updates edit the URL to

Click “SEND”

It should return some new information and “error”: 0

The last step here is just if you want to check that “otaUnlock” should be set to ‘true’.
Enter URL:

Click “SEND”

And you should hopefully get a result like this

  1. Open up the DIY tool (i used tool_01DIY85(3.3.0 from here Sonoff_Devices_DIY_Tools/tool at master · itead/Sonoff_Devices_DIY_Tools · GitHub).exe)

The Sonoff should be visible, you can try toggling the relay to be sure that the one listed is the one we are working with.

Click “Firmware flash”

In the dialog that opens, select your ESPHome .bin file you created for it(Chad flashes it using a Tasmota .bin so i guess any compatible firmware should work but i haven’t tried).

Now you are at the point of no return so double check everything.

Click “Flash device list” even if there is a device listed

Now you are even closer the point of no return so double check everything again.

Click OK to start the flash process

That should be all, momentarily you ESPHome flashed Sonoff should be discovered by the integration.

Here’s my config for these if it is any use to someone, its frankensteined from this forum and other sources

  device_name: sonoff_mini_r2_template

  name: ${device_name}
  platform: ESP8266
  board: esp8285

  - ssid: the_ssid
    password: the_password
    hidden: true
  domain: .localdomain

  # Enable fallback hotspot (captive portal) in case wifi connection fails
    ssid: "${device_name}_Hotspot"
    password: "the_fallback_password"


# Enable logging

# Enable Web server
  port: 80

# Enable Home Assistant API
#  password: "api_password"

# Enable Over The Air update
#  password: "ota_password"

  - platform: homeassistant
    id: homeassistant_time

# Extra sensor to keep track of plug uptime
  - platform: uptime
    name: ${device_name}_Uptime Sensor
      - lambda: return x / 3600;
    unit_of_measurement: "hours"
    accuracy_decimals: 2

# Extra sensor for WiFi signal
  - platform: wifi_signal
    name: ${device_name}_WiFi Sensor
    update_interval: 60s

    number: GPIO13
    inverted: true

  - platform: gpio
    id: relay_1
    pin: GPIO12

  - platform: binary
    id: light_1
    name: ${device_name}_Lights
    output: relay_1    

  - platform: gpio
    pin: GPIO00
    id: reset
    internal: true
      - invert:
      - delayed_off: 10ms
      - light.toggle: 
          id: light_1

  - platform: gpio
    name: ${device_name}_Lights
    pin: GPIO04
    id: switch_1
#        - switch.turn_on:
        - light.toggle: 
            id: light_1
#        - switch.turn_off:
        - light.toggle: 
            id: light_1

If you are having trouble with the above method or use Linux/Mac this method is much faster and easier to do, as you don’t need to create a special hotspot with a specific password:

Take a look at this repository and download the script:

Quick instructions:
1.- Power on the sonoff
2.- press the button for 5 seconds
3.- Connect to the ITEAD-xxx hotspot
4.- Browse to
5.- Enter your home wifi settings
6.- Connect your computer back to your home network
7.- Locate the IP address of the sonoff given by your router.
8.- Run the script this way:

./sonoff-ota-flash.sh -i ip_address_of_sonoff

Wait for a bit until the flashing finishes. And voilà!, Tasmota will be installed

Flashing ESPHome:

9.- Connect to the tasmota-xxx hotspot
10.- Browse to
11.- Enter your home WiFi Settings
12.- Connect back to your home network
13.- Browse to http://ip_address_of_sonoff in your home network
14.- Select firmware upgrade and select the esphome binary file you have created.

Explanation video:


I have a sonoff mini DIY wifi (I think it is the first version, not the R2), will this process work as well or I need to do something different? (I think there is a little “jumper” that I need to use in order to start the flashing process…)

any help is much appreciated.

Thank you


Sorry for the late reply. Unfortunately i don’t know but according to this guide How To: Flash a Sonoff Mini to ESPHome – 2021-01 version it kind of indicates that it should (looking at “The OTA process I used” step 2, 3 and 4). But i really have no idea as i only have R2s, sorry.

BTW, thanks for adding the linux method @jpeletier looks way easier if you have a linux/mac box

Hello, by any chance, does the SonOff mini R2 support bluetooth? Can we use it for bluetooth proxy? Trying to see what existing device I already have to perform this instead of buying and adding a dedicated one.

Hi, to my knowledge the R2s uses an ESP8285 or 8266 and doesn’t have BT.

Thanks a lot! Saved me some time on soldering as I did before ))

Did you manage to update the firmware on the Mini v1 with this method? Amy additional step was required?