Announcement

Collapse
No announcement yet.

BDGraphs: Device value recording and graphing (charts)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • BDGraphs: Device value recording and graphing (charts)

    Here is the discussion thread for BDGraphs, posted here: http://board.homeseer.com/showthread.php?p=1033807

    Please note that HS2 and HS3 versions are available.

    -BD
    Last edited by BrunDog; June 3rd, 2014, 10:37 AM.

  • #2
    Thanks BD! Based on some recent upgrades there are some things I want to graph. I haven't looked at the other choices on the board yet so I will give it a try as a new user.

    I downloaded and read the docs. There's a lot it can do. I travel weekly and don't mess with prod while on the road.
    Paul

    Comment


    • #3
      FYI, I found a bug where a device name that has a hyphen in it will cause some of the functions to fail. I have fixed it and will update the package shortly.

      -BD

      Comment


      • #4
        Added a few simple things to trap in events. Homeseer had to be restarted for it to function properly, got ole db script errors until I did when running events.

        Will work with it more tomorrow
        Paul

        Comment


        • #5
          Hi pbibm,

          Could you be more specific? What error did you get, where (in the log), and using which function?

          I am working on the graph formatting now, but would like to make sure the backend DB stuff works as the priority. Obviously its hard to really debug when I can only write & test on one machine. :-{

          -BD

          Comment


          • #6
            Hey BD, sure, its below. It came up for my first two "add" executions from events. After I restarted HS, that was the end of it.

            I'm not sure why I thought this, but restarting HS seemed the right thing to do given the .net 4 capabilities. As such, this might be a "loose nut behind the keyboard" kind of problem.

            Blue is the call, red is the error, green are other event actions in the event that called the add, not colored are log entries in the middle that were part of the event in which I added the "add" parameter.

            10/6/2012 6:32:02 AM - Event - Running script in background: BDGraphs.vben("Add","B5;1")
            10/6/2012 6:32:02 AM - Error - Script compile error: Type 'OleDb.OleDbConnection' is not defined.on line 25
            10/6/2012 6:32:02 AM - SCR - Option Strict OffImports System.Text.RegularExpressionsImports System.IOImports System.Web.UI.DataVisualization.ChartingImports ADOXImports System.Data.OleDbImports System.DataImports ADODBimports Schedulerimports SystemPublic Module scriptcode3#Region "Automatically generated code, do not modify"'Automatically generated code, do not modify'Event Sources Begin <system.contextstaticattribute()> Public WithEvents hs As Scheduler.hsapplication <system.contextstaticattribute()> Public WithEvents hsp As scheduler.hsp <system.contextstaticattribute()> Public WithEvents hssystem As scheduler.phone0'Event Sources End'End of automatically generated code#End Region Public Sub Add(ByVal Parms As Object) Dim DatabasePath As String Dim tableName As String Dim con As New OleDb.OleDbConnection '("PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" & DatabasePath) Dim cmd As New OleDb.OleDbCommand Dim ds As New DataSet Dim sql As String Dim RowsChanged As Integer Dim DeviceCode As String Dim Multiplier As Single Dim PassedParms() As String Dim Device Dim DeviceValue As Single Try 'Set the database file location DatabasePath = hs.GetAppPath & "\DATA\BDGraphs\BDGraphs.mdb" 'DatabasePath = "\\nas1\public\BDGraphs.mdb" 'Check that the database file is in place If Not File.Exists(DatabasePath) Then hs.WriteLog("BDGraphs", "WARNING: The database file (" & DatabasePath & ") could not be found.") Exit Sub End If 'Create the connection string con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" & DatabasePath 'Parse out the incoming parameters, create the table name from the device name of max 64 chars PassedParms = Split(Parms.ToString, ";") If Not UBound(PassedParms) = 1 Then hs.WriteLog("BDGraphs", "WARNING: The Add function requires 2 parameters: device code;Multiplier.") Exit Sub End If DeviceCode = PassedParms(0) Multiplier = CSng(PassedParms(1)) 'Check that the device code is legit If hs.GetDeviceRef(DeviceCode) = -1 Then hs.WriteLog("BDGraphs", "WARNING: The device code passed, '" & DeviceCode & "' is invalid.") Exit Sub End If Device = hs.GetDeviceByRef(hs.GetDeviceRef(DeviceCode)) tableName = Left(Replace(Device.name, " ", ""), 64) 'con.Open() 'sql = "SELECT * FROM " & tableName 'da = New OleDb.OleDbDataAdapter(sql, con) 'da.Fill(ds, "Data") 'con.Close() 'RowsCount = ds.Tables("Data").Rows.Count 'hs.WriteLog("BDGraphs", "The # of rows is: " & RowsCount) 'Determine if the table exists and if it does not, create it 'Open the database, get the schema, close it con.Open() Dim dbSchema As DataTable = con.GetOleDbSchemaTable(OleDb.OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, tableName, "TABLE"}) con.Close() If dbSchema.Rows.Count = 0 Then sql = "CREATE TABLE [" + tableName + "] ([Date] DATE, [Data] SINGLE)" cmd = New OleDb.OleDbCommand(sql, con) con.Open() cmd.ExecuteNonQuery() hs.WriteLog("BDGraphs", "The new table '" & tableName & "' was created.") con.Close() End If 'Add the device value into the specified table DeviceValue = hs.DeviceValue(DeviceCode) * Multiplier sql = "INSERT INTO " & tableName & " VALUES ('" & Now() & "','" & DeviceValue & "')" con.Open() cmd = New OleDb.OleDbCommand(sql, con) RowsChanged = cmd.ExecuteNonQuery() If RowsChanged = 1 Then hs.WriteLog("BDGraphs", "The value '" & DeviceValue & "' in table '" & tableName & "' was added.") Else hs.WriteLog("BDGraphs", "WARNING: The value '" & DeviceValue & "' in table '" & tableName & "' was not added.") End If con.Close() Catch ex As Exception hs.WriteLog("BDGraphs", "ERROR: The message was: " & ex.Message & ". The source was: " & ex.Source) End Try End Sub Public Sub Delete(ByVal Parms As Object) Dim DatabasePath As String Dim tableName As String Dim con As New OleDb.OleDbConnection '("PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" & DatabasePath) Dim cmd As New OleDb.OleDbCommand Dim sql As String Dim RowsChanged As Integer Dim DeviceCode As String Dim PassedParms() As String Dim HoursStart As Integer Dim Today As Date Dim DateStart As Date Dim Device Try 'Set the database file location DatabasePath = hs.GetAppPath & "\DATA\BDGraphs\BDGraphs.mdb" 'DatabasePath = "\\nas1\public\BDGraphs.mdb" 'Check that the database file is in place If Not File.Exists(DatabasePath) Then hs.WriteLog("BDGraphs", "WARNING: The database file (" & DatabasePath & ") could not be found.") Exit Sub End If 'Create the connection string con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" & DatabasePath Today = Now 'Parse out the incoming parameters: devicecode and date cutoff PassedParms = Split(Parms.ToString, ";") If Not UBound(PassedParms) = 1 Then hs.WriteLog("BDGraphs", "WARNING: The Delete function requires 2 parameters: device code;# hours to delete values before.") Exit Sub End If DeviceCode = PassedParms(0) HoursStart = CInt(PassedParms(1)) 'DateThreshold = PassedParms(1) 'Check that the device code is legit If hs.GetDeviceRef(DeviceCode) = -1 Then hs.WriteLog("BDGraphs", "WARNING: The device code passed, '" & DeviceCode & "' is invalid.") Exit Sub End If Device = hs.GetDeviceByRef(hs.GetDeviceRef(DeviceCode)) tableName = Left(Replace(Device.name, " ", ""), 64) 'Calculate the start and end dates DateStart = Today.AddHours(HoursStart * -1) 'Execute the deletion sql = "DELETE FROM " & tableName & " WHERE (DATE < #" & DateStart & "#)" con.Open() cmd = New OleDb.OleDbCommand(sql, con) RowsChanged = cmd.ExecuteNonQuery() If RowsChanged > 1 Then hs.WriteLog("BDGraphs", RowsChanged & " value(s) before " & DateStart & " in table '" & tableName & "' were deleted.") Else hs.WriteLog("BDGraphs", "No values in table '" & tableName & "' were deleted.") End If con.Close() Catch ex As Exception hs.WriteLog("BDGraphs", "ERROR: The message was: " & ex.Message & ". The source was: " & ex.Source) End Try End Sub Public Sub Make(ByVal Parms As Object) Dim DeviceCode As String Dim PassedParms() As String Dim HoursStart As Integer Dim HoursEnd As Integer Dim UserName As String Dim Password As String Dim ArgsString As String Dim AppString As String Try 'Parse out the incoming parameters: devicecode and date cutoff PassedParms = Split(Parms.ToString, ";") 'Check that all parameters were passed If Not UBound(PassedParms) = 4 Then hs.WriteLog("BDGraphs", "WARNING: The Make function requires 5 parameters: username;password;device code;# hours ago to start;# hours ago to end.") Exit Sub End If AppString = hs.GetAppPath & "\BDGraphs.exe" 'Check that the application is in the HS folder. If Not File.Exists(AppString) Then hs.WriteLog("BDGraphs", "WARNING: The BDGraphs.exe file is not found in the HomeSeer directory.") Exit Sub End If 'Assign the parameters UserName = PassedParms(0) Password = PassedParms(1) DeviceCode = PassedParms(2) HoursStart = CInt(PassedParms(3)) HoursEnd = CInt(PassedParms(4)) 'Check that the device code is legit If hs.GetDeviceRef(DeviceCode) = -1 Then hs.WriteLog("BDGraphs", "WARNING: The device code passed, '" & DeviceCode & "' is invalid.") Exit Sub End If ArgsString = UserName & ";" & Password & ";" & DeviceCode & ";" & HoursStart & ";" & HoursEnd 'Launch that **** hs.Launch(AppString, Parms) Catch ex As Exception hs.WriteLog("BDGraphs", "The error message was: " & ex.Message & ". The error source was: " & ex.Source) End Try End Sub Public Sub Place(ByVal Parms As Object) Dim DeviceCode As String Dim PassedParms() As String Dim GraphCode As String Dim GraphCodeNumber As String Dim htmlstring As String Dim tableName As String Dim dv Dim Device Try 'Parse out the incoming parameters: devicecode and date cutoff PassedParms = Split(Parms.ToString, ";") 'Check that all parameters were passed If Not UBound(PassedParms) = 1 Then hs.WriteLog("BDGraphs", "WARNING: The Place function requires 2 parameters: device code of source data;device code of graph location.") Exit Sub End If 'Assign the parameters DeviceCode = PassedParms(0) GraphCode = PassedParms(1) 'Check that the device code is legit If hs.GetDeviceRef(DeviceCode) = -1 Then hs.WriteLog("BDGraphs", "WARNING: The device code passed, '" & DeviceCode & "' is invalid.") Exit Sub End If 'Check that the device code is possible (weak attempt, as it only checks the right one or two letters to be a number) GraphCodeNumber = Right(GraphCode, Len(GraphCode) - 1) Device = hs.GetDeviceByRef(hs.GetDeviceRef(DeviceCode)) tableName = Left(Replace(Device.name, " ", ""), 64) If Not Regex.IsMatch(GraphCodeNumber, "^[0-9 ]+$") Then hs.WriteLog("BDGraphs", "WARNING: The graph location device code passed, '" & GraphCode & "' is invalid.") Exit Sub End If 'Check to see if the graph code exists, and if not, make it If hs.GetDeviceRef(GraphCode) = -1 Then dv = hs.NewDeviceEx(Device.name & " Graph") With dv .misc = &H10 .dev_type_string = "Status Only" .hc = Left(GraphCode, 1) .dc = GraphCodeNumber .location = Device.location hs.WriteLog("BDGraphs", "The new device '" & Device.name & " Graph' with device code '" & GraphCode & "' was created.") End With End If 'Create the device string and load it into the graph device code htmlstring = "" hs.SetDeviceString(GraphCode, htmlstring, True) hs.WriteLog("BDGraphs", "The graph for '" & Device.name & "' was loaded into device code '" & GraphCode & "'.") Catch ex As Exception hs.WriteLog("BDGraphs", "The error message was: " & ex.Message & ". The error source was: " & ex.Source) End Try End SubEnd Module</system.contextstaticattribute()></system.contextstaticattribute()></system.contextstaticattribute()>

            10/6/2012 6:34:39 AM - Event - Event Trigger "Query Insteon Stat"
            10/6/2012 6:34:55 AM - Event - Event Trigger "Family Room Mode (delayed action)"
            10/6/2012 6:34:55 AM - Device Control - Device: Thermostat Family Room Family Room Mode (^3) Value set to 1
            10/6/2012 6:34:55 AM - Event - Deleting event after run: "Delayed Actions Family Room Mode (delayed action)"
            10/6/2012 6:36:49 AM - X10 Received - B5 ( Basement Front Furnace On / Off) B Off
            10/6/2012 6:36:49 AM - Event - Event Trigger "Kristens Duct Booster Off"
            10/6/2012 6:36:49 AM - Device Control - Device: Kristens Room Duct Booster ($48) OFF

            10/6/2012 6:36:49 AM - Event - Running script in background: BDGraphs.vben("Add","B5;1")
            10/6/2012 6:36:49 AM - Error - Script compile error: Type 'OleDb.OleDbConnection' is not defined.on line 25
            10/6/2012 6:36:49 AM - SCR - Option Strict OffImports System.Text.RegularExpressionsImports System.IOImports System.Web.UI.DataVisualization.ChartingImports ADOXImports System.Data.OleDbImports System.DataImports ADODBimports Schedulerimports SystemPublic Module scriptcode4#Region "Automatically generated code, do not modify"'Automatically generated code, do not modify'Event Sources Begin <system.contextstaticattribute()> Public WithEvents hs As Scheduler.hsapplication <system.contextstaticattribute()> Public WithEvents hsp As scheduler.hsp <system.contextstaticattribute()> Public WithEvents hssystem As scheduler.phone0'Event Sources End'End of automatically generated code#End Region Public Sub Add(ByVal Parms As Object) Dim DatabasePath As String Dim tableName As String Dim con As New OleDb.OleDbConnection '("PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" & DatabasePath) Dim cmd As New OleDb.OleDbCommand Dim ds As New DataSet Dim sql As String Dim RowsChanged As Integer Dim DeviceCode As String Dim Multiplier As Single Dim PassedParms() As String Dim Device Dim DeviceValue As Single Try 'Set the database file location DatabasePath = hs.GetAppPath & "\DATA\BDGraphs\BDGraphs.mdb" 'DatabasePath = "\\nas1\public\BDGraphs.mdb" 'Check that the database file is in place If Not File.Exists(DatabasePath) Then hs.WriteLog("BDGraphs", "WARNING: The database file (" & DatabasePath & ") could not be found.") Exit Sub End If 'Create the connection string con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" & DatabasePath 'Parse out the incoming parameters, create the table name from the device name of max 64 chars PassedParms = Split(Parms.ToString, ";") If Not UBound(PassedParms) = 1 Then hs.WriteLog("BDGraphs", "WARNING: The Add function requires 2 parameters: device code;Multiplier.") Exit Sub End If DeviceCode = PassedParms(0) Multiplier = CSng(PassedParms(1)) 'Check that the device code is legit If hs.GetDeviceRef(DeviceCode) = -1 Then hs.WriteLog("BDGraphs", "WARNING: The device code passed, '" & DeviceCode & "' is invalid.") Exit Sub End If Device = hs.GetDeviceByRef(hs.GetDeviceRef(DeviceCode)) tableName = Left(Replace(Device.name, " ", ""), 64) 'con.Open() 'sql = "SELECT * FROM " & tableName 'da = New OleDb.OleDbDataAdapter(sql, con) 'da.Fill(ds, "Data") 'con.Close() 'RowsCount = ds.Tables("Data").Rows.Count 'hs.WriteLog("BDGraphs", "The # of rows is: " & RowsCount) 'Determine if the table exists and if it does not, create it 'Open the database, get the schema, close it con.Open() Dim dbSchema As DataTable = con.GetOleDbSchemaTable(OleDb.OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, tableName, "TABLE"}) con.Close() If dbSchema.Rows.Count = 0 Then sql = "CREATE TABLE [" + tableName + "] ([Date] DATE, [Data] SINGLE)" cmd = New OleDb.OleDbCommand(sql, con) con.Open() cmd.ExecuteNonQuery() hs.WriteLog("BDGraphs", "The new table '" & tableName & "' was created.") con.Close() End If 'Add the device value into the specified table DeviceValue = hs.DeviceValue(DeviceCode) * Multiplier sql = "INSERT INTO " & tableName & " VALUES ('" & Now() & "','" & DeviceValue & "')" con.Open() cmd = New OleDb.OleDbCommand(sql, con) RowsChanged = cmd.ExecuteNonQuery() If RowsChanged = 1 Then hs.WriteLog("BDGraphs", "The value '" & DeviceValue & "' in table '" & tableName & "' was added.") Else hs.WriteLog("BDGraphs", "WARNING: The value '" & DeviceValue & "' in table '" & tableName & "' was not added.") End If con.Close() Catch ex As Exception hs.WriteLog("BDGraphs", "ERROR: The message was: " & ex.Message & ". The source was: " & ex.Source) End Try End Sub Public Sub Delete(ByVal Parms As Object) Dim DatabasePath As String Dim tableName As String Dim con As New OleDb.OleDbConnection '("PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" & DatabasePath) Dim cmd As New OleDb.OleDbCommand Dim sql As String Dim RowsChanged As Integer Dim DeviceCode As String Dim PassedParms() As String Dim HoursStart As Integer Dim Today As Date Dim DateStart As Date Dim Device Try 'Set the database file location DatabasePath = hs.GetAppPath & "\DATA\BDGraphs\BDGraphs.mdb" 'DatabasePath = "\\nas1\public\BDGraphs.mdb" 'Check that the database file is in place If Not File.Exists(DatabasePath) Then hs.WriteLog("BDGraphs", "WARNING: The database file (" & DatabasePath & ") could not be found.") Exit Sub End If 'Create the connection string con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" & DatabasePath Today = Now 'Parse out the incoming parameters: devicecode and date cutoff PassedParms = Split(Parms.ToString, ";") If Not UBound(PassedParms) = 1 Then hs.WriteLog("BDGraphs", "WARNING: The Delete function requires 2 parameters: device code;# hours to delete values before.") Exit Sub End If DeviceCode = PassedParms(0) HoursStart = CInt(PassedParms(1)) 'DateThreshold = PassedParms(1) 'Check that the device code is legit If hs.GetDeviceRef(DeviceCode) = -1 Then hs.WriteLog("BDGraphs", "WARNING: The device code passed, '" & DeviceCode & "' is invalid.") Exit Sub End If Device = hs.GetDeviceByRef(hs.GetDeviceRef(DeviceCode)) tableName = Left(Replace(Device.name, " ", ""), 64) 'Calculate the start and end dates DateStart = Today.AddHours(HoursStart * -1) 'Execute the deletion sql = "DELETE FROM " & tableName & " WHERE (DATE < #" & DateStart & "#)" con.Open() cmd = New OleDb.OleDbCommand(sql, con) RowsChanged = cmd.ExecuteNonQuery() If RowsChanged > 1 Then hs.WriteLog("BDGraphs", RowsChanged & " value(s) before " & DateStart & " in table '" & tableName & "' were deleted.") Else hs.WriteLog("BDGraphs", "No values in table '" & tableName & "' were deleted.") End If con.Close() Catch ex As Exception hs.WriteLog("BDGraphs", "ERROR: The message was: " & ex.Message & ". The source was: " & ex.Source) End Try End Sub Public Sub Make(ByVal Parms As Object) Dim DeviceCode As String Dim PassedParms() As String Dim HoursStart As Integer Dim HoursEnd As Integer Dim UserName As String Dim Password As String Dim ArgsString As String Dim AppString As String Try 'Parse out the incoming parameters: devicecode and date cutoff PassedParms = Split(Parms.ToString, ";") 'Check that all parameters were passed If Not UBound(PassedParms) = 4 Then hs.WriteLog("BDGraphs", "WARNING: The Make function requires 5 parameters: username;password;device code;# hours ago to start;# hours ago to end.") Exit Sub End If AppString = hs.GetAppPath & "\BDGraphs.exe" 'Check that the application is in the HS folder. If Not File.Exists(AppString) Then hs.WriteLog("BDGraphs", "WARNING: The BDGraphs.exe file is not found in the HomeSeer directory.") Exit Sub End If 'Assign the parameters UserName = PassedParms(0) Password = PassedParms(1) DeviceCode = PassedParms(2) HoursStart = CInt(PassedParms(3)) HoursEnd = CInt(PassedParms(4)) 'Check that the device code is legit If hs.GetDeviceRef(DeviceCode) = -1 Then hs.WriteLog("BDGraphs", "WARNING: The device code passed, '" & DeviceCode & "' is invalid.") Exit Sub End If ArgsString = UserName & ";" & Password & ";" & DeviceCode & ";" & HoursStart & ";" & HoursEnd 'Launch that **** hs.Launch(AppString, Parms) Catch ex As Exception hs.WriteLog("BDGraphs", "The error message was: " & ex.Message & ". The error source was: " & ex.Source) End Try End Sub Public Sub Place(ByVal Parms As Object) Dim DeviceCode As String Dim PassedParms() As String Dim GraphCode As String Dim GraphCodeNumber As String Dim htmlstring As String Dim tableName As String Dim dv Dim Device Try 'Parse out the incoming parameters: devicecode and date cutoff PassedParms = Split(Parms.ToString, ";") 'Check that all parameters were passed If Not UBound(PassedParms) = 1 Then hs.WriteLog("BDGraphs", "WARNING: The Place function requires 2 parameters: device code of source data;device code of graph location.") Exit Sub End If 'Assign the parameters DeviceCode = PassedParms(0) GraphCode = PassedParms(1) 'Check that the device code is legit If hs.GetDeviceRef(DeviceCode) = -1 Then hs.WriteLog("BDGraphs", "WARNING: The device code passed, '" & DeviceCode & "' is invalid.") Exit Sub End If 'Check that the device code is possible (weak attempt, as it only checks the right one or two letters to be a number) GraphCodeNumber = Right(GraphCode, Len(GraphCode) - 1) Device = hs.GetDeviceByRef(hs.GetDeviceRef(DeviceCode)) tableName = Left(Replace(Device.name, " ", ""), 64) If Not Regex.IsMatch(GraphCodeNumber, "^[0-9 ]+$") Then hs.WriteLog("BDGraphs", "WARNING: The graph location device code passed, '" & GraphCode & "' is invalid.") Exit Sub End If 'Check to see if the graph code exists, and if not, make it If hs.GetDeviceRef(GraphCode) = -1 Then dv = hs.NewDeviceEx(Device.name & " Graph") With dv .misc = &H10 .dev_type_string = "Status Only" .hc = Left(GraphCode, 1) .dc = GraphCodeNumber .location = Device.location hs.WriteLog("BDGraphs", "The new device '" & Device.name & " Graph' with device code '" & GraphCode & "' was created.") End With End If 'Create the device string and load it into the graph device code htmlstring = "" hs.SetDeviceString(GraphCode, htmlstring, True) hs.WriteLog("BDGraphs", "The graph for '" & Device.name & "' was loaded into device code '" & GraphCode & "'.") Catch ex As Exception hs.WriteLog("BDGraphs", "The error message was: " & ex.Message & ". The error source was: " & ex.Source) End Try End SubEnd Module
            </system.contextstaticattribute()></system.contextstaticattribute()></system.contextstaticattribute()>
            Paul

            Comment


            • #7
              OK, so is it now working?

              This kind of makes sense as you noted. If that is the case, I will update the directions.

              Don't go too crazy yet setting up too many devices... I am updating the Make function to move the login credentials out of there and into the .exe. This way these admin credentials are not visible to Normal users.

              -BD

              Comment


              • #8
                Sounds good and the plan was to start small and see what happens.

                I really wanted to track humidity on my new 2441TH Stat but just replaced it as the first one was "possessed". As I am writing this and watching it, this one seems to have the same problem so I will leave BDGraphs as is.

                I can't seem to look at the mdb which would let me see what's going in it. I move a copy in another location on my server and access says "this file is not from your intranet or untrusted location....". I moved it to a desktop with office 2010. It opens, but can't find tables etc. This is not a big deal, it would help me validate HS Adds vs whats in the db
                Paul

                Comment


                • #9
                  Kooky! I can open the .mdb fine with Access 2007 but it does give me a warning about formatting or something. You can try making your own, blank BDGraphs.mdb and put it in place. Then run the "Add" function. It should create the table in the .mdb. You can then try to look in it again.

                  Likewise, if you would like to post your MDB here, I can try to open it for you.

                  -BD

                  Comment


                  • #10
                    I updated the package to version 1.0.5. The major change beyond code optimizations is the Addition of an .ini file, which contains login credentials and graph styles.

                    NOTE: The "Make" function has changed... you no longer put the login credentials there, they must be in the .ini file. In addition, you must declare a graph style to use. See the updated instructions in the PDF.

                    -BD

                    Comment


                    • #11
                      Sample BDGraphs images

                      Here's a look at some of the graphs you can create using the added graph styles. These are all the same data source, but different chart types, colors, etc. There are many, many customizations that can be coded in, and I will do a bunch more, but then will let requests drive the more detailed ones.

                      Click image for larger version

Name:	TempMeterTemperature.png
Views:	1
Size:	17.8 KB
ID:	1167198 Click image for larger version

Name:	TempMeterTemperature2.png
Views:	1
Size:	13.5 KB
ID:	1167199 Click image for larger version

Name:	TempMeterTemperature3.png
Views:	1
Size:	39.0 KB
ID:	1167200
                      Click image for larger version

Name:	TempMeterTemperature4.png
Views:	1
Size:	19.5 KB
ID:	1167201 Click image for larger version

Name:	TempMeterTemperature5.png
Views:	1
Size:	13.1 KB
ID:	1167202 Click image for larger version

Name:	TempMeterTemperature6.png
Views:	1
Size:	12.6 KB
ID:	1167203

                      -BD

                      Comment


                      • #12
                        Hi Brundog,
                        It looks great, looking forward to install it. In the future releases, could you please add the ability to show two set of values in one graph. i.e. I would love to see the outside temperature against the the inside temperature.
                        I image I will not have any issues seeing them in HSTouch devices, correct?

                        Thanks for the great plugin,
                        Aldo

                        Comment


                        • #13
                          Yes, the ability to store and graph multiple values is in the pipeline. I would like to get more of the graph styles added (including 3D, which is a bunch of work on its own), then I will address this.

                          The images are .png format and are stored in /HTML/images/BDGraphs, so you should have no issue using in HSTouch.

                          -BD

                          Comment


                          • #14
                            Error: Script compile error in encrypted script

                            Hi BD,

                            The package looks great. I downloaded the latest version last night to try it out and configured it today. When trying my first add command, I got the following error message:

                            Code:
                            10/10/2012 9:10:57 PM  Event  Event Trigger "Update Voltage Level" 
                            10/10/2012 9:10:57 PM  Event  Running script in background: BDGraphs.vben("Add","U4;1") 
                            10/10/2012 9:11:00 PM  Error  Script compile error in encrypted script
                            Any ideas?

                            Thanks
                            Al
                            HS 3.0.0.548: 1970 Devices 1149 Events
                            Z-Wave 3.0.1.262: 123 Nodes on one Z-Net

                            Comment


                            • #15
                              Jeez, I dunno! I just ran it and did not have any issues, but that of course is on my machine where I developed it! I don't have another way to test it, my apologies.

                              1. What version of HS do you have?
                              2. Did you install .NET 4.0? You don't have to for the "Add" part to work.
                              3. Try restarting HS. As you can see above, pbim also got a script compile error and restarting HS fixed his issue. I am not sure why his error stated where the problem occured.
                              4. (dumb question but I gotta ask)... did you copy the BDGraphs.mdb file to the specified folder, which is your homeseer folder\Data\BDGraphs\? I do not believe this to be the issue because the script checks for the .mdb file and gives you an error (in english).

                              ** UPDATE: See next thread - I think I know whasup.

                              -BD
                              Last edited by BrunDog; October 10th, 2012, 11:16 PM.

                              Comment

                              Working...
                              X