Open-source project
AlexxIT/SonoffLAN avatar
AlexxIT/SonoffLAN

SonoffLAN: controlling eWeLink Sonoff devices from Home Assistant without reflashing

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant

3,355 stars481 forksPythonMIT

At a glance

What is it?
SonoffLAN is a Home Assistant custom component that talks to Sonoff devices running the original eWeLink firmware over the local network, the cloud, or both. It avoids reflashing, but the local protocol is not always stable and power sensors are moving to LAN-only updates.
Who is it for?
SonoffLAN fits Home Assistant users who want to keep stock eWeLink firmware and accept the cloud for reliability; it is the wrong tool for anyone who wants a fully offline, guaranteed-stable local integration, and it is unnecessary for devices already flashed with ESPHome or Tasmota.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 6 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • AlexxIT/SonoffLAN3,355 ★ · +41
Star history
Repository2026-09-252026-11-23
AlexxIT/SonoffLAN3.3k3.4k

41 Stars in the last 59 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What SonoffLAN solves for eWeLink device owners

Most Sonoff devices ship with eWeLink firmware and are meant to be controlled through the eWeLink app or cloud. Getting them into Home Assistant normally means flashing alternative firmware, which voids the point of buying the stock device and requires physical access. SonoffLAN takes the other route: it is a Home Assistant custom component that speaks the original eWeLink protocol, so devices stay on factory firmware and stay usable in the eWeLink app. The README lists the intended audience plainly: people with devices that have no DIY mode, devices that do have DIY mode, single and multi-channel units, TH and Pow sensor models, and the RF Bridge 433. It is for a household already committed to Home Assistant that wants Sonoff hardware visible as entities without a soldering iron or a serial adapter. The trade-off is that you inherit the quirks of a protocol you do not control.

How the local, cloud and auto modes actually route traffic

SonoffLAN offers three connection modes. In auto mode the component uses both local and cloud connections, preferring LAN when a device is reachable and falling back to the cloud otherwise. local and cloud modes restrict it to one path. Each time the integration starts it loads the device list from the eWeLink servers, including names and encryption keys, and saves it under /config/.storage/sonoff/. That saved list matters: auto and local modes can keep working without internet, because if the cloud is unreachable the component falls back to the stored device list and runs local-only, while auto keeps retrying the cloud. Local mode still needs eWeLink credentials, because the local protocol is encrypted and the keys come from the cloud. The exception is DIY-mode devices, whose protocol is unencrypted and can be used without credentials. State updates arrive through local multicast or a cloud websocket, which is why mDNS/zeroconf traffic between Home Assistant and the devices is a hard requirement for the local path.

Installing SonoffLAN through HACS and adding the first account

The README gives two install routes: HACS, or manually copying the sonoff folder from the latest release into custom_components in your Home Assistant config folder. HACS is the maintained path, and the repository is in the HACS default set, so it can be added from the store without a custom repository URL. After installation, add the integration from the Home Assistant UI; the README notes you can set up multiple integrations with different eWeLink accounts. The configuration flow is reached from the integrations page:

bash
# manual install, from the Home Assistant config directory
# copy the sonoff folder from the latest release into:
# custom_components/sonoff

Once the integration is added, open its options (Settings > Integrations > Sonoff > Configure) and pick a mode. The README recommends auto over local or DIY, and the reason is stated directly: the local protocol is not always stable, devices may disappear from the network or fail to answer local requests, and some Pow and TH devices cannot update their sensors without a cloud connection. For troubleshooting, enable the debug page in the integration options; a link with a random token appears in a notification and in the Home Assistant log, and the page shows only integration logs with some private data removed. A link looks like this:

bash
http://192.168.1.123:8123/api/sonoff/c8503fee-88fb-4a18-84d9-abb782bf0aa7?q=1000xxxxxx&r=2

You can filter the log by device ID and set auto refresh in seconds. There is also YAML configuration for finer control, including custom device_class, custom devices, custom sensors, force update and settings aimed at preventing database size growth. DeviceID is always a 10-character string taken from the entity_id or the eWeLink app, which is the identifier you will paste into those YAML blocks.

The 2026 cloud sensor change and other reasons local-only disappoints

The README carries a caution that starting in 2026, power, current and voltage sensors will no longer be updated via the cloud connection. The stated cause is load on the eWeLink cloud: those updates were blocked by the cloud itself. For anyone monitoring energy through a Pow device, that removes the cloud fallback for exactly the entities they care about, and it pushes those readings onto the local connection. The README already warns that some Pow and TH devices cannot update their sensors without a cloud connection, so the two statements together leave a narrow path for energy monitoring. The second limitation is structural: local mode depends on multicast mDNS/zeroconf working between Home Assistant and the devices, and the README devotes a section to common problems in only-LAN mode. If your network blocks multicast or spans VLANs, local mode degrades in ways that look like flaky hardware. The README's own advice is to use auto mode and avoid local or DIY, which is an admission that the local protocol is not a dependable primary transport. Anyone wanting a deterministic, fully offline integration should treat that as a boundary rather than a configuration detail.

Where SonoffLAN sits next to flashing and stock-app alternatives

The obvious alternative for the same hardware is flashing the devices with ESPHome or Tasmota and integrating those directly with Home Assistant. The difference is in who owns the protocol. Flashed firmware gives you a documented local API you control, no eWeLink account, no cloud dependency, and no risk that a vendor-side change alters behaviour; the cost is physical access to each device, losing the eWeLink app, and taking on firmware maintenance yourself. SonoffLAN keeps the vendor firmware and the vendor app, adds cloud and local transports, and accepts that the cloud can change the rules, as the 2026 sensor notice shows. A third option is leaving everything in the eWeLink app and using no Home Assistant integration at all, which is simpler but gives up automations and dashboards. SonoffLAN is the middle path: less control than flashed firmware, more integration than the app alone. The README also points to a DEVICES.md list and a component review video, which are the practical references for checking whether a specific model is covered before committing.

Maintenance, licence and upgrade cost

The repository is not archived, and the last push was on 2026-09-23, with v3.13.1 released the same day and v3.13.0 on 2026-09-14. Releases are therefore current, and the project is maintained. Upgrades through HACS are the low-friction path, but each Home Assistant restart reloads the device list from the cloud and rewrites the saved copy in /config/.storage/sonoff/, so a cloud outage during a restart is a moment to be aware of. The licence is MIT, which permits reuse and modification with the usual attribution and warranty disclaimer; that is a statement about the licence text, not legal advice, and anyone redistributing a modified copy should read LICENSE.md themselves. The real upgrade cost is not the code but the coupling to eWeLink: cloud API changes, credential requirements, and the 2026 sensor decision are all outside the project's control, and the README's caution block is the clearest signal that this coupling has already caused a functional regression.

Editorial conclusion

SonoffLAN fits Home Assistant users who want to keep stock eWeLink firmware and accept the cloud for reliability; it is the wrong tool for anyone who wants a fully offline, guaranteed-stable local integration, and it is unnecessary for devices already flashed with ESPHome or Tasmota. Before adopting it, confirm your Home Assistant has working mDNS/zeroconf multicast to the devices, check the System Health page for online device counts, and read the DEVICES.md list for your exact model. The 2026 change that stops power, current and voltage sensor updates over the cloud is the deciding factor if you rely on those sensors.

Frequently asked questions

Can I use SonoffLAN with Home Assistant?

Yes, SonoffLAN is a Home Assistant custom component installed through HACS or by copying the sonoff folder into custom_components, then added via the Home Assistant UI as an integration.

How do I install SonoffLAN in Home Assistant?

Install it via HACS, or manually copy the sonoff folder from the latest release into the custom_components folder in your Home Assistant config folder, then add the integration from the Home Assistant UI.

What is SonoffLAN?

It is a Home Assistant custom component for controlling Sonoff devices that run the original eWeLink firmware, over the local network, the cloud, or both.

Can I use SonoffLAN without internet access?

The README states that auto and local modes can work without an internet connection: if the integration cannot reach the cloud it falls back to the previously saved device list and continues in local mode, while auto mode keeps retrying the cloud. Local mode still needs eWeLink credentials for the device encryption keys, except for DIY-mode devices, whose protocol is unencrypted.

Official sources

  1. AlexxIT/SonoffLAN on GitHub
  2. Issues
  3. License: MIT
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/alexxit-sonofflan.svg)](https://hysenlabs.com/projects/alexxit-sonofflan)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/alexxit-sonofflan.svg)](https://hysenlabs.com/projects/alexxit-sonofflan)

Was this useful?