Skip to content
ggodart edited this page Jan 10, 2021 · 5 revisions

MisterHouse Floor Plan Support page

Note: The floor plan software works best with Firefox and Mozilla. IE, Safari and Opera have various issues with displaying the floor plan as intended. Also this page documents the default floor plan software. There appears to also be an SVG version of MisterHouse's floor plan and it appears to be broken. Further work needs to be done for that software.

Introduction

MisterHouse has a relatively simple way to create a layout out of the floor plan for your home. By creating a .mht file (a MisterHouse Table-A file ending in .mht) in your user code directory you can create a floor plan (from the [main] web page -> [Lights Appliances] -> [Floorplan view]).To simplify and avoid coding errors I recommend that you create 1 .mht file with all your definitions for a single interface. The file must start with:

    Format = A

Note: There is also an XML version of the .mht file also but that won't be documented here.

In the grey box below is the format for creating the floor plan. You will need to modify your .mht directly. There is no way to add these group definitions with the MisterHouse web interface. Also I had trouble modifying my existing GROUP definitions, so edit them directly in the items.mht.

Simply add the GROUP definitions to the beginning (after the Format = A line above). For Example:

#...existing _items.mht_. (with GROUP already added):

    Format = A
   
    # Floor planing info:
    #  - If you include x,y data, you can monitor and control these items
    #    with the web floorplan page:  http:_localhost:8080/bin/floorplan.pl
    #  - For items, specify the x,y after the room group name:  room_group(x;y)
    #  - For room groups, specify x,y,width,height relative to its
    #    parent group:   Group, room_group, parent_group(x;y;w;h)
    #  - By default, floorplan.pl will use $Property as the top level group
    
    # Define Room groups for floorplan
    # Numbers are X-coordinate, Y-coordinate, width, height
    GROUP, BackPorch,    Property(1;0;20;8)
    GROUP, FamilyRoom,   Property(1;8;18;15)
    GROUP, Kitchen,      Property(1;23;18;14)
    GROUP, LivingRoom,   Property(1;37;16;21)
    GROUP, FrontPorch,   Property(1;58;27;8)
    GROUP, Garage,       Property(28;40;18;22)
    GROUP, Office,       Property(17;43;11;15)
    GROUP, Laundry,      Property(17;37;8;6)
    GROUP, Pantry,       Property(19;28;9;6)
    GROUP, HallBath,     Property(21;17;5;11)
    GROUP, KirksRoom,    Property(33;29;13;11)
    GROUP, GuestRoom,    Property(33;16;13;11)
    GROUP, MasterBed,    Property(21;0;15;17)
    GROUP, MasterBath,   Property(36;0;10;10)
    GROUP, MasterCloset, Property(36;10;10;7)

Note: I need to integrate the above into the updates below

New section under edit:

MisterHouse has a relatively simple way to create a layout out of the floor plan for your home. By creating a .mht file (A MisterHouse table-A file ending in .mht) in your user code directory you can create a floor plan (from the [main] web page -> [Lights Appliances] -> [Floorplan view]).To simplify and avoid coding errors I recommend that you create 1 .mht file with all your definitions for a single interface.

items.mht

The MHT file contains definitions for various devices and attribute that MisterHouse uses. Things like the device interface, the rooms for the floor layout, the devices controlled by MisterHouse. Further information on the MHT file can be found on the @MHT File.

The file must start with:

Format = A

Next it is recommended that you put your interface near the start of the file but only if you need to define your interface in the MHT file. This example uses an Insteon Interface so it looks like this:

    Format = A
   
    # Define the Communication interface at the from (to avoid getting a Dummy Interface instead!)
    # <Interface>,  <ObjectName>, <options - if needed>
    Insteon_PLM,    myPLM,

Note the lines that begin with #, those are comments and they are ignored by MisterHouse. Not all interfaces use the same syntax so check the documentation for your interface.

The next recommendation is to add your GROUPS. These are the rooms of your home's floor plan. I've made up a floor plan for a Cape Cod (close enough for government work ... ;-) which looks like this:

The Cape Cod floor plan

The MHT entries look like this:

    Format = A
    
    # Define the Communication interface at the from (to avoid getting a Dummy Interface instead!)
    # <Interface>,  <ObjectName>, <options - if needed>
    Insteon_PLM,    myPLM,
    
    # Floor planing info:
    #  - If you include x,y data, you can monitor and control these items
    #    with the web floorplan page:  http://localhost:8080/bin/floorplan.pl
    #  - For items, specify the x,y after the room group name:  room_group(x;y)
    #  - For room groups, specify x,y,width,height relative to its
    #    parent group:   Group, room_group, parent_group(x;y;w;h)
    #  - By default, floorplan.pl will use $Property as the top level group
    
    # Numbers are X-coordinate (Col), Y-coordinate (row), width(->), height(v)
    
    # Define Room groups for floorplan
    #GROUP, GroupName,  LayoutName(X;Y;h;w)
    GROUP,    PA,    CapeCod(0;1;16;10)    
    GROUP,    KI,    CapeCod(0;11;16;11)
    GROUP,    BA,    CapeCod(11;11;6;11)
    GROUP,    B1,    CapeCod(17;11;10;11)
    GROUP,    FYo,   CapeCod(11;22;9;3)
    GROUP,    CL,    CapeCod(20;22;6;3)
    GROUP,    LR,    CapeCod(0;22;17;14)
    GROUP,    ST,    CapeCod(16;25;3;11)
    GROUP,    B2,    CapeCod(19;25;12;11)   
    GROUP,    PO,    CapeCod(0;36;32;4)

The current version of floorplan can only handle basic squares and rectangles shapes. Groups should not overlap, otherwise the layout will come out wrong. I've chosen two and 3 letter Group names only because some of the rooms are narrow and barely fit the names. If the room is large enough then you may use longer names (experiment a bit).

Next add your devices to be controlled (the Insteon interface supports both X10 and Insteon devices).

    # Type    Address   Name     Groups             Other Info
    #
    X10I,     J1,       DadsLamp,    J|LR(0;7),    myPLM
    X10I,     J2,       CouchLamp1,  J|LR(3;0),    myPLM
    X10I,     J2,       CouchLamp2,  J|LR(8;0),    myPLM
    X10I,     J3,       FoyerLight,  J|FYo(4;0),   myPLM
    X10I,     J4,       PatioLight1, J|PO(4;0),    myPLM
    X10I,     J5,       PatioLight2, J|PO(12;0),   myPLM
    X10I,     J4,       PatioLight3, J|PO(20;0),   myPLM
    X10I,     J6,       PatioLight,  J|PA,         myPLM

This X10 device (DadsLamp) will be added to the J, and LR groups. Note the 0:7 are coordinates are a relative offset from within the room. If you don't assign and offset the device is added to the bottom right of the room and the next device will be placed next to it. The previous devices look like this:

Cape Cod floor plan with devices

One thing to remember is that you can't put the icons exactly where you want them. Just try to get them reasonable placed. Also if the device is in an unknown state a link will not be provided. Instead test with the device's name and current state will be added to the page until the device state becomes known.

Adding Icons to objects

Flooplan.pl uses a default set of icons for its objects (devices) in a room. This tends to be a lamp for most objects. Sometimes it's helpful to use different icons for the object being controlled.

    X10O,     J6,       CR_Therm,  J|CR,         myPLM

In this example the device is a X10 thermostat who MisterHouse object is CR_Therm. To change the icons used by various states (such as on and off) add this code to a file in you code directory. My preference is for a file called icons.pl.

    # $object->set_fp_icons( on => '<path to on icon>', off  => '<path to off icon>');
    $object->set_fp_icons( on => 'fp-therm-off.png', off  => 'fp-therm-off.png');

The images should be stored in the ${MH_HOME}/web/graphics directory in the main MisterHouse directory. Other devices may support addition or different states (such as still, motion or complete). Check the modules Perl Module to determine the supported states.

Floor Plan SVG

The latest SVG software works with most modern browsers see here

Floor Plan SVG Requirements:

  • MisterHouse r1785 or later
  • SVG.pm installed
  • Browser with SVG support

Introduction

The Scalable Vector Graphics SVG version of the Floor Plan software is similar to the look and feel of the original Floor Plan software. Every 10 seconds the page is refreshed and any changes in device state is reflected on the we page.

Code Examples

    Format = A   
    # Define the Communication interface at the from (to avoid getting a Dummy Interface instead!)
    # <Interface>,  <ObjectName>, <options - if needed>
    Insteon_PLM,    myPLM,
    
    # Floor planing info:
    #  - If you include x,y data, you can monitor and control these items
    #    with the web floorplan page:  http://localhost:8080/bin/floorplan.pl
    #  - For items, specify the x,y after the room group name:  room_group(x;y)
    #  - For room groups, specify x,y,width,height relative to its
    #    parent group:   Group, room_group, parent_group(x;y;w;h)
    #  - By default, floorplan.pl will use $Property as the top level group
    
    # Numbers are X-coordinate (Col), Y-coordinate (row), width(->), height(v)
    
    # Define Room groups for floorplan
    #GROUP, GroupName,  LayoutName(X;Y;h;w)
    GROUP,    PA,    CapeCod(0;1;16;10)
    
    GROUP,    KI,    CapeCod(0;11;16;11)
    GROUP,    BA,    CapeCod(11;11;6;11)
    GROUP,    B1,    CapeCod(17;11;10;11)
    GROUP,    FYo,   CapeCod(11;22;9;3)
    GROUP,    CL,    CapeCod(20;22;6;3)
    GROUP,    LR,    CapeCod(0;22;17;14)
    GROUP,    ST,    CapeCod(16;25;3;11)
    GROUP,    B2,    CapeCod(19;25;12;11)
    
    GROUP,    PO,    CapeCod(0;36;32;4)

Still needs the devices and additional information added

Layout

blah blah blah

Image of Cape Cod with devices goes here

ToDo:

  • add scenes info
  • Add a more detailed explanation of dealing with icons and states
  • add explanation that hovering over the icon, displays the current device name and state (that version needs to be checked into svn)
  • Add explanation of how to layout devices in a room
  • Add arbitrary images to the floor plan
  • Further explain what SVG floor plan can do and how to use it.

//added the beginning section explaining the need to modify items.mht directly - tv - 20080625// This is a work in progress - //njc - 20101125//

Clone this wiki locally