Shelly ESPhome OTA conversion Guide

Yeah, it’s a nightmare, agreed,if you’re not familiar with smd’s. Those pads fall off pretty quickly.
I do a lot with smd’s, though, so it’s no problem for me (i do that under a microscope). But i still wouldn’t do that each time - only first conversion shelly -->esphome, all later updates must be over OTA.

I guess i’ll have to buy and sacrifice one shelly for science…

Just for the avoidance of doubt, you need to have that PR and carefully follow the instructions described there. In particular, the first esphome firmware you flash onto the device from Tasmota must have unprotected_writes: True in the ota config. If it doesn’t it’s bricked and needs serial to recover.

You then need to do the upload-factory-ota step to complete the conversion. After that, you can switch back to latest esphome and use OTA as normal.

2 Likes

Very smart remark…thanks!
So your ESP-Home version must not only have the PR, but also this in the yaml:

ota:
  unprotected_writes: True # This is mandatory if you want to flash the partition table or bootloader!

As soon as the PR made it in I’ll update the thread :wink:

For people that don’t exactly know what to do here, can someone document steps to actually use this PR? I will admit I didn’t read every message in the thread but I didn’t see where someone said here’s how to setup an ESPHome environment with this PR baked in to do your first flash.

So, let me get this straight:

I have new Shelly PlugS and I want to flash Tasmota on it. Do I follow the steps and that’s it?

About a year ago I could just flash OTA in 1 step and they were done. That has changed I guess.

Well, the current status is that it will work, provided you use an alternative ESPHome addon (one that includes the Pull Request to support the new chipset).
With the official addon it will only work one time; any attempt to do OTA will result in “ERROR Error binary size: Unknown error from ESP”

So, until the PR makes it into the official release it remains dodgy…

And yes, it used to be more easy; just compile the binaries in ESPHome and upload…no need to detour through Tasmota… This is because of the new chipset used in the Shelly Mini devices :frowning:

I found out after I found out I made a mistake in my button configuration. Luckily, I also use some other shelly’s in detached mode, so I just needed to swap them around a bit (as it turned out to be very difficult to program by uart, the soldering point are very small)

Hey guys,
to my surprise I just ran into this article, which got most of this right - and it’s from October last year :smiley:

https://brunner.ninja/2024/10/18/flashing-esphome-on-shelly-1-mini-gen3/

Thanks. I don’t understand a few of the technical terms though.

I just use Domoticz and have every old(er) Shelly PlugS flashed with Tasmota. I want to do the same with the 3 Shelly PlugS that I bought a week ago to be able to use them in Domoticz with MQTT without having to open them.

Tasmota shouldn’t be an issue (i think),

The problem at hand only applies to the new Shelly Mini’s in combination with ESPHome.

It depends a bit on what chip set they’re running on…

Hahaha, I must be sure ofcourse.

I found this video: https://www.youtube.com/watch?v=_Xv1U5Fz2Y4

It points me to a list:Releases · tasmota/mgos32-to-tasmota32 · GitHub

But my Shelly PlugS Gen3 isn’t listed. It’s actually not the Shelly PlusPlugS. So, I’m hesitant to use that firmware.

If I look at the specs, the Shelly PlugSGen3 and the Shelly 1 Mini Gen3 use the same CPU:
Microcontroller unit
CPU: ESP-Shelly-C38F

So I guess it applies…

I followed the guide and is now in “Error binary size” state.

I should have followed the steps right because unprotected_writes: True would throw an error when compiled on esphome without the PR.

Hi guys,
I have exactly the issue that I cannot update (ota) Shelly mini gen3 as I have obviously the wrong firmware flashed.
Hence, I have opened it and soldered the pins which was a pain in the ass. I believe as well I will never do it a second time successfully.

Hence two questions:
1)
Could somebody be please share which yaml/config I need to take to ensure updateability via over the air.

I get the serial output, but cannot flash it. How do I get the mini into flash mode?

Thx
SL

I followed every step using the code from Read/Write bootloader, partition table and any partition via OTA by angelnu · Pull Request #5535 · esphome/esphome · GitHub
ans still got:

19:38:21	[I]	[ota:464]	
OTA type is 1 and size is 1409776 bytes
19:38:21	[E]	[ota:110]	
Aborting to avoid overriding running partition
19:38:21	[E]	[ota:112]	
New partition - addr: 0x0f0000; size: 0x530000
19:38:21	[E]	[ota:114]	
Running partition - addr: 0x0f0000; size: 0x530000
19:38:21	[I]	[ota:282]	
PARTITION TABLE
19:38:21	[I]	[ota:283]	
===============
19:38:21	[I]	[ota:289]	
type: 0x01; subtype: 0x00; addr: 0x010000; size: 0x002000; label: ota
19:38:21	[I]	[ota:289]	
type: 0x01; subtype: 0x02; addr: 0x014000; size: 0x00c000; label:
19:38:21	[I]	[ota:289]	
type: 0x00; subtype: 0x00; addr: 0x020000; size: 0x0d0000; label: safe
19:38:21	[I]	[ota:289]	
type: 0x00; subtype: 0x10; addr: 0x0f0000; size: 0x530000; label: 
19:38:21	[I]	[ota:289]	
type: 0x01; subtype: 0x82; addr: 0x620000; size: 0x1e0000;

so I’m not sure if there is anyway to make it work with OTA without using UART.

does it work good with the Shelly 1 Mini Gen 3? or what shelly device would you prefer for a good BLE Proxy under ESP Home? can i use the first post as instructions or i have to do some other things…it is totaly wired here.

@adam123 made a good guide on how to create your oen fork with the correct pull-request