Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Saturday, February 16, 2008

Video of xPL Gmail in Action

Here's a video of the xPL Gmail script I hacked together the other day. On the right of the screen is an RDP session to the HA server showing xPL Gmail running in a command prompt and the DCM message viewer below that. To the left is our HA GUI. I just added the capability of displaying osd.basic messages to our GUI.

A test email is sent to the monitored Gmail account. xPL Gmail polls for new mail periodically and when it finds a new message, it issues an osd.basic xPL message which is captured by the DCM logger. xAP Floorplan grabs OSD messages and dumps them into the HA MySQL database which our GUI pulls data from. The message gets displayed in the GUI for a short time before disappearing.

Sunday, February 10, 2008

Home Automation GUI Video

Here's a video of the HA interface I've been building. It's a few months old now and has been posted on a few HA forums here & there. Since Comcast bumped web page capacity, I decided to leave the video up and link to it from here

This pretty much represents all systems interacting together - starCOMUltra, xPL, xAP, HAL - and tied together with AJAX, MySQL, PHP and DHTML running on Apache.

Sunday, August 19, 2007

AJAX, PHP & MySQL

After playing around with writing some Google Gadgets, I got to see how easy it is to create pages with AJAX. As a result, I spent the last several weeks adding MySQL to our setup. All status from devices in starCOMUltra are mirrored to a MySQL database. xAP Floorplan scripts have been changed to use MySQL for checking status instead of querying the starCOMUltra COM object directly. It adds an extra layer, but this should make the system more robust as MySQL is more capable to scale as the number of queries grows. It will also allow other apps to keep functioning without erroring out (albeit with stale data) when I take down sCU to do some maintenance.

One thing that can make the number of queries grow is building web pages with AJAX. I've been re-writing our house floorplan control page to present the state of the house updated every 10-15 seconds. Since it pulls data from MySQL instead of the sCU COM object, it leaves sCU to respond to more immediate needs like turning on lights, etc. Using AJAX, I'm reducing the load on the web server since the page no longer does an HTTP refresh. The screen is updated seamlessly since the page doesn't reload entirely and that improves the user experience. I've also converted our TiVo control pages to AJAX so they no longer have the annoying refresh after clicking a button.

This required a move of many pages to Apache instead of IIS, so I'm running both servers. IIS serves ASP and Apache serves AJAX with PHP. This works out well because it offloads IIS which isn't as robust a server.

Overall, this is working out to be a great improvement for our system making it more stable and robust. It's also been a great opportunity to learn about and use AJAX, PHP and MySQL in a real application - much better than learning from canned demos.