Ewelink sonoff switch control with tasker.

1,556 views
Skip to first unread message

Rich D

unread,
Dec 6, 2018, 6:56:34 PM12/6/18
to Tasker Google Groups Post
I have found a few older posts on this subject with no clear resolution, so I am hoping  a simple solution might be currently available.

I do not have any type of hub.  I just have the switches working onn my home wifi with the ewelink app. I have set up a few applets with IFTTT and linked them with Google assistant. 

My current main objective is to be able to poll the device to get its status. I was able to set up a applet that would send a push to tasker when the device was turned on or off but of course that is not exactly what I want and there is a bug involved with IFTTT.  If I use the ewelink app or the assistant to turn the device on then all works as expected however if I use IFTTT to turn the device on then the applet to detect it turning on fails to run. 

I would also like to be able to turn the device on and off directly with tasker or with the help of a plug in if one is available. 

Has any achieved this??

Thanks,  Rich. 

Duck Redbeard

unread,
Dec 6, 2018, 7:52:34 PM12/6/18
to Tasker
I use a few of them but have had no consistent results with getting feedback other than my device getting an autoremote notification when operated. I know you can use that to set variables, but I didn't really need the feedback so I just abandoned that part of the project.

These devices don't have plugin, so you have to use IFTTT and Join together. Works reliably. My config has a task for each state, and I have 5 in use (one operates a garage door). They can also be operated via Alexa, google assistant, and cortana.

Duck Redbeard

unread,
Dec 6, 2018, 7:55:31 PM12/6/18
to Tasker
Read your post again and it reminded me… using different ways to operate the devices resulted in different results in regard to the feedback.

I will reactivate those profiles and share with you what I did get to work.

Duck Redbeard

unread,
Dec 6, 2018, 8:19:40 PM12/6/18
to Tasker
Now that I have it all activated, I recall what the issue was.  I have an applet that does a http post of a Join API (text/plain) when my den lights sonoff device switches on.  There were issues with it lagging and it was unreliable as feedback.  Not sure if the lag was a server issue or my network.  I will set up a few other applets and see if reliability has improved.  

The way I have it now is that If I use Google Assistant, Alexa, or the eWeLink app to operate the switch, I get the http post to work and I get the resultant notification on my phone.  If I use Tasker to operate the switch, I don't get the http post, and no resultant feedback.

If that doesn't make sense, I will try another experiment and post updates tomorrow.

Duck Redbeard

unread,
Dec 6, 2018, 8:30:25 PM12/6/18
to Tasker
Yep...I recall Joao advising me that it was the IFTTT-eWeLink communication issue.  They work together to control the light, but the web request (at moment of switch state change) doesn't happen.  I wonder if it is a timing/stepping on each other issue.


On Thursday, December 6, 2018 at 6:56:34 PM UTC-5, Rich D wrote:

Duck Redbeard

unread,
Dec 6, 2018, 8:58:27 PM12/6/18
to Tasker
If you have a handful of old android devices laying around, you could charge one at each outlet and have it report a change of charging state.  Archaic I know, but it will be the most reliable and can do more than just monitor the power state of each sonoff switch.  I kinda have this with my garage remote setup, and it also helps control my garage door.  (I've been wanting to find a way for that device to actively monitor the door open/close state.)



On Thursday, December 6, 2018 at 6:56:34 PM UTC-5, Rich D wrote:

Rich D

unread,
Dec 6, 2018, 9:44:55 PM12/6/18
to Tasker Google Groups Post
Thanks for all the info. I did just stumble across this 



wich makes activating the ifttt trigger a bit simpler by using a http  post.  the ifttt help info seems to say that with the correct data  you can  get a query However I do not understand how to implement it.  here is the help text 




Make a POST or GET web request to:

https://maker.ifttt.com/trigger/{event}/with/key/bqL

With an optional JSON body of:

{ "value1" : "", "value2" : "", "value3" : "" }

The data is completely optional, and you can also pass value1value2, and value3 as query parameters or form variables. This content will be passed on to the Action in your Recipe

Duck Redbeard

unread,
Dec 7, 2018, 7:35:18 AM12/7/18
to Tasker
So how do we get eWeLink to make a plugin for Tasker. Is this all about making the API public?

Rich D

unread,
Dec 8, 2018, 5:57:48 PM12/8/18
to Tasker Google Groups Post

Yep...I recall Joao advising me that it was the IFTTT-eWeLink communication issue.  They work together to control the light, but the web request (at moment of switch state change) doesn't happen.  I wonder if it is a timing/stepping on each other issue.

That is what ai assumed. since it is the same service that is turning on the device and reporting the device has been switched on. I guess it just cant do 2 things at once. 

Rich D

unread,
Dec 8, 2018, 6:23:44 PM12/8/18
to Tasker Google Groups Post
If you have a handful of old android devices laying around, you could charge one at each outlet and have it report a change of charging state.

Good idea, However my current work around seems to work for now. I have a tablet that is always on and plugged in. When not in use it is used as a picture frame viewer. So I now send a push to that device with any google assistant command i want ( this particular one will turn on or off the sonoff switch)  it then starts the assistant (which I have set to start with a text input instead of voice ( a setting in the google assistant app)) and input the command with autoinput. so since I am changing the sonoff switch status with google assistant the IFTTT applet now detects the change.  

This also gives me the ability to launch any google assistant command with tasker without having to use auto input on the device I am currently using. Something I have been trying to do for a long time now. 



Do you have connection issues with these devices?

I currently have 2 of them. the one in my garage wich simply turns on a boot dryer seems to work almost flawlessly.  The one in my basement controls part of my heating system. It is connected to a relay. This one will drop the connection intermittently. I believe I have narrowed it down to RF interface. When I had it very close to the relay  the issue was terrible but moving a few feet away from the relay made a very significant improvement. I now believe the remaining connection drops are from the wire that connects the sonoff switch and the relay. 

Rich D

unread,
Dec 8, 2018, 6:43:04 PM12/8/18
to Tasker Google Groups Post


So how do we get eWeLink to make a plugin for Tasker.  Is this all about making the API public?


Not sure. I would imagine since these other apps have been granted access to it then they would be able to grant access to a Tasker plugin.

I went on the sonoff forum and a tasker plug in has been request several times with no results so far. 
Reply all
Reply to author
Forward
0 new messages