I managed to build this add-on for XBMC to control my Belkin WeMo Light Switch. (Thanks to ouimeaux)
It will automatically turn the light off when a video starts playing, and turn it back on when playback is paused or completed. Also you can map a keyboard key to toggle the light on/off.
This add-on may have imperfections, but it works for me.
- Only works on Windows
It might be able to work on OS X and Linux, but you have to solve some dependencies problems.
- You need to have a Belkin WeMo device (WeMo Switch, Light Switch, Insight Switch). And make sure it can control your light remotely.
- In order to use your keyboard (or other remotes) to control the WeMo Switch, you need to edit the keyboard.xml file in the XBMC userdata/keymaps folder.
Add one line "<l>Skin.SetString(wemo, True)</l>" to the keyboard.xml file like below. You can change the trigger key from "L" to whatever you want.
- Download the add-on as a ZIP file. Open XBMC and go to: System -> Settings -> Add-ons -> Install from zip file.
- Wait for the settings dialog to pop up. Enter the name of your WeMo Switch device (you can find it from the WeMo app).
- If it can successfully find your WeMo device on the local network, then it should work.
- Fixed: XBMC hangs on exit
- Added: the ability to turn the light on when playback pauses and turn it off when playback resumes
- Added: options to enable/disable switchings
- Added: Gotham support
- Fixed: missing dependency "Requests"
- Initial version