Home automation with perl and x10 l.jpg
This presentation is the property of its rightful owner.
Sponsored Links
1 / 26

Home Automation with Perl and X10 PowerPoint PPT Presentation


  • 131 Views
  • Uploaded on
  • Presentation posted in: General

Home Automation with Perl and X10. Mike Schilli, Yahoo! 06/25/2007. What’s X10?. Sender sends signals over power lines Receiver switches electrical devices on/off Cheap Technology Sender $10 Receiver $10. What can you do with X10?. Examples include … Water your plants

Download Presentation

Home Automation with Perl and X10

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Home automation with perl and x10 l.jpg

Home Automation with Perl and X10

Mike Schilli, Yahoo!

06/25/2007


What s x10 l.jpg

What’s X10?

  • Sender sends signals over power lines

  • Receiver switches electrical devices on/off

  • Cheap Technology

    • Sender $10

    • Receiver $10


What can you do with x10 l.jpg

What can you do with X10?

Examples include …

  • Water your plants

  • Reboot your cable modem

  • Control any device via Gaim/Jabber


X10 signal flow l.jpg

X10 Signal Flow


X10 cm11 control unit l.jpg

X10 CM11 Control Unit

  • Serial plug connects to PC

  • Power plug injects X10 signals into power line

  • < $10 plus shipping on Ebay

  • Don’t have a serial port? Buy a PCI card (ttyS4/5)

  • Alternatively: CM17 (RF)


No serial port l.jpg

No Serial Port?

  • PC: $10 PCI card

    • /dev/ttyS4

  • Mac: $30 Keyspan 19HS

    • /dev/ttyS0


Receiver l.jpg

Receiver

  • E.g. connected to your Cable Modem:


Protocol l.jpg

Protocol

  • One four-bit house code (A-P)

  • One or more four-bit unit code(s) (1-16)

  • One four-bit command

  • Example:

    “House Code K”, “Unit 9”, “Turn on”


How x10 transmits l.jpg

How X10 transmits


How x10 transmits10 l.jpg

How X10 transmits


Protocol11 l.jpg

Protocol

  • 1110 Starting sequence

  • Binary 1: Presence, Absence

  • Binary 0: Absence, Presence

  • Each signal sent twice

  • Overall data transfer: 20 bits/sec


Setting up a serial port l.jpg

Setting up a serial port

  • Init serial port:

    use Device::SerialPort;

    my $serial = Device::SerialPort->new(

    “/dev/ttyS0”, undef);

    $serial->baudrate(4800);

  • Send command:

    use ControlX10::CM11;

    ControlX10::CM11::send($serial,

    $house_code . $unit_code);

    ControlX10::CM11::send($serial,

    $house_code . “J”); # J=ON K=OFF


Receivers l.jpg

Receivers

  • Lamp Module:

    • Triac Solid State

    • On/Off/Dimming

    • No Appliances or electronic devices

  • Appliance Module:

    • Relay switches On/Off

    • Maintains last state during power outages


Example 1 lights on off with gaim l.jpg

Example 1: Lights on/off with Gaim

  • Net::Jabber


Example 1 lights on off with gaim15 l.jpg

Example 1: Lights on/off with Gaim

  • A Jabber listener performs X10::CM11 commands:


Example 2 x10 console l.jpg

Example 2: X10 Console

  • YUI components for ajaxed web console

  • Reboot routers, print servers, DSL modem


Example 3 water your plants l.jpg

Example 3: Water your Plants

  • Aquarium Pump in Water container

  • Switched on/off by X10

  • Host checks weather report (Weather::Com) to determine amount of water

  • Secured by external timer


Video demo l.jpg

Video Demo


X10 home l.jpg

X10::Home

use X10::Home;

my $x10->X10::Home->new();

# Address services by name

$x10->send("bedroom_lights", "on");

# Also remembers status


X10 home20 l.jpg

X10::Home

#x10.conf sample file

module: ControlX10::CM11

device: "/dev/ttyS0“

receivers:

- name: office_lights

code: K10

desc: Office Back Lights

- name: water

code: K11

desc: Plant Sprinkler


Problems with x10 l.jpg

Problems with X10

  • No security on the X10 level

  • No feedback with cheap units

  • Signals get lost

  • Power outages might affect outcome

  • Two senders: Collisions

  • Slow (1 sec/command)


Precautions l.jpg

Precautions

  • Use Fail Safe strategies

  • Limit potential damage

  • Consider additional autonomous devices like digital timers


Slide23 l.jpg

Q&A

Questions?


Thanks l.jpg

Thanks!

Contact: [email protected]


References l.jpg

References

  • X10 YUI Console http://www.linux-magazin.de/heft_abo/ausgaben/2007/04/heimschaltwarte

  • http://www.linux-magazine.com/issue/50/Perl_Building_a_Jabber_Bot.pdf

  • ftp://ftp.x10.com/pub/manuals

  • http://misterhouse.net

  • Moshe Bar, “Home Automation with Perl”, TPJ, 02/2003


References continued l.jpg

References (continued)

http://forums.cabling-design.com/X10-and-Linux-article12453--49.htm


  • Login