WeMo API written in Groovy for controlling switches.
How to:
- Clone the repository (
git clone https://github.com/brendonanderson/wemocontrol.git
) cd wemocontrol
- Build the code (
gradle build
) - Build the jar (
gradle uberjar
) cd build/libs
- Search for WeMo devices (
java -jar wemocontrol.jar -d -i en1 -t 20000
where en1 is your network interface name) - Turn on a device that was discovered (
java -jar wemocontrol.jar -i en1 -e http://192.168.1.120:49153/setup.xml -n
) - Turn off a device that was discovered (
java -jar wemocontrol.jar -i en1 -e http://192.168.1.120:49153/setup.xml -f
)
See this blog post for details: http://www.objectpartners.com/2014/03/25/a-groovy-time-with-upnp-and-wemo/