Release - WeMo Light Switch

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Sylv Offline
Junior Member
Posts: 5
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: 2014-10-01 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: 5
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: 5
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: 2014-10-01 02:39 by Sylv.)
find quote
Verderer Offline
Junior Member
Posts: 25
Joined: Feb 2014
Reputation: 0
Post: #6
Getting the following notice when I try installing this.

"Addon does not have the correct structure."

Running OpenElec 4.2.1.
find quote
Sylv Offline
Junior Member
Posts: 5
Joined: Jul 2014
Reputation: 0
Post: #7
(2014-10-15 20:37)Verderer Wrote:  Getting the following notice when I try installing this.

"Addon does not have the correct structure."

Running OpenElec 4.2.1.

Hi Verderer,
Unfortunately, this add-on now can only work on Windows system. OpenElec is a Linux system.
Because some dependencies this add-on used are for Windows only. In order to let it work on Linux system, these dependencies should be replaced to specific Linux versions.
I don't use OpenElec. So I cannot build the right dependencies for you. But if you have some basic Linux knowledge, you can try to build these dependencies by yourself. Ask me if you need details.
find quote
Verderer Offline
Junior Member
Posts: 25
Joined: Feb 2014
Reputation: 0
Post: #8
Unfortunatly I don't realy have any basic linux knowledge, so I wouldn't know what to do Tongue
But thx anyways Smile
find quote
illiac4 Offline
Fan
Posts: 531
Joined: May 2009
Reputation: 3
Post: #9
Did somone tried those China devices?
http://www.ebay.com/itm/Wireless-WIFI-Sm...5d4f8ae613
find quote
Sylv Offline
Junior Member
Posts: 5
Joined: Jul 2014
Reputation: 0
Post: #10
(2014-10-21 06:02)illiac4 Wrote:  Did somone tried those China devices?
http://www.ebay.com/itm/Wireless-WIFI-Sm...5d4f8ae613

If you want to know whether this addon can work with those devices, the answer is no.
find quote