Shelly ESPhome OTA conversion Guide

Be aware that this guide has issues until PR has come through in esphome

Since the newer Shelly’s don’t come with a header anymore, I decided it might come in handy to write a guide how to flash them OTA (using the tasmota firmware intermediately).
But basically, the same applies to many models.

  1. Download mgos32-to-tasmota32-mini1g3.zip or any of the other supported models from latest release https://github.com/tasmota/mgos32-to-tasmota32/releases
  2. Power up the shelly and connect to it’s wifi AP.
  3. Open the settings/firmware page (http://192.168.33.1/#/settings/firmware)
  4. Drop or open the the downloaded tasmota firmware from step 1
  5. Wait for the device to boot and connect to the Tasmota AP (http://192.168.4.1)
  6. Connect the device to your own wifi network and open its webpage.
  7. Click on Configuration, then Auto-configuration, select Shelly Mini1G3 (or the model you’re flashing), then hit the apply button. This replaces the locked bootloader (without this step device gets bricked with the next boot !!).
    image
  8. Under consoles, open the Partition Wizard and start the Safeboot Conversion by hitting the button “Start Migration”. The conversion will update to the latest Tasmota version also (this might take a while, so be patient).
    image
  9. After the reboot, open the Partition Wizard again (under tools) and increase the Filesystem size to its maximum. This removes all obsolete files too.
    image
  10. On the ESPHome (addon) page, create a new device and use the yaml from esphome.io. Use one of the Shelly’s listed here (or write your own yaml).
  11. Hit the install button, and use manual download, after compilation, use legacy to download the .bin file.
  12. Open the tasmota webpage and upload the newly compiled esphome firmware from step 11
    image
  13. After it reboots you should have your device available as a esphome device :wink:

Please note it seems there are some issues:

6 Likes

Just found out the same applies to many shelly models :stuck_out_tongue:

Device State
Shelly PlusHT :warning:untested
Shelly PlusPlugS :white_check_mark:tested
Shelly PlusPlugUK :white_check_mark:tested
Shelly PlusPlugIT :warning:untested
Shelly PlusPlugUS :white_check_mark:tested
Shelly PlusI4 :white_check_mark:tested
Shelly PlusWallDimmer :warning: no Tasmota support
Shelly Plus1PM :white_check_mark:tested
Shelly Plus1 :white_check_mark:tested
Shelly Plus2PM :white_check_mark:tested
Shelly PlusRGBWPM :white_check_mark:tested
Shelly Pro1 :white_check_mark:tested
Shelly Pro1PM :white_check_mark:tested
Shelly Pro2 :white_check_mark:tested
Shelly Pro2PM :white_check_mark:tested
Shelly Pro3 :warning:untested
Shelly Pro4PM :white_check_mark:tested
Shelly Pro3EM :warning:untested
Shelly Plus1PMMini :white_check_mark:tested
Shelly Plus1Mini :white_check_mark:tested
Shelly PlusPMMini :white_check_mark:tested
Shelly Plus10V :white_check_mark:tested
Shelly PlusUni :white_check_mark:tested
Shelly Mini1PMG3 :white_check_mark:tested
Shelly Mini1G3 :white_check_mark:tested
Shelly MiniPMG3 :white_check_mark:tested

Although there might be some issues uploading the firmware to older units, as with some of them you can only specidy an url where the firmware is downloaded from.
I used my own webserver for this purpose :thinking:

1 Like

Thank you for this guide. I followed this guide up to the Partition Wizard. When I click on the Partition Wizard button, I just get a blank page. The URL is: http://192.168.1.121/part_wiz?

I used: mgos32-to-tasmota32-PlugUS

@baerrs I don’t think I can be of any help.

Maybe ask on Github?

Hi! Are you able to update your new node via OTA? I could successfully complete your whole guide but sadly now I’m stuck with a node which I cannot update.

Apparently I’m not the only one with this issue. The only way around this seems to be flashing via serial, which completely eliminates the purpose of going this way via tasmota.

Yeah, i successfully re-firmed 6 shelly 1 gen3 last week, no issues at all.
I used mgos32-to-tasmota32-mini1g3.zip

I tried this with the Shelly Mini Gen3 and while it worked, OTA afterwards results in the “ERROR Error binary size: Unknown error from ESP” message, just like @baerrs reported.

Sorry…i misread the complaint…i suffer from the same :thinking:

Just ran into the same issue. Did you find a solution or a workaround?
(I went through the full Tasmota based migration and am on the latest esphome build)

I’ve been successfully using the code on this PR when converting from Tasmota (as per the above instructions) to ESPhome. I’m not sure if this related to the “Error binary size” message above. It used to be the case that if you didn’t use the above PR, the initial ESPhome conversion would work, but then all subsequent updates would fail silently.

1 Like

Thanks for confirming it is fixed…but…the esp’s flashed before this PR can still only be updated by serial; OTA will not work on them…

I don’t think it is “fixed” - that PR hasn’t been merged, so if you want to OTA convert newer Shellys you need to check out that branch of esphome to do the initial conversion. And yes, if you do the initial esphome conversion without this, serial is the only way out.

Thanks for the update @pdw , good job !!

Hi there,

Maybe a warning on top of this Guide, that OTA doesn’t work when you use this guide at the moment, would be nice.

Just used your guide today (HA is up to date) and I forgot one option in my config. After trying an OTA I get the error : ERROR Error binary size: Unknown error from ESP. Only then I read the comments :frowning:

But thanks for the guide anyway … Although I hate the idea of using serial on the next ESPHome update, also because I built-in the Shelly in floodlight unit :expressionless:

Done so (you could have done yourself; this is a wiki topic :wink:)

I didn’t find it necessary, as it is mentioned in the 6th or 7th post :thinking:

1 Like

I’m still a bit confused… if i understand correctly there are two options: either option explained above or option from mentioned PR… or not?
Please correct me if i’m wrong, but as i understand it’s so that if i convert according to first post here i’m stuck without OTA, but if i follow PR it’s ok ?

If you use an esphome repository that includes the mentioned PR (pull request), you will not have any issues.

So you could fork your own version, insert the PR, and then use that to flash…

1 Like

…or just go the solder-and-serial-flash route. With all the steps needed for the migration, I found the traditional way easier. Especially after running into the mentioned problems and as I wanted to flash multiple devices.
Given, this requires the soldering skills to deal with the tiny PCB.

So, are you saying that doing via uart none of above steps are necessary and it “just goes” with standard flashing from esphome web?

I always do first flashing via serial anyway. (Ok, the problem would be module like shelly plug, which is a pain to disassemble, as I’ve read).

Uart always works (but is a pain in the a** on Shelly Mini’s, they only have tiny soldering pads :frowning: )

1 Like