u/Oxynat0r

Flash your own ESPHome image onto a Shelly over the air (Gen2/3/4, no UART for the flash itself) - testers wanted
▲ 34 r/Esphome

Flash your own ESPHome image onto a Shelly over the air (Gen2/3/4, no UART for the flash itself) - testers wanted

Hi all,

I wrote a small Python tool that puts your own ESPHome firmware on a Shelly without opening it. It takes Shelly's official OTA package, swaps in your ESPHome image and sends it through the stock updater. It checks the device first and refuses if the update would land in the wrong slot. https://github.com/oxynatOr/free-shelly-ota (Apache 2.0). There is one page per device with pins, ESPHome config and the exact commands: https://github.com/oxynatOr/free-shelly-ota/tree/main/docs/devices

python ota.py fetch PlugMG3 --insecure
python ota.py build PlugMG3 app.ota.bin --esphome-factory app.factory.bin --esphome-yaml my-plug.yaml
python ota.py send PlugMG3 out/PlugMG3-app-<date>.zip --watch 60

It has run on real devices:

Plug M Gen3, Plug S Gen3, H&T Gen3, Plus Plug S (Gen2, no UART), Power Strip 4 Gen4 (boots, outlets not checked) and the Multicolor Bulb Gen3 (flash works, LED driver not confirmed).

Profiles for six more exist (Duo Bulb, The Pill, Mini 1PM Gen3/Gen4, Zigbee variants), but nobody has flashed them with this tool yet.

That is where I need help. I can't test every model myself, so if you have another Shelly and accept the risk below, I would love a report, also when it worked: Device report (remove Wi-Fi data, keys and MAC addresses from the log first). Your model is missing? Request a new device and tell me if you can test it.

It is experimental, so please be careful:

  • The recommended method replaces Shelly's bootloader. If that does not suit a model, only UART/USB brings it back. Use a device   you can afford to lose, and know your way back before you start (The Pill: USB-C, H&T Gen3: bare test pads, others need   soldering). Never connect a serial adapter to a device that is plugged into mains.
  • It voids the warranty and can brick the device. You carry the risk.
  • The repo has no ESPHome binaries and no Shelly firmware. You compile your own image; the tool downloads the official package.
  • The built package can contain your Wi-Fi password, so don't share it. Next on my list are the open checks (bulb light, power strip outlets), then Tasmota as a second target.
  • Next on my list are the open checks (bulb light, power strip outlets), then Tasmota as a second target. No date yet.
  • back to Shelly over the air.

Not affiliated with Shelly or ESPHome.

Thanks to tasmota/mgos32-to-tasmota32, inventor7777/ESPHome-Shelly-Plus-Plug-US and automatous-io/shelly-gen4-esphome, whose research this builds on.

u/Oxynat0r — 5 days ago