Here's how I customize the UltraView framework written by Ultra Jones...
Step 1: Getting device info to show up
First, once UltraView is installed, let's make sure you can get some of your devices to show up on the ultra_view2_status.asp (QuickView). Do this by choosing an existing section that you would probably still use like lights or weather and locate the corresponding xsl file in the \Homeseer\HTML folder. For this example, edit the ultra_view2_status_lights.xsl and find the following similar code:
<xsl:for-each select="DEVICE">
<xsl:sort select="LOCATION" order="ascending" />
<xsl:if test="NAME = 'Front Lights' or NAME = 'Driveway Lights' or NAME = 'Deck Lights' or NAME = 'Hallway' or NAME = 'Lamp' or NAME = 'Entertainment' or NAME = 'Recessed Lighting' or NAME = 'Niche' or NAME = 'Curio'">
<tr>
<td class="tableroweven" width="20%" valign="top" align="left">
<xsl:value-of select="LOCATION" />
</td>
<td class="tableroweven" width="50%" valign="top" align="left">
<xsl:value-of select="NAME" />
</td>
<td class="tablerowodd" width="30%" valign="top" align="left">
<xsl:apply-templates select="ICON" />
<xsl:apply-templates select="STRING" />
</td>
</tr>
</xsl:if>
</xsl:for-each>
This is where you control which devices show up in that section. In the code above, we are choosing our devices based on Device Location. Change the 'if test' line to contain all of the devices you wish to appear in this section (make sure spelling is exact). Also, notice the table data for what shows up (and in what order) is also specified as well as the widths of each column. This example will display three columns; location, name and Icon w/ device string.
Your sort can also look like:
<xsl:for-each select="DEVICE">
<xsl:sort select="NAME" order="ascending" />
<xsl:if test="TYPE = 'Computer'">
This would pull all devices that have a device name of 'Computer'.
NOTE: Be careful editing the xsl files since keywords must be lower case. When you have an 'if' spelled as 'If' or 'select' as 'Select', the section will not be displayed.
Step 2: Adding new sections to ultra_view2_status.asp
Next, lets look closer at what is calling this xsl. In the ultra_view2_status.asp, each table is created with code similar to the following:
<td width="100%" valign="top" align="left" colspan="2" class="tableheader">Lighting</td>
</tr>
<tr>
<td colspan="2">
<div id="divlights" style="height=190; overflow: auto;">
<table border="0" width="100%" cellpadding="2" cellspacing="3">
<tr>
<td class="tablerowodd"></td>
</tr>
</table>
</div>
</td>
Notice the <div id> tag is "divlights". This refers to the the ultra_view2_status_lights.xsl we modified in Step 1. For every section where device data will be passed through, you need a div tag and corresponding xsl named the same. Next, lets look at adding a new div section and xsl. There is a file called ultra_view2_status.txt also in the \Homeseer\HTML directory. Edit this file and look for a subroutine called ProcessData. This sub refreshes the data using XML and will need to be modified when you add a new section. Here is how the code looks in the ProcessData sub:
set objDivElement = document.all.divSystemInfo
Call LoadDiv("ultra_view2_status_sysinfo.xsl", objDivElement)
set objDivElement = document.all.divWeather
Call LoadDiv("ultra_view2_status_weather.xsl", objDivElement)
set objDivElement = document.all.divLights
Call LoadDiv("ultra_view2_status_lights.xsl", objDivElement)
Step 3: Running the ultra_view2_status.asp
Next, lets try to run the asp by specifying http://localhost:81/ultra_view2_status.asp in your browser. (change port for web server if necessary) If the devices show up then it worked! If not, there is probably a problem with the data being parsed in xml. The best way to find and fix it is to run the http://localhost:81/ultra_view2_xml.vbs script. This should show you all of the xml data for your page. If there is an error (degree symbol is very common) then you should get a script error with a line number. This will help you troubleshoot where the problem is. Refer to step 4 for how to fix.
Step 4: Adding icons and modifying device strings
If you are getting script errors in Step 3 or would like to add icons to your devices, edit the file \HomeSeer\HTML\Include\ ultraview2_xml.inc. You will see case statements based upon device name, location and/or type. Add cases for each specific device name with code to update the device icon. You could also replace any characters that xml is having trouble parsing here. Alot of that is already being done.
Step 5: Adding other non-device related sections to the QuickView
This is pretty easy once you figure out where to add the new table. For me, it took a little playing around to get the weather maps, network status and Caller ID sections in place. Look in my ultra_view2_status.asp for ideas on how this can be done.
Well, that's it! I am not using the floorplan portion of the UltraView so no info on that. I am certainly no expert, but this is what I've learned so far. If I forgot anything or if others have additional ideas, please chime in!
Thanks,
-Tom
Visit my HomeSeer at http://68.55.68.192:81 (New Guest Downloads!)
[This message was edited by Tom Kern on Tue, 30 December 2003 at 09:59 AM.]
Step 1: Getting device info to show up
First, once UltraView is installed, let's make sure you can get some of your devices to show up on the ultra_view2_status.asp (QuickView). Do this by choosing an existing section that you would probably still use like lights or weather and locate the corresponding xsl file in the \Homeseer\HTML folder. For this example, edit the ultra_view2_status_lights.xsl and find the following similar code:
<xsl:for-each select="DEVICE">
<xsl:sort select="LOCATION" order="ascending" />
<xsl:if test="NAME = 'Front Lights' or NAME = 'Driveway Lights' or NAME = 'Deck Lights' or NAME = 'Hallway' or NAME = 'Lamp' or NAME = 'Entertainment' or NAME = 'Recessed Lighting' or NAME = 'Niche' or NAME = 'Curio'">
<tr>
<td class="tableroweven" width="20%" valign="top" align="left">
<xsl:value-of select="LOCATION" />
</td>
<td class="tableroweven" width="50%" valign="top" align="left">
<xsl:value-of select="NAME" />
</td>
<td class="tablerowodd" width="30%" valign="top" align="left">
<xsl:apply-templates select="ICON" />
<xsl:apply-templates select="STRING" />
</td>
</tr>
</xsl:if>
</xsl:for-each>
This is where you control which devices show up in that section. In the code above, we are choosing our devices based on Device Location. Change the 'if test' line to contain all of the devices you wish to appear in this section (make sure spelling is exact). Also, notice the table data for what shows up (and in what order) is also specified as well as the widths of each column. This example will display three columns; location, name and Icon w/ device string.
Your sort can also look like:
<xsl:for-each select="DEVICE">
<xsl:sort select="NAME" order="ascending" />
<xsl:if test="TYPE = 'Computer'">
This would pull all devices that have a device name of 'Computer'.
NOTE: Be careful editing the xsl files since keywords must be lower case. When you have an 'if' spelled as 'If' or 'select' as 'Select', the section will not be displayed.
Step 2: Adding new sections to ultra_view2_status.asp
Next, lets look closer at what is calling this xsl. In the ultra_view2_status.asp, each table is created with code similar to the following:
<td width="100%" valign="top" align="left" colspan="2" class="tableheader">Lighting</td>
</tr>
<tr>
<td colspan="2">
<div id="divlights" style="height=190; overflow: auto;">
<table border="0" width="100%" cellpadding="2" cellspacing="3">
<tr>
<td class="tablerowodd"></td>
</tr>
</table>
</div>
</td>
Notice the <div id> tag is "divlights". This refers to the the ultra_view2_status_lights.xsl we modified in Step 1. For every section where device data will be passed through, you need a div tag and corresponding xsl named the same. Next, lets look at adding a new div section and xsl. There is a file called ultra_view2_status.txt also in the \Homeseer\HTML directory. Edit this file and look for a subroutine called ProcessData. This sub refreshes the data using XML and will need to be modified when you add a new section. Here is how the code looks in the ProcessData sub:
set objDivElement = document.all.divSystemInfo
Call LoadDiv("ultra_view2_status_sysinfo.xsl", objDivElement)
set objDivElement = document.all.divWeather
Call LoadDiv("ultra_view2_status_weather.xsl", objDivElement)
set objDivElement = document.all.divLights
Call LoadDiv("ultra_view2_status_lights.xsl", objDivElement)
Step 3: Running the ultra_view2_status.asp
Next, lets try to run the asp by specifying http://localhost:81/ultra_view2_status.asp in your browser. (change port for web server if necessary) If the devices show up then it worked! If not, there is probably a problem with the data being parsed in xml. The best way to find and fix it is to run the http://localhost:81/ultra_view2_xml.vbs script. This should show you all of the xml data for your page. If there is an error (degree symbol is very common) then you should get a script error with a line number. This will help you troubleshoot where the problem is. Refer to step 4 for how to fix.
Step 4: Adding icons and modifying device strings
If you are getting script errors in Step 3 or would like to add icons to your devices, edit the file \HomeSeer\HTML\Include\ ultraview2_xml.inc. You will see case statements based upon device name, location and/or type. Add cases for each specific device name with code to update the device icon. You could also replace any characters that xml is having trouble parsing here. Alot of that is already being done.
Step 5: Adding other non-device related sections to the QuickView
This is pretty easy once you figure out where to add the new table. For me, it took a little playing around to get the weather maps, network status and Caller ID sections in place. Look in my ultra_view2_status.asp for ideas on how this can be done.
Well, that's it! I am not using the floorplan portion of the UltraView so no info on that. I am certainly no expert, but this is what I've learned so far. If I forgot anything or if others have additional ideas, please chime in!
Thanks,
-Tom
Visit my HomeSeer at http://68.55.68.192:81 (New Guest Downloads!)
[This message was edited by Tom Kern on Tue, 30 December 2003 at 09:59 AM.]
Comment