Release - WeMo Light Switch

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Sylv Offline
Junior Member
Posts: 8
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 lights off when a video starts playing, and turn them back on when playback is paused or completed. Also you can map a keyboard key to toggle the lights on/off.
This is my first XBMC add-on, and it 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.
  • WeMo Smart LED Bulbs / WeMo Link are not yet supported
    Currently, this add-on can work with WeMo Switch, WeMo Insight Switch and WeMo Light Switch.

Installation
  • You need to have a Belkin WeMo device (WeMo Switch, Light Switch, Insight Switch). And make sure it can control your lights 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: an option to disable turning on the lights during a period of time

Version 0.1.3

- Fixed: XBMC hangs on exit

Version 0.1.2

- Added: the ability to turn the lights on when playback pauses and turn them 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-12-08 01:30 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: 8
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: 8
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: 26
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: 8
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: 26
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: 537
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: 8
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
mosesvii Offline
Junior Member
Posts: 11
Joined: Sep 2011
Reputation: 0
Big Grin  RE: WeMo Light Switch
Post: #11
Nice work Sylv, loving the addon.

One thing to mention though is when you pause playback the lights turn back on (which is fine and expected), when you unease however the lights do not turn back off. Is there any way to fix this? e.g. Pause toggles lights on/off.

thanks in advance
find quote
Sylv Offline
Junior Member
Posts: 8
Joined: Jul 2014
Reputation: 0
Post: #12
(2014-12-05 06:10)mosesvii Wrote:  Nice work Sylv, loving the addon.

One thing to mention though is when you pause playback the lights turn back on (which is fine and expected), when you unease however the lights do not turn back off. Is there any way to fix this? e.g. Pause toggles lights on/off.

thanks in advance

Sorry mosesvii, english is not my native language. I don't understand what you mean by "when you unease". Could you please explain that to me.Thank you.
find quote
mosesvii Offline
Junior Member
Posts: 11
Joined: Sep 2011
Reputation: 0
Post: #13
sorry, spelling mistake.

When you un-pause the lights do not turn off again.

eg.
1) You play something and the lights turn off
2) You pause (using spacebar) and the lights go on
3) You un pause / play (using spacebar again) and the lights stay on... they don't turn off.

hope this makes sense.
find quote
Sylv Offline
Junior Member
Posts: 8
Joined: Jul 2014
Reputation: 0
Post: #14
(2014-12-05 07:09)mosesvii Wrote:  sorry, spelling mistake.

When you un-pause the lights do not turn off again.

eg.
1) You play something and the lights turn off
2) You pause (using spacebar) and the lights go on
3) You un pause / play (using spacebar again) and the lights stay on... they don't turn off.

hope this makes sense.

The lights should turn off when you un-pause. I just tested it on my XBMC, the lights turned off successfully. I'm not sure what's causing your problem.
Please check this add-on's settings, the option "Turn off when playback resumes" should be turned on.
If it doesn't work, try to reopen XBMC, play a video, pause it and un-pause it several times. Then send me your xbmc.log file (C:\Users\USER\AppData\Roaming\XBMC\xbmc.log), so that I can check where the problem is.
find quote
mosesvii Offline
Junior Member
Posts: 11
Joined: Sep 2011
Reputation: 0
Post: #15
Ok that's embarrassing, I didn't have it turned on in the settings.

Thanks so much. Great add-on.
find quote
Post Reply