Sonoff ESP Easy

I have a Sonoff (wifi smart switch) flashed with ESP Easy.

It response to
http://sonoffip/control?cmd=gpio,12,1 (On)
http://sonoffip/control?cmd=gpio,12,2 (off)

is there anyway i can make a switch in vera that can send http commands to On or Off this sonoff? There is this httpswitch but it’s designed for kankun k3 switch.
(i’m new to vera and luup).

Thanks!

Hi there congkai. Just in case you still need help with this… I ended up using a scene to conrol the sonoff device. Just create a scene in Vera that is triggered however you wish and throw this in the lua code section of your scene under the label that says, “Also, execute the following Luup code:”
luup.inet.wget(‘http://SONOFF IP ADDRESS GOES HERE/control?cmd=event,turnon’)

Replace “turnon” with “turnoff” or any other labels you’ve used in your rules on the sonoff device. Hope that helps. For more info on using the rules, check this page out.
https://www.letscontrolit.com/wiki/index.php/Tutorial_Rules#SendToHTTP

Hope that helps.

[quote=“wantedfoot, post:2, topic:196503”]Hi there congkai. Just in case you still need help with this… I ended up using a scene to conrol the sonoff device. Just create a scene in Vera that is triggered however you wish and throw this in the lua code section of your scene under the label that says, “Also, execute the following Luup code:”
luup.inet.wget(‘http://SONOFF IP ADDRESS GOES HERE/control?cmd=event,turnon’)

Replace “turnon” with “turnoff” or any other labels you’ve used in your rules on the sonoff device. Hope that helps. For more info on using the rules, check this page out.
https://www.letscontrolit.com/wiki/index.php/Tutorial_Rules#SendToHTTP

Hope that helps.[/quote]

Great tip thank you. Is the ‘turnon’ or ‘turnoff’ command calling a rule name in ESPEasy or can the GPIO be controlled directly? I’m assuming we’d also have to send something back to Vera to validate the execution (virtual switch?).

You are correct. The rule must be created in ESPEasy first and virtual switches are the only way that I currently know of for reporting the on/off status of the device to Vera. I’m sure more seasoned or learned veterans at the link I’ve referencee or even some on this board might have other secrets but for now this system has been working well for me.