The idea of a FloorPlan UI has been kicked around for awhile, both here and on the old forum, yet I've never actually seen an example of one let alone had the opportunity to try it.
I've had no burning need to build one for my own use (IMHO, FloorPlan UI = Eye Candy) but the technical challenge has intrigued me. What would I want in a FloorPlan UI?
- Viewed in Premise Browser
The flooplan must be visible in Premise Browser (i.e. it must work with AutomationBrowser) because I don't want to switch to another application or web-page to view it.
- Simple tools
Creating the floorplan image ought to be easy. I know how to use a CAD program, but that should not be a requirement to create a usable floorplan diagram. It should be able to use a PNG or GIF file marked up with a rudimentary floorplan.
- Use what already exists
One of the steps in creating a Premise Home is to define all interior (floors, rooms, hallways, basement, attic, etc) and exterior (yard, pool, shed, etc) locations. The FloorPlan UI should take advantage of the existing architecture. It should not require me to redefine the rooms nor the objects (i.e. lights) contained in the rooms. If I add a light to the Family room, it should automatically appear in the FloorPlan UI.
- Flexibility
I live in a two-storey cottage but I did not define floors in my Premise Home. However, I may want to see Floors in the FloorPlan UI. The FloorPlan UI should use what's defined in my Premise Home but I want some flexibility. In Premise-speak, I want the FloorPlan UI to automatically use Locations that are categorized as Rooms (FamilyRoom, Kitchen, etc) but I want control over Locations categorized as Building (Garage, House,Shed, etc) and Building SubArea (Floor, Wing, etc).
Based on these requirements, here's how the FloorPlan UI would work:
- Create a new FloorPlan object in Premise Home and call it "FirstFloor".
- FirstFloor contains three properties:
- Diagram
- HorizontalMargin (pixels)
- VerticalMargin (pixels)
- Click Diagram and select an existing image file containing a floor plan of your home.
- If your home schematic is drawn with a whitespace margin, along the left and top of the image, enter the margin size (pixels) in HorizontalMargin and VerticalMargin.
- Repeat all steps for other floors.
You now have a FloorPlan object that knows how to display a diagram of the first-floor but isn't aware of what is in it. The next step fixes that.
- Right-click "FirstFloor" and add a new "RoomReference".
- RoomReference has a property called "Reference". Click Reference and select an existing Room in your Home such as Kitchen.
For clarity, rename "RoomReference" to "Kitchen".This will occur automatically.
- Repeat steps 1-3 for other first-floor rooms in your Home.
You now have a FloorPan object called "FirstFloor" that contains references to all existing, first-floor rooms in Premise Home. It has a diagram of the first-floor but it doesn't know where each room is located in the diagram. The next step fixes that.
- Each Room in Premise Home has the following four new properties:
- HorizontalOffset
- VerticalOffset
- HorizontalSize
- VerticalSize
- The Offset properties are used to indicate, in pixels, where the room's upper-lefthand corner lies with respect to the floor's upper-lefthand corner (see the attached image).
- The Size properties are used to indicate the room's size in pixels.
- For each room, enter the appropriate Offset and Size values.
Now the "FirstFloor" FloorPlan object knows each room's size and location on the diagram. It is ready to display the contents of each room.
When viewed in Premise Browser, you'll see a "FirstFloor" button. When clicked it displays the supplied diagram and lists all objects, and their state, in each room.
What's missing? Well, it does not know a Light's precise location within a Room. A more advanced version of FloorPlan would introduce Offset properties for Lights so you could specify a FloorLamp's location within a room. In fact, a truly advanced version wouldn't force you to think in pixels but would support feet and inches.
Your thoughts?