All posts tagged x10

Well it’s been a couple months since I installed my IPcamera and linked it to my x10 door bell. It’s been pretty great. I plan to show a new refreshed video and a full introduction to the software features I use in some backend scripts and a web as well as a smartphone app that I’ve been working on.

For now I’m interested in showing my IPcamera/doorbell script I wrote for XBMC just this evening. I use XBMC on all TV’s and computer systems in my house.

This slideshow requires JavaScript.

It’s been pretty great so far at automating my media across the network and integrating my home automation notifications. I decided to write a script to send a notification to all XBMC instances when my doorbell rings and to display a live video feed of the IPcam at my porch for 10 seconds.

My particular use case was I realized when in my exercise room I will not be able to hear my doorbell over my treadmill motor and music/video playing, AND I’m probably going to be spending most of my time in that room looking at an XBMC screen. It works great, it’s very simple and it’s very cool since it pops up on any screen I have running in the house

##Deprecated Example!

#Import the XBMC/XBMCGUI modules.
import xbmc, xbmcgui, time, urllib

#inherit from WindowDialog instead of Window so that it's shown on top of
#what's onscreen instead of replacing it entirely
class CamView(xbmcgui.WindowDialog):

    def __init__(self):
        #Define image location and size
        self.image = xbmcgui.ControlImage(870, 438, 380, 253, "")

viewer = CamView()
start_time = time.time()
while(time.time() - start_time <= 14):
    #set url to ip cam image, password auth not supported 
    urllib.urlretrieve("http://asdf.com/camera/", '/tmp/bell.jpg')
    #Define image transparency 
    viewer.image.setAnimations([('conditional', 'effect=fade start=90 end=90 time=0 condition=true',)])
del viewer


What I’ve created is a regular XBMC script like all other addons. You can get my script in ZIP format from github here, https://github.com/ssshake/xbmc-scripts/blob/master/script.doorbell.zip?raw=true

The thread on XBMC forums for this project can be seen here: http://forum.xbmc.org/showthread.php?tid=156665

This script can be run in the Programs menu or ideally for what I’m demonstrating here, it’s called by a command line script when it sees that my doorbell has been pressed. This is just a regular HTTP GET to your XBMC machine telling it to run the script.

Please note I’m using HTTP GET’s on XBMC 11, XBMC 12 requires an equivalent command over a json call. I’m pretty sure it’s not hard, I just don’t have that information right now.


From a linux shell you'd execute this as:

wget "http://XBMCHOSTNAME:PORT/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.RunScript(/PATH/TO/SCRIPTS/DIR/script.doorbell/doorbell.py)";

or you can just paste this into a regular webbrowser to test.
Check out my latest post where I demonstrate this functionality as a popup in XBMC, including script source code http://homeawesomation.wordpress.com/2013/02/18/doorbell-ipcam-xbmc-update/

Check out my latest project!

I have fully installed my door bell and camera, have developed a decent looking website and html email template and configured my cellphone to make door bell dings when the message letting me know someone is at the door arrives. It was all pretty simple. I’ll be posting a video soon but currently it’s -25’C outside.

I just got my hands on a used x10 pan/tilt camera mount. With it I have retrofitted my non-pan/tilt IP camera with it and I have written a simple yet easy on the eyes web interface with live 1 frame per second(by choice) view.

Check out my latest post where I demonstrate this functionality as a popup in XBMC, including script source code http://homeawesomation.wordpress.com/2013/02/18/doorbell-ipcam-xbmc-update/

This slideshow requires JavaScript.

So what you’re seeing here is me using a Harmony remote, and a mediapc running XBMC, plus x10 Home Automation to control my Lights, Thermostat and Fireplace. The Harmony remote and my PC drive the functionality. XBMC’s Notifications via API allow on screen feed back for what commands I’m executing.

Soon I will update this page with links to illustrations, script examples and a parts list.

Parts Used:
-Logitech Harmony Remote
-X10 lights + PC Controller (any HA lights would do)
-IR543 (is an x10 IR received for the remote, but an xbmc script could do this)
Parts Used:
-Logitech Harmony Remote
-X10 Universal Module for fireplace (basically a relay switch)
-TX15B X10 thermostat (deprecated, I recommend a good WIFI thermostat)

Here are some screen shots, I’ve included a summary of most of the dialogs to give you an idea.

This slideshow requires JavaScript.

People might be interested in this x10 plugin for XBMC. It doesn't support linux services but I'm actually planning to add this to the existing script.  http://forum.xbmc.org/showthread.php?tid=110392