Send command via HTML request?

3,784 views
Skip to first unread message

Christoph Wempe

unread,
Feb 6, 2017, 1:02:05 PM2/6/17
to SonoffUsers
Is it possible to turn on/off the switch via a simple html request?

Like a curl or wget command.

I cannot find anything about this in the wiki. :(

This looks almost good.
But I still don't know how the URL should look like.

Nick Barnett

unread,
Feb 7, 2017, 10:58:40 AM2/7/17
to SonoffUsers
You can toggle it by "faking" a button press. If you have the web server enabled, this toggles it for me

Christoph Wempe

unread,
Feb 7, 2017, 1:33:17 PM2/7/17
to SonoffUsers
Thanks.

Are there a discrete ON and OFF commands, too?
This only toggles the switch.

Nick Barnett

unread,
Feb 8, 2017, 1:16:31 AM2/8/17
to SonoffUsers
Not that I could find. Changing the passed value made no difference... I tried 0, 1, 2, 666. They all toggled. I just figured this out by looking at the HTML, so there may be suffering in missing. I use mqtt with node red, so I don't really need it to work.

Christoph Wempe

unread,
Feb 9, 2017, 4:23:52 AM2/9/17
to SonoffUsers
I am using mqtt as well.
But a friend was asking to use only https, because he would not want to setup a mqtt broker just for one device.

I could create a feature request if this seems worthy.

Mikael Nyström

unread,
Feb 10, 2017, 3:55:40 PM2/10/17
to SonoffUsers
Had same problem:
http://192.168.1.xx/cs?c1=Power%20Off
http://192.168.1.xx/cs?c1=Power%20On

Did the trick, which takes any command in the wiki.

Christoph Wempe

unread,
Feb 11, 2017, 7:08:39 AM2/11/17
to SonoffUsers
Reply all
Reply to author
Forward
0 new messages