Device Stats
Device Stats
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):
Alexander
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):
Alexander
Device Stats
For sure, I would love to see how my Roof is moving up and down through the day [:D]
Bastiaan
Bastiaan
Device Stats
Will post it tonight. Have some hard coded things to change.
Alexander
Alexander
Device Stats
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
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
Device Stats
Dutch forum dus nederlands?
gr Ruud
gr Ruud
Device Stats
er is geen engelse homeseer scripts sectie. Aangezien hier ook niet-nl gebruikers van homeseer rondhangen, leek mij engels beter.
Alexander
Alexander
-
- Member
- Posts: 98
- Joined: Thu Nov 27, 2008 10:43 am
- Location: Netherlands
Device Stats
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?
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?
-
- Member
- Posts: 98
- Joined: Thu Nov 27, 2008 10:43 am
- Location: Netherlands
Device Stats
Nevermind... just got it working.
I had to download ChartDirector and put the dll in Homeseer's \html\bin folder. Now it works.
I had to download ChartDirector and put the dll in Homeseer's \html\bin folder. Now it works.
Device Stats
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
There are a few problems within the script. Will fix them tonight.
Alexander
Device Stats
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
- 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
Re: Device Stats
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?
Only I don't seen the negative values (i.e. the solar panels)...
What should I change in the code?