I am working on a PHP application that gives me a web based layout of my house and the status of my x10 devices (mainly lighting). What I have so far is a MySQL database which holds the information for my house.
The tables consist of the floorplans, the object types (module types), and the individual objects (addressed modules).
The floorplans are just images that I created a while back using an online demo version of a home remodeling design program. From there I was able to save them as images and do the final manipulation in gimp graphics editor.
The object types too are images (icon size). For example, a relay light module would use 2 object type images. One of a light bulb on, and another of that light bulb off. Another example I have is one for my ceiling fans. I have a plain image of a small fan for the fan being off. I then have an animated image of the fan rotating for the fan being on. The reason for the object type definitions is so I can define multiple types for a certain kind of module. For example, I can have a lamp module that controls a table top lamp in one part of the house, and a hanging light in another part of the house, both of which I may want to be represented by different icons.
The last table is for the objects. Each object is defined by the floorplan it is to be represented on, two object type ids (an on and an off object type), the center x and y position of the object in relation to the floorplan image, and it's house and unit codes.
The script heavily uses CSS positioning to place the objects on the floorplan layout. So far I have the script using the queryplc command to check the state of each of the modules and display it's on or off icon. Here is my current working example
http://66.190.8.188:8088/index.php. Not all the objects in my example are actually installed, but I plan to install them in the near future. Some are activated in AHP for demonstration purposes.
Plans I have for the future of this:
- Create other object types for possible non-x10 integration for things such as my RCS TR-40 thermostat to show and control temperature
- Create a login page to be able to run extended features. For example, view only when not logged in, and full system control when logged in.
- Give the ability to turn objects (modules) on or off.
- Keep a database log of x10 and other object/module actions executed by the system.
- Create informational graphs of data logged by the system.
This project is in it's infancy, but if anyone is interested in any of the code I currently have, shoot me a PM and I'll get you a copy. I will provide you with all of my object images, but you will need to provide your own floorplan images. My floorplan images are 1015px X 442px to give you an idea of the size of my layout.
Happy coding...
Dan B.