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

So you're saying one can control this through a browser with an API platform? That's what a lot of this thread is about. I see http://developers.sonoff.tech/sonoff-diy-mode-api-protocol.html , but it doesn't refer to an API platform. I am NOT a developer, and I'd just like some simple instructions.

Ian, that's what much of this conversation is about. The answer seems to be that no, without IFTTT  you can't control Sonoff with a browser. 


Cliff, I assume you're answering my question about Shelly. If I buy a Shelly, are there clear instructions how to do that?

Hey Dan,

Not sure if you saw my last comment, regarding Shelly and Sonoff in DIY mode.  I got both to work using postman and both were fairly straightforward. 


shelly:

https://shelly-api-docs.shelly.cloud/

https://shelly.cloud/documents/developers/shelly_cloud_api_access.pdf


Sonoff

https://sonoff.tech/product-tutorials/diy-mode-to-control-the-sonoff-device

http://developers.sonoff.tech/sonoff-diy-mode-api-protocol.html


I am currently trying to write a simple webapp using python and django to make the calls.


Dan,

First a caveat - I am not a developer either so things typically take me a while to get done!


With the Restful API it is designed for HTTP calls (GETs and POSTs etc).  I suggest you download and install the Postman app on you computer and have a play with that.  you can control the device using those commands.


I am building a webserver but as part of that I may be able to create some simple html to control the device. 


I am currently building it to work on my home network but ultimately want to control it from anywhere.   Remember too with the postman app you will need to know the IP address of the device.

Thanks, David. Those are good references. Now, I have no experience doing this stuff, so some handholding will be required. First of all, I have Sonoff smart switches, procured a year an a half ago. Easy to control from my smart phone with eWeLink. I have also downloaded Postman onto my Mac. How do I know whether these smart switches are v1 or v2?  Would rather not have to jumper. Also, is this strategy workable only on a local network? That is, can I sit here on my network and control a smart switch across the country, like I can with eWeLink?

It's a bit vague on what devices are supported Dan so you may have to do a bit of digging to find out.  I suspect the earlier ones are not supported.


The guide  


http://developers.sonoff.tech/sonoff-diy-mode-api-protocol.html#Supported-Device


mentions R3, but I thought I saw R2 is supported.


If you have a basic lying around and the firmware is at least 3.5.0 you may want to see if you can get it to start in DYI mode.  If not, then you will need to buy an R3 or supported device.


Once you have got it in DIY mode, you configure as per the guide:


in the text box next to where is says post you put (replace the IP address with your device IP:


http://192.168.xx.xx:8081/zeroconf/switch


Then in the body you put:below to turn on or change the text to off to turn it off.


{
"deviceid": "",
"data": {
"switch": "on"
}
}


When it is in an HTML file it is pretty much the same code.  I attached a screen shot of the postman app.


We are Best HR Assignment Help In UK online providers in the world at very affordable charges for students to get good grades in university. Best Human Resource assignment writing services by our experts because we follow strict university guidelines so that our students will get proper assignments on time. For more services:- Science Assignment Help in Australia | Geography Assignment Help in Australia

 I recently paid to have the Web app to "control" my 4 Sonoff devices; 2 switches and 2 Temp/Humidity devices. What a waste of money! Ewelink's blurb claims you can "control and manage"your devices - they can be switched on and off BUT NOTHING ELSE. And that only applies to the switches - the TH10 & 16 just say "not supported yet"! Rubbish.

Login or Signup to post a comment