“IP camera”

All posts tagged “IP camera”

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

[CODE] 
##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, "")
        self.addControl(self.image)

viewer = CamView()
viewer.show()
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')
    viewer.image.setImage("")
    viewer.image.setImage("/tmp/bell.jpg")
    #Define image transparency 
    viewer.image.setAnimations([('conditional', 'effect=fade start=90 end=90 time=0 condition=true',)])
    xbmc.sleep(500)
viewer.close()
del viewer

[/CODE]

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.

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

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/