You can use CURL to control the switch under any operating system that supports CURL. This allows you automate unattended tasks. Please refer to the manufacturer's website for more detail on the API: http://developers.sonoff.tech/sonoff-diy-mode-api-protocol.html
You can use the following CURL command under Windows to switch the device on:
curl --max-time 2 --X --data "{\"deviceid\": \"0000000000\", \"data\": {\"switch\": \"on\"} }" http://[IP Address]:8081/zeroconf/switch
--max-time parameter specifies the time-out
deviceid is typically ignored
[IP Address] is the IPv4 address of the device
Please note the use of the escapes under Windows using the backslash character: \
The device will respond with something like:
{"seq":278,"error":0}
To run the device off, simply replace the text:
curl --max-time 2 --X --data "{\"deviceid\": \"0000000000\", \"data\": {\"switch\": \"off\"} }" http://[AP Address]:8081/zeroconf/switch
The device once again responds with something like:
{"seq":279,"error":0}