Devices setup:
Under ‘Tools -> Advanced’ enable ‘rules’
Put this in rules:
on lamp_on do
gpio,12,1
gpio,13,0
endonon lamp_off do
gpio,12,0
gpio,13,1
endonon SW_1#Switch do
if [SW_1#Switch]=1
gpio,12,1
gpio,13,0
else
gpio,12,0
gpio,13,1
endif
endon
To switch on and off:
On: http://IP_Address_of_Sonoff/control?cmd=event,lamp_on
Off: http://IP_Address_of_Sonoff/control?cmd=event,lamp_off
See:
http://www.domoticz.com/forum/viewtopic.php?t=9670&start=20