Saturday, April 2, 2011

PyInsteon - An Insteon / X10 library for Python

Just published an initial version of PyInsteon on GitHub.   This Python library enables use of Home Automation protocols such as Insteon and X10 to control lighting and other devices via the SmartLabs 2412N interface.

It is a GPL open-sourced project and welcome anyone's contributions and help.  Just drop me an email.

Find the source code and library file here: https://github.com/zonyl/pyinsteon


Example:
import pyinsteon

    def x10_received(houseCode, unitCode, commandCode):
        print 'X10 Received: %s%s->%s' % (houseCode, unitCode, commandCode)

    def insteon_received(*params):
        print 'Insteon REceived:', params

    pyI = PyInsteon(TCP('192.168.0.1', 9671))
    pyI.getVersion()
    pyI.sendX10('m', '2', 'on')
    pyI.onReceivedX10(x10_received)
    pyI.onReceivedInsteon(insteon_received)
    select.select([],[],[])   

2 comments:

  1. Hey Jason, I saw in the source code that you started to include some sort of XPL support.

    How were you planning to use your code ? Domogik maybe ?

    ReplyDelete
  2. The PyInsteon library has been deprecated since mid-2012. Use the PYTOMATION library instead, found at https://github.com/zonyl/pytomation.

    ReplyDelete