7.8 Next Steps
Congratulations! Now that you can control a lamp or appliance via a graphical toggle switch on your Android phone, a whole new world of home automation possibilities awaits.
You could continue to enhance the native mobile client by controlling multiple X10 switches in a facile and elegant manner based on the time of day and the GPS coordinates of your mobile device (ex: turn on the porch light after dark when you’re within a five-meter radius of the front door). While we won’t be building this location-based application in this book, you have the basic building blocks already in your possession. If you’re interested in going further, read Ed Burnette’s Hello, Android [Bur10] for some really helpful tutorials, then post your ideas and creations on the Programming Your Home website!
Several other improvements can be made to the configuration to make the system more robust and user friendly. These include the following:
-
Improve application error trapping and reporting. X10 methods are “fire and forget” events that do not inherently return success or failure. As such, there are plenty of enhancements that can be made to the web service to troubleshoot nearly everything else up to the point of X10 command transmissions. Before sending a message, trap for and report on X10 computer interface connection errors. Knowing that the X10 interface is down is far more helpful than seeing no action from the switch without any explanation of why.
-
Invest in several more X10 modules, ranging from two-way (LM14A) and the Socket Rocket lamp (LM15A) to wall socket (SR227) and heavy-duty appliance (HD243) modules. Send Heyu transmission events simultaneously to multiple X10 devices. For example, using a single method call, turn on lights in the kitchen; power up the toaster, coffee maker, and ceiling fan; and report back to the mobile client when coffee will be brewed and a toasted bagel will be ready.
-
If you prefer a more lightweight Ruby-based web framework, consider replacing the Ruby on Rails server application with one using Sinatra.[77] While it hasn’t yet matched the popularity of Rails, Sinatra is nevertheless a pretty nifty minimalist Ruby-based framework that is worthy of a closer look.
-
Dress up the mobile user interfaces with a more elegant, multifunctional front end that can be used for multiple web-enabled switches, appliances, garage door openers, and more.
-
Extend functionality to other projects, such as an Arduino-based TV remote, or link together interface controls to other projects in this book, such as Chapter 8, Curtain Automation, and Chapter 9, Android Door Lock.