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

This is a great component, I have been using with iFan03 for a while now.
Control from HA and RF remote is perfect.
The problem is, that the wife turns the fan off and on at the switch - expecting the fan to turn on when switched. I have had some success with HA automation trigger on online attribute, however this does not work if switched more frequently than the refresh interval. Question is, is it possible to change the power on configuration?

Issue has been found; uuid is not correct in integration code.
Already reported on GIT: UIIDs not correct for DIY mode · Issue #464 · AlexxIT/SonoffLAN · GitHub

1 Like

hi, can you help me how to setup automation on sonoff switches? do you need to manually enter in configuration.yaml?

Hi, not sure if the right post, but I’ve just setup this integration and it was working fine, in order to test it I decided to block internet access to the device. And to my surprise the device went unavailable. From the reason the github page it should have bounced back to Lan mode.

Without internet enabled:
image

If I block internet:
image

I’m I missing something?

Thanks

Local mode doesn’t works for you for some reason

manufacturer: SONOFF
model: MINI
sw_version: PSF-BD1-GL v3.3.0
cloud: online
rssi: -42
local: online

Oh… wondering if its the device I’m using? It’s a Water pump I got from good old AliEx… :frowning:

The only thing I can think of is, I’ve changed the entity name on the HA side, but not sure it would make a difference :frowning:

You firmware should work locally. Some problems with network/hass setup

Ohh… could it be because I have the device in a IOT vlan and hass in another vlan? Interesting if thats it, cause all my other devices are also on that vlan and HA can see them… will do some more digging. Thanks for the help.

Its fixed :slight_smile:
image

Basically after trying several things, I’ve realized that I didn’t have the mdns enabled on my router :slight_smile:

It’s fixed now. Thanks

Hello… I have just installed Sonoff Lan via HACS in Home Assistant. I have updated th configuration.yaml file with my ewelink account info, but after restarting HA, I get the following errors in the logs? Have I missed something?

Can’t connect to eWeLink Cloud

1:34:54 PM – (WARNING) Sonoff (custom integration)

Login error: {‘error’: 404, ‘msg’: ‘user is not exit’}

1:34:54 PM – (ERROR) Sonoff (custom integration)

Hi. Is there also a link to install this via a custom repository in the Addon store?

Does anyone use this add-on?
If so, what are the advantages or disadvantages of the add-on
AlexxIT / SonoffLAN.

I don’t use the official Sonoff (=Ewelink) add-on, but the differences I know/read about:

  • Always uses “mixed” mode. Mostly uses local according to them, but uses cloud “if it needs to” (and you don’t control “when” or “how much” it needs to).
  • At the moment doesn’t support the dimmer (D1), fans (iFan03 and iFan 04-L) and camera (GK-200MP2-B). At least the camera is just a rebranded third-party camera and I wouldn’t be surprised if the other ones are too. That means they may never make it into the add-on (too much work for them)
  • Sonoff is a company, they need to make money. They are not making the add-on because they love their customers, they expect to make more money. If at any time they decide to only make certain features only available to users with a subscription, they can do so.

Personally I like to only buy Sonoff devices that are flashable with ESPHome/Tasmota (and most are), which in my opinion gives you the most control and can extend the devices with extra options in some cases.

I’ve been scratching my head for a couple of nights now. My automations stopped working. I realized that the problem was in the template (value_template) and that it didn’t get the temperature from my Sonoffs (TH16/10). Whereas i earlier accessed like so:
{{ state_attr('sensor.sonoff_xxxxxxxxxx_temperature', 'temperature') }}
it now needs to be:
{{ (state_attr('sensor.xxxxxxxxxx_t', 'state') | float) }}

Just posting in case somebody else also is scratching their head! :slight_smile:

This is a very helpful thread, thank you to all the contributors (especiallcy AlexxIT)! :slight_smile:

There is some problem with latest firmware TH16. Check issued on GitHub

I lost my TH:s again. I can se one in the developer tolls/states section, but it is unavailable.
I tried uninstalling and re-installing this (and other) components and all kinds og configurations, but to no avail…
Any ideas?

image

I am using it. So far only for Sonoff WiFI Bulb B02-B.
Installation and discovery went very smooth. I can switch on/off and control brightness and colour temperature.
Not all services for light are working (example: increase brightness: brightness_step) and I also cannot read attribute from the light with template (this: {{ states.light.10010aaa88 }} gives error - already made issue on github). If this issue will not be resolved quickly I consider to move to AlexxIT Add-on.

@ffkokkola - It seems that your sensor does not communicate with HA. Do you see it responding in eWLink app (or other Sonoff app which was dedicated to it) ?
I have issue with my Soboff WiFi Bulb but at leas HA can see it in the Developer panel and I can turn it on/off from HA. I cannot read attributes though… :frowning:
Still looking for solutiona.

@azel_inc, if possible you can talk as you made the call to the “sonoff.update_consumption” service.
I can’t get the consumption of my POW R2.

Happy New Year All, Sorry for the deleted post above, I hit enter too soon!

I am new to Sonoff/ewelink but have a lot of other smart home stuff and have been running HA for a couple of years. I have set up this integration with my new Sonoff Micro and it works well. I also have the new NSPanel on order and this should arrive next week and I am trying to work out how I can add widgets to it to control non ewelink device via HA without flashing. I am sure this integration will pick up the the 2 physical buttons fine and using this integration I am able to trigger HA automation based on the Sonoff micro switching on and off but doing it this way effectively renders the Micro unusable as a physical switch and will mean having to get physical “dummy” switches for each HA automation i want to do. So I have my thinking cap on and am looking for ideas please… :slightly_smiling_face:

One thing I thought was creating some sort of virtual device in ewelink but the only way I can see to do that is to create a one button remote. The integration sees this remote in HA as a binary sensor but it does not seem to pick up any state change, I even tried changing the device to a switch in HA config, it saw it as a switch then but still did not detect state change and it just went offline when the HA switch was operated.

Second idea is scenes, the plan would be to create different push button scenes in ewelink that just toggle the same physical Sonoff switch, the advantage being that multiple scenes would only tie up 1 physical device, however the integration does not seem to detect ewelink scenes in my cloud account :-(.

So, to my questions :slight_smile:

@AlexxIT is there any way to be able to detect scenes in HA please and if not could this functionality maybe be added in the future please?

Or does anyone have any other ideas that I haven’t thought about yet as I really don’t want to have to try and flash the panel or buy a bunch of dummy devices if i can avoid it.

Thanks Pete

1 Like