A simple Python script to set up WeMo devices supporting:
- connecting to a home Wi-Fi network (via calling a SOAP method ConnectHomeNetwork)
- showing a list of discovered devices (via SSDP)
- working on Windows too
I have tested it with WeMo Insight and WeMo Bridge.
$ python wemosetup.py discover
Discovering WeMo devices
Discovered:
- WeMo Bridge (10.22.22.1:49152)
$ python wemosetup.py connecthomenetwork --ssid <mywifinetworkname> --password <mywifinetworkpassword>
Discovering WeMo devices
Discovered:
- WeMo Bridge (10.22.22.1:49152)
Connecting discovered devices to network "<mywifinetworkname>"
- WeMo Bridge (10.22.22.1:49152) ... [ok]
- Python 2.7
- openssl (or openssl.exe) binary discoverable in system $PATH
- support getting end devices
- support adding end devices
- support switching state of end devices
- support switching / displaying binary state for Insight
- try/catch around all network calls