Start a new topic

Control Sonoff socket with web interface instead of app?

I have a Sonoff remote control power socket, and find that the eWeLink app drains my phone's battery very quickly. Is there a way of controlling the socket over the internet using a web GUI instead of the eWeLink app?

6 people have this question

Download an android emulator like bluestacks & install ewelink app on it is the only way I could do in on a windows pc if thats any help

I've controlled mine via IFTTT website. I can open any web browser, paste the web address with event and presto.

2 people like this

Use webhooks on IFTTT website.  Build applets for on and off.  Create a local web page on your computer that loads the webhooks url into an inline frame when you click a link for on or off.  This is working for me.


Keep the web page on your local computer to protect your webhooks key.  If you want to place it on a public site, use PHP or other server side language to hide it.


Another method, as described above, is create bookmarks in your browser with the webhooks urls required to turn the switch on or off.  Then you can click in the bookmark in your browser to do the job.

3 people like this

Perfect - many thanks!

Hello E W.

As i not familiar with IFTTT Could you please explain the sentence: " ...that loads the webhooks url into an inline frame... "

In html you create an inline frame on a web page.  Then create links on the page to load webhooks url execution results into the frame.  The result is that webhooks sends the command to the applets and the reply from the process appears in the frame.

Here is a snippit of html code that creates the iframe and shows an example link.


<iframe id="I1" name="I1" src="http:/" title="Results" width="100%" style="height: 80px" >   </iframe>


<a href="" target="I1">Fan OFF</a>
In the code above weblinks.php is a script I created to send the trigger string (example: fan_off) to webhooks.
---my php script---
$key = "xxxxxxxxxxxxxxxxxxxxx"; // Set key to your IFTTT webhooks key.
if(isset($_GET['weblink0'])){ // if we have a command 0 send the commands else print generic message.
 for ($i=0; $i<3; $i++){ // retrieve up to 3 weblink trigger commands
   $result = send_link($_GET['weblink'.$i]);
   $result = str_replace("Congratulations! ", "", $result); // get rid of annoying text
   echo $result . ".<br>";
 echo "Results appear here.";
function send_link($comm){
global $key;
$result = file_get_contents(''. $comm .'/with/key/' . $key); // accessing the url will trigger webhooks
if($result) return $result;
else return "Did not trigger any event.";
See the page: for how to set up and use webhooks.


I don't understand why there isn't a web interface for these awesome devices?

1 person likes this

As of a few weeks ago, IFTTT is a subscription service. No longer free. 

Damn! I missed the free service! :(

$10 bucks a year is not unreasonable though for this great service.

If you've got a whole bunch of Sonoff, yes, I suppose. But if you just have one or two, ten bucks a year is highway robbery. I'm astonished that someone doesn't have a free service with ads attached. Google, where are you?

Yup $10 not bad. But how about a trial at least for us noobs. We haven't seen the functionality we are to purchase? We have to trust that it is what we want. Strange model. Thats all.

@ Dan - Well if 83 cents a month is "highway robbery" I guess you have a point. 

@ Jarett -  i suppose a free trail would be nice but at least you aren't risking financial ruin if you blow $10 bucks and it doesn't work out.  Maybe they could do a $3 for 3 month introductory offer.

1 person likes this
Login or Signup to post a comment