Sonoff DIY Mode API protocol (official REST API from ITEAD) component?

ITEAD has released a two newish devices in their Sonoff series (Sonoff Basic R3 & Sonoff Mini) which has an updated firmware that includes a new feature called “DIY mode” which when enabled deactivate the default eWeLink mode (cloud functionality) and instead activate a new official REST API from ITEAD meant for only local control via LAN.

ITEAD have named this new RESTful API API “Sonoff DIY Mode API protocol”, it looks to be released as open source and is designed for local control these newer Sonoff devices over a LAN network without using their cloud or going via the internet.

Hopefully, someone more skilled than I could write a dedicated Sonoff component for Home Assistant that uses this new official REST API from ITEAD which in turns could mean that people do not have to flash on a third-party firmware or use the cloud/internet to control their newer Sonoff devices with Home Assistant in the future.

https://www.itead.cc/sonoff-mini.html
Sonoff Mini product page reads: “It supports the DIY mode (designed for developers) which allows users to integrate MINI into worldwide third-party open source smart home control system to achieve LAN control without cloud service, such as Home Assistant, openHAB, ioBroker .etc.

https://www.itead.cc/sonoff-basicr3-wifi-diy-smart-switch.html
Sonoff Basic R3 product page reads: “…it has a DIY mode that is the firmware can be user-defined. Built-in a web server that exposes the REST API, which allows you to connect the switch with your existing home automation system. Compatible with Vera, Fibaro, HomeSeer, Savant, Home Assistant, etc, for the protocol document and the code for the DIY Mode tool (updating), please go to Github

To enable this “DIY mode” you actually have to open the device physically move a jumper switch on the circuit board, as per Sonoff DIY Mode API protocol document:

Why use scuh API when all you need to do is reflash the ESP inside these devices with firmware like ESPHome that natively integrates with HA ?

There are many reasons to use original firmware and discussion those here are off-topic regardless.

6 Likes

I have bought one of the new “mini” relays and I’m keen to try use this API because it looks like you can also use it to flash a new firmware (like tasmota) to it without having to solder. On most of these devices you now need to be a soldering ninja to get it working so being able to flash OTA would be awesome!

I’ve been actually working on this. I’ve just received a new version of the firmware that should solve a couple of issue preventing the implementation.

1 Like

Hi all, there another thread that relates to this here New custom component: Sonoff LAN Mode (local, with stock firmware)

I have a custom component that works with the DIY mode as well as non DIY mode switches with stock firmware here https://github.com/mattsaxon/sonoff-lan-mode-homeassistant

The component works without connection to the cloud in either mode.