Integrating an Android phone into my home automation system
My home automation system has long had the capability to communicate with a Panasonic PBX. From the PBX it gets a flow of information about every phone call in or out the house. It also has a couple of caller-ID-to-serial-port devices that give it an earlier notification of incoming calls with Caller ID information. Using these various inputs it builds a database of every caller and every call (time of day, duration, person).
If it sees a call from someone not already in the database it will ask (via chat) for you to enter their full name. It then updates its database replacing the caller ID name (which is often useless, especially for mobile numbers). You can also query it using the natural language interface to ask about any calls you might have missed, or to lookup a number by time of day or by a fragment of their name. You can even ask complex queries like "who called last year on a friday after 5pm" and it will construct an efficient SQL query to get the results.
It also synchronizes all these contact records with Google Contacts.
But until recently my mobile phone hasn't been part of the home automation system. Yes, I can use it as an input device for Google Talk, and yes, the house still notices when it comes and goes because the house tracks every device that ever gets an IP address on the local network, but other than that it really doesn't 'understand' much about my cell phone.
But that's about to change. Recently I installed Tasker on my Android phone and using that app I can now set up a whole variety of triggers that can report back to the home automation system information such as phone calls made or received, GPS location, wifi-located position, phone unlocks, shakes and more.
So I've extended the web interface on the Home Automation web server to accept POSTs from Tasker with updates from my cell phone. These are placed into a PubSubHub implementation that uses SignalR to distribute messages to any connected clients. The home automation server is itself a client of this service (it publishes information about every device change in the house and the PubSubHub shares those updates with any connected Web client) so you get real-time updates for what's happening in the house on the house's web page. Extending that architecture to include messages from remote devices like the Android phone was easy and I plan to use it in the future for other remote devices, such as a Netduino with a collection of environment and HVAC sensors on it (more about that later).
As to precisely what I'll do with this new capability I have a long list of features to implement now:
1) Logging all cell phone calls to the same database, automatically building my contacts list 2) Tracking how long it takes to get to work by each of the various ways I can go, correlating that with the traffic flow information and automatically figuring out which route I should take for future trips 3) Shake cellphone to change music in the house 4) Adjusting the heating at home based on how far away we are (and thus the soonest we could get back) 5) Finishing up my semantic, location-aware shopping list (knows which store you are in and what you need there and presents it in order by aisle) 6) Automatically delivering notifications by the best possible means (talking on the speakers at home, XMPP, or by email if I'm in a different time zone) etc.