Device Stats

Forum over Homeseer scripts (DUTCH forum)

Moderators: Ruud, TANE

Device Stats

Postby Alexander » Wed Sep 02, 2009 11:51 pm

Gents,

Anybody interested in my script/asp.net pages to show statistics about changes of device and/or devices that report values and show this in a graph?


An example (displaying an RFXCOM pulse and a plugwise circle):

Image

Alexander
Alexander
Global Moderator
Global Moderator
 
Posts: 1531
Joined: March 2007
Location: Netherlands

Device Stats

Postby Bastiaan » Thu Sep 03, 2009 8:43 am

For sure, I would love to see how my Roof is moving up and down through the day [:D]

Bastiaan
Bastiaan
Senior Member
Senior Member
 
Posts: 1003
Joined: May 2008
Location: Netherlands

Device Stats

Postby Alexander » Thu Sep 03, 2009 9:15 am

Will post it tonight. Have some hard coded things to change.

Alexander
Alexander
Global Moderator
Global Moderator
 
Posts: 1531
Joined: March 2007
Location: Netherlands

Device Stats

Postby Alexander » Thu Sep 03, 2009 10:09 pm

How to use:

1) copy the aspx and web.config files to a new directory within the html-directory. (e.g. L2DB)
2) copy the vb file to the homeseer scripts directory
3) copy the mdb file to the homeseer data\L2DB directory (create first)
4) create an event with trigger "device value change" and choose the device you want to log to the database. I have any device any value. Choose as action the L2DB.vb script to run.

Please open the aspx files with an editor. There is a line that starts with "If DeviceCode(i) = "\3" Then". Its an if statement that changes the device_value for the graphic. The device in this file is an RFXPWR device. The RFXPWR device value calculates the total usage and will not reset. Because of this, the graph would show a high value for this device. Within the If statement i calculate the difference in value between the last two values and adds up the last value of the substracted value. You will have to change the device code to the device code you have for the RFXPWR. If you have more of these devices you can duplicate the If statement.

domoticaforum.eu/uploaded/mgizmo/200993 ... 7_L2DB.zip
Alexander
Global Moderator
Global Moderator
 
Posts: 1531
Joined: March 2007
Location: Netherlands

Device Stats

Postby Ruud » Thu Sep 03, 2009 11:49 pm

Dutch forum dus nederlands?

gr Ruud
Ruud
Forum Moderator
Forum Moderator
 
Posts: 782
Joined: January 2008
Location: Rijswijk (Z.H)

Device Stats

Postby Alexander » Fri Sep 04, 2009 9:32 am

er is geen engelse homeseer scripts sectie. Aangezien hier ook niet-nl gebruikers van homeseer rondhangen, leek mij engels beter.

Alexander
Alexander
Global Moderator
Global Moderator
 
Posts: 1531
Joined: March 2007
Location: Netherlands

Device Stats

Postby petermdevries » Sat Sep 05, 2009 12:39 pm

Just installed it but when accessing the powerusage.aspx I get the following error:

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load file or assembly 'netchartdir' or one of its dependencies. The system cannot find the file specified.

Source Error:


Line 4: <%@ Import Namespace="System.Data.OleDb" %>
Line 5:
Line 6: <%@ Register TagPrefix="chart" Namespace="ChartDirector" Assembly="netchartdir" %>
Line 7:
Line 8: <html xmlns="http://www.w3.org/1999/xhtml">


Source File: /L2DB/powerusage.aspx Line: 6

Looks like I need some more?
petermdevries
Member
Member
 
Posts: 83
Joined: November 2008
Location: Netherlands

Device Stats

Postby petermdevries » Sat Sep 05, 2009 2:05 pm

Nevermind... just got it working.

I had to download ChartDirector and put the dll in Homeseer's \html\bin folder. Now it works.
petermdevries
Member
Member
 
Posts: 83
Joined: November 2008
Location: Netherlands

Device Stats

Postby Alexander » Sat Sep 05, 2009 7:48 pm

Yep, the problem here is that you don't use the RFXcharts (many have them installed because of the usage of the RFXCOM equipment). Its good you did find out yourself ;-)

There are a few problems within the script. Will fix them tonight.

Alexander
Alexander
Global Moderator
Global Moderator
 
Posts: 1531
Joined: March 2007
Location: Netherlands

Device Stats

Postby Alexander » Sat Sep 05, 2009 11:59 pm

Update:

- Scripts will use an INI file (hs_stats.ini) (see attachment). Place this file in the config directory.
- There are 4 sections in the INI file that describe the devices types or device codes to not include in the graphs. Example is available in the INI file
- The database location is now configurable in the INI file
- I have myself changed the location of the ASPX/web.config files to /html/HS_STATS
- The database has two extra attributes (device type and location 2). If you can change your own database, that will be the best option, otherwise overwrite the current database with the one in the zip file. The two extra attributes are used to filter the graphs and show this extra information in the labels in the graphs.
- Because of the two extra attributes, the vb script (which must be run with an event) has also changed.
- If you have an RFXMeter, the script (powerusage.aspx) will now display the differences between measurements as stated earlier, but now display this information correctly. Also you don't have to change the device code in the script for this, because the script checks if it is a RFXMeter type.
- Line Width is now two pixels.

domoticaforum.eu/uploaded/mgizmo/200995 ... 0_L2DB.zip

Alexander
Alexander
Global Moderator
Global Moderator
 
Posts: 1531
Joined: March 2007
Location: Netherlands

Re: Device Stats

Postby Darwusch » Thu Aug 09, 2012 4:21 pm

I got the script up and running.
Only I don't seen the negative values (i.e. the solar panels)...
What should I change in the code?
Darwusch
Member
Member
 
Posts: 121
Joined: December 2008
Location: Netherlands


Return to Homeseer Scripts Forum

Who is online

Users browsing this forum: No registered users and 1 guest