Release - WeMo Light Switch

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Sylv Offline
Junior Member
Posts: 3
Joined: Jul 2014
Reputation: 0
Post: #1
Hi,

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.

Download:
v0.1.4
Gotham: service.wemo.lightswitch.0.1.4.Gotham.zip
Frodo: service.wemo.lightswitch.0.1.4.Frodo.zip

Known Issues
  • Only works on Windows
    It might be able to work on OS X and Linux, but you have to solve some dependencies problems.

Installation
  • 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.
    Code:
    <keymap>
      <global>
        <keyboard>
          <l>Skin.SetString(wemo, True)</l>
          <p>Play</p>
          <q>Queue</q>
          ...
          ...
        </keyboard>
      </global>
      ...
    </keymap>
  • 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.

Release notes
Code:
Version 0.1.4

- Added: option to disable turning on the light during a period of time

Version 0.1.3

- Fixed: XBMC hangs on exit

Version 0.1.2

- Added: the ability to turn the light on when playback pauses and turn it off when playback resumes
- Added: options to enable/disable switchings

Version 0.1.1

- Added: Gotham support
- Fixed: missing dependency "Requests"

Version 0.1.0

- Initial version
(This post was last modified: Yesterday 02:20 by Sylv.)
find quote
bragg2012 Offline
Junior Member
Posts: 19
Joined: Jan 2010
Reputation: 0
Post: #2
Hi,

This sounds great but I have a few questions. Just say I start watching a movie at noon so is no need for my lights to be on, and then pause the movie.. will the lights come on?

If not is there anyway to add additional rules or incorporate existing rules? (if pause & sun==set then lights on) etc?
find quote
Sylv Offline
Junior Member
Posts: 3
Joined: Jul 2014
Reputation: 0
Post: #3
(2014-09-30 14:31)bragg2012 Wrote:  Hi,

This sounds great but I have a few questions. Just say I start watching a movie at noon so is no need for my lights to be on, and then pause the movie.. will the lights come on?

If not is there anyway to add additional rules or incorporate existing rules? (if pause & sun==set then lights on) etc?

Yes, the lights still will come on.
Because I watch movies in the basement, I always need the light on. I didn't consider the situation like yours.
I could add an option to disable switchings during a period of time daily (e.g. from 6am to 6pm), if that's what you need.
find quote
bragg2012 Offline
Junior Member
Posts: 19
Joined: Jan 2010
Reputation: 0
Post: #4
yeah that would be awesome!

I guess the 'on' switch only needs to be suppressed in the custom time frame so the 'off' would still override if the light had been turned on manually... if that makes sense!

Would it be possible to have a toggle for tv/movies too? So the plugin could be turned off for TV shows but used when watching movies for example?

One final request! - a quick option to disable the plugin during playback say on the menu bar (wemo logo where subtitles/settings are etc) so it can be manually toggled on/off quickly if needed.

Sorry for all the requests! Laugh
find quote
Sylv Offline
Junior Member
Posts: 3
Joined: Jul 2014
Reputation: 0
Post: #5
(2014-09-30 23:14)bragg2012 Wrote:  yeah that would be awesome!

I guess the 'on' switch only needs to be suppressed in the custom time frame so the 'off' would still override if the light had been turned on manually... if that makes sense!

Would it be possible to have a toggle for tv/movies too? So the plugin could be turned off for TV shows but used when watching movies for example?

One final request! - a quick option to disable the plugin during playback say on the menu bar (wemo logo where subtitles/settings are etc) so it can be manually toggled on/off quickly if needed.

Sorry for all the requests! Laugh

New version 0.1.4 available for your first request. Check add-on settings after installing.
As for your other two requests, they are beyond my ability, or even wouldn't be possible for an add-on. Confused
(This post was last modified: Yesterday 02:39 by Sylv.)
find quote