Device Stats

Forum over Homeseer scripts (DUTCH forum)

Moderators: TANE, Ruud

Post Reply
Alexander
Global Moderator
Global Moderator
Posts: 1532
Joined: Sat Mar 10, 2007 11:19 pm
Location: Netherlands

Device Stats

Post by Alexander »

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
Bastiaan
Senior Member
Senior Member
Posts: 1257
Joined: Sat May 24, 2008 11:36 am
Location: Netherlands
Contact:

Device Stats

Post by Bastiaan »

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

Bastiaan
Alexander
Global Moderator
Global Moderator
Posts: 1532
Joined: Sat Mar 10, 2007 11:19 pm
Location: Netherlands

Device Stats

Post by Alexander »

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

Alexander
Alexander
Global Moderator
Global Moderator
Posts: 1532
Joined: Sat Mar 10, 2007 11:19 pm
Location: Netherlands

Device Stats

Post by Alexander »

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
Ruud
Forum Moderator
Forum Moderator
Posts: 847
Joined: Wed Jan 02, 2008 12:25 pm
Location: Rijswijk (Z.H)

Device Stats

Post by Ruud »

Dutch forum dus nederlands?

gr Ruud
Alexander
Global Moderator
Global Moderator
Posts: 1532
Joined: Sat Mar 10, 2007 11:19 pm
Location: Netherlands

Device Stats

Post by Alexander »

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

Alexander
petermdevries
Member
Member
Posts: 98
Joined: Thu Nov 27, 2008 10:43 am
Location: Netherlands

Device Stats

Post by petermdevries »

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: 98
Joined: Thu Nov 27, 2008 10:43 am
Location: Netherlands

Device Stats

Post by petermdevries »

Nevermind... just got it working.

I had to download ChartDirector and put the dll in Homeseer's \html\bin folder. Now it works.
Alexander
Global Moderator
Global Moderator
Posts: 1532
Joined: Sat Mar 10, 2007 11:19 pm
Location: Netherlands

Device Stats

Post by Alexander »

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: 1532
Joined: Sat Mar 10, 2007 11:19 pm
Location: Netherlands

Device Stats

Post by Alexander »

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
Darwusch
Member
Member
Posts: 164
Joined: Sun Dec 21, 2008 10:25 pm
Location: Netherlands

Re: Device Stats

Post by Darwusch »

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?
Post Reply

Return to “Homeseer Scripts Forum”