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

Hi Alexx,
Correct: in my setup only “registered on WiFi” are copied to HA.
I’ll give the “only uid/pwd” a go as soon as I’m done migrating my KaKu-stuff to Sonoff.
Thanks for your support!
Kindest regards,
F

Hi Alexey
I just received mine. Could you please explain how to do the integration in HassIo ?

Hii… Did you ever figure this out. Do i have to add the code to the config.yaml. If you could share what you did… Thanx

@AlexxIT Thank you so much for the integration. I moved to HA from stock apps due to your work. Can’t figure out how to proceed with the sonoff motion sensors. Do i need to add the code from your website to my config.yaml. Attaching screenshot. Request assistance :sweat_smile:

Hello guys.

I configured as the procedure and now I can see the Sonoff as ENTITIES, controlling them on my Lovelace, but I can’t see as DEVICES, and because of this I can’t create automations/scenes.

Does anyone can help me with this situation?

Thanks in advance.

arch x86_64
chassis vm
dev false
docker true
docker_version 19.03.11
hassio true
host_os HassOS 4.13
installation_type Home Assistant OS
os_name Linux
os_version 5.4.63
python_version 3.8.5
supervisor 245
timezone America/Sao_Paulo
version 0.115.2
virtualenv false

You don’t need devices to create automations. All automations you want can be create with entities.

Thanks Francis, for the very fast answer and to clarify this to me, i am newby in HA.

It works !!

@RSK if your motion sensor is named “Smoking” in eWeLink app - all looks fine

AlexxIT,
my POWR2 was working fine, now only the voltage is displayed. Power and Current stay at O ZERO, even with the sonoff ON.
Yes there is Load…
image

What am i doing wrong?

Thanks

1 Like

Hi! First of all thank you for this project!

I am a noob at this home assistant stuff and maybe my question is funny one.
Please tell me how can I make an automation with sonoff devices if they are listed only in entity tab and not on device tab?

I want to make an automation like this:
On sunset if sonoff switch 1 is off turn on sonoff switch 2 and sonoff switch 3.
Another one is : if minivol player is playing (volumio) turn on outlet 1 (to power speakers)

Yesterday i managed somehow to do that but only becuase I imported the sonoffs as homekit devices from homebridge but this was very unstable because I keep loose comunication with devices from iphone in home kit.

Now when I use this plugin I can’t intergrate the sonoffs in any automation.

I have HA on docker(omv5), 4 switches and an outlet, HASS and this plugin installed.
configuration.yaml
sonoff:
username: user
password: pass
mode: local
reload: always # update device list every time HA starts

Many thanks!

@AlexxIT would this work also it Sonoff is connected to complettely different wifi network but using the same account? Via cloud

@monaco yes, it will work via cloud.

1 Like

You don’t need devices to create automation. You can use entities.

I think you use mode: local ?

You don’t need devices to create automation. You can use entities.

When I am trying to define the actions, no entity is showed in the dropdown menu.
Sorry for being nagging, can you give me a hint for this automation please?

@Catelinescu: Under Actions, select ‘‘Call service’’ as the Action Type. The line under that will change to Service. Click on that line and select ‘‘switch.turn_on’’ (if that is what you want to occur). The line under that will change and you can select the appropriate switch from there. Save the automation with the little disk icon, check configuration and reload automations

2 Likes

Hi all, complete noob to HA so please be gentle.
I’ve just managed to get homeassistant setup and working on my android tablet using Vlad’s tutorial here Install Home Assistant, Mosquitto broker and Node-Red on android
If I understand correctly it doesn’t include hacs just homeassistant core and wanted to see how to get my sonoff/ewelink devices integrated.
Any pointers would be very gratefully received as the bulk of my devices are sonoffs.
Thanks all.

Hi
This thing is so confusing, I got 4ch switch, how do I configure each channel (outlet) as four separate switches entities?
As switch.a to channel 1, switch.b to channel 2. etc?

@AlexxIT thanks for the great work! i have a question though. i m using your work to capture the power consumption of my POW R2. i manage to obtain the consumption for last 30 days, by calling the “sonoff.update_consumption” service. But i need some help, how do i capture the power for that particular month only. Let say today is 6th Nov, i wanted to capture from the first day until today only. which is 6 days. But then, comes tomorrow, i wanna capture 1st day until 7th, which is 7 days.
Using this " value_template: “{% set p=state_attr(‘switch.sonoff_1000abcdef’, ‘consumption’) %}{{ p[:30]|sum if p }}” will call the consumption for last 30 days, regardless of the month.

You need to insert the current day of the month instead of 30. Find out how to do it in Jinja2 template.