Announcement

Collapse
No announcement yet.

Print a Device Inventory Report?

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

  • JimSpy
    replied
    That works. Thanks. Happy Holidays!

    Leave a comment:


  • Uncle Michael
    replied
    Originally posted by JimSpy View Post
    Success! Thanks.

    Now, an enhancement request...is there a way to include the Insteon address triplet as a field?
    Glad it's working.
    I also noticed the address field was missing. (In HS2 it was the first field. I replaced it with Ref#, but forgot to add it back as its own field.)

    See if this version does what you want:
    Code:
    Sub Main(ByVal Params As Object)
    
            Dim strFileName As String
            Dim objEnum As Scheduler.Classes.clsDeviceEnumeration
            Dim objDevice As Scheduler.Classes.DeviceClass
            Dim strDevName As String
            Dim strApPath As String
            Dim strDevString As String
            Dim strListItem As String
            Dim intDevRef As Integer
            Dim dblDevValue As Double
    
    
            ' Find the current path and define a file name
            strApPath = hs.GetAppPath() & "\Data\"
            strFileName = strApPath & "DeviceProp.csv"
    
            ' Create an output ASCII text file.  If it already exists, overwrite current contents.
            Dim FS As New System.IO.FileStream(strFileName, System.IO.FileMode.Create, System.IO.FileAccess.Write)
    
            Dim sWriter As New System.IO.StreamWriter(FS)
    
            ' Time stamp the file
            sWriter.WriteLine("HomeSeer Devices - " & Now)
    
            ' Create a header row
            sWriter.WriteLine("Ref #" & "," & "Location1" & "," & "Location2" & "," & "Name" & "," & "Address" & "," & "Value" & "," & "String")
    
            ' Get a list of all HS devices
            objEnum = hs.GetDeviceEnumerator
    
            ' Retrieve data for each HS device and write it to the file
            Do While Not objEnum.Finished
    
                objDevice = objEnum.GetNext
    
            If objDevice Is Nothing Then Continue Do
    
                'strDevName = ObjDevice.Name(hs)
            intDevRef = ObjDevice.Ref(hs)
                dblDevValue = hs.DeviceValueEx(intDevRef)
                strDevString = hs.DeviceString(intDevRef)
    
                strListItem = CStr(intDevRef) & "," & objDevice.Location(hs) & "," & objDevice.Location2(hs) & "," & objDevice.Name(hs) & "," & objDevice.Address(hs) & "," & CStr(dblDevValue) & "," & strDevString
    
                sWriter.WriteLine(strListItem)
    
            Loop
    
            ' Close the file
            sWriter.Close()
    
        objDevice = Nothing
        objEnum = Nothing
    
        End Sub

    Leave a comment:


  • JimSpy
    replied
    Success! Thanks.

    Now, an enhancement request...is there a way to include the Insteon address triplet as a field? My real purpose here is that I always seem to get stuck re-discovering and re-entering all 140 or so devices, no matter how many ways I've backed up the system. I just want it as a last resort.

    Leave a comment:


  • Uncle Michael
    replied
    The file should have a .vb extension, not .txt.

    Leave a comment:


  • JimSpy
    replied
    OK, I get a strange error in the log:

    Running script, script run or compile error in file: C:/Program Files (x86)/HomeSeer HS3/scripts/DeviceList.txt1006:Expected ')' in line 1 More info: Expected ')'

    Do I have to pass any parameters to the script?

    Leave a comment:


  • JimSpy
    replied
    Originally posted by Uncle Michael View Post
    In that case you could try looking for the csv file in the C:\ (root) directory.
    Well, sonofagun, guess what?

    It's not there either.

    But I'll go ahead and make that change to the .ini and let you know what happens. Thanks!

    Leave a comment:


  • Uncle Michael
    replied
    Originally posted by JimSpy View Post
    Interestingly, there is no app_path in the settings.ini file.
    In that case you could try looking for the csv file in the C:\ (root) directory.

    I think I had to add the app_path entry to my ini file too, but it's been a while so I may be mistaken. Here are the first few lines of my current Settings.ini file:

    [Settings]
    app_path=C:\Program Files\HomeSeer HS3
    gLastShutdownOK=False
    gFirstTimeRun=False
    gConfigFilename=HomeSeerData.hsd
    ScriptingReferences=System.Drawing;System.Drawing.dll,System .XML;System.XML.Dll,System.Data;System.Data.Dll,System.Web;S ystem.Web.Dll

    Leave a comment:


  • JimSpy
    replied
    Interestingly, there is no app_path in the settings.ini file. Is this something I need to stick in myself?

    Leave a comment:


  • Uncle Michael
    replied
    Originally posted by JimSpy View Post
    Do I read this correctly that it's going into the \HS3\data\ folder? And it's a .csv? Don't see it.
    Hmm. The first thing I'd check is the log. Are there any error messages? In Settings.ini in the Config folder, what does it list for 'app_path'? The program assumes that the path to the HS3 folder is correctly reported by the GetAppPath function. In my HS3 directory it appears just before the backup copies of the database.
    Attached Files

    Leave a comment:


  • JimSpy
    replied
    Currently trying this script, but no output. Do I read this correctly that it's going into the \HS3\data\ folder? And it's a .csv? Don't see it.

    Leave a comment:


  • Uncle Michael
    replied
    I've translated my script for use with HS3. It saves a file named 'DeviceProp.csv' in the HS3 'Data' folder.

    Caveat: I am an amateur programmer, and create scripts for my own use. I'm happy to share them, but if you want to try it, please proceed with caution. Save the file with a 'vb' extension.
    Code:
    Sub Main(ByVal Params As Object)
    
            Dim strFileName As String
            Dim objEnum As Scheduler.Classes.clsDeviceEnumeration
            Dim objDevice As Scheduler.Classes.DeviceClass
            Dim strDevName As String
            Dim strApPath As String
            Dim strDevString As String
            Dim strListItem As String
            Dim intDevRef As Integer
            Dim dblDevValue As Double
    
    
            ' Find the current path and define a file name
            strApPath = hs.GetAppPath() & "\Data\"
            strFileName = strApPath & "DeviceProp.csv"
    
            ' Create an output ASCII text file.  If it already exists, overwrite current contents.
            Dim FS As New System.IO.FileStream(strFileName, System.IO.FileMode.Create, System.IO.FileAccess.Write)
    
            Dim sWriter As New System.IO.StreamWriter(FS)
    
            ' Time stamp the file
            sWriter.WriteLine("HomeSeer Devices - " & Now)
    
            ' Create a header row
            sWriter.WriteLine("Ref #" & "," & "Location1" & "," & "Location2" & "," & "Name" & "," & "Value" & "," & "String")
    
            ' Get a list of all HS devices
            objEnum = hs.GetDeviceEnumerator
    
            ' Retrieve data for each HS device and write it to the file
            Do While Not objEnum.Finished
    
                objDevice = objEnum.GetNext
    
                If objDevice Is Nothing Then Continue Do
    
                strDevName = ObjDevice.Name(hs)
                intDevRef = ObjDevice.Ref(hs)
                dblDevValue = hs.DeviceValueEx(intDevRef)
                strDevString = hs.DeviceString(intDevRef)
    
                strListItem = CStr(intDevRef) & "," & objDevice.Location(hs) & "," & objDevice.Location2(hs) & "," & objDevice.Name(hs) & "," & CStr(dblDevValue) & "," & strDevString
    
                sWriter.WriteLine(strListItem)
    
            Loop
    
            ' Close the file
            sWriter.Close()
    
        objDevice = Nothing
        objEnum = Nothing
    
        End Sub

    Leave a comment:


  • jon00
    replied
    I have a number of ASPX web pages working fine under Linux Ubuntu so that is not a true statement. Rich did state that it was not supported on the Zee due to the slow processing times....

    Leave a comment:


  • beerygaz
    replied
    It seems no ASPX support will be forthcoming due to it being a MONO issue. One of my plugins uses ASPX too (Blue Iris) and I switched to JSON. IT would seem all of your wonderful plugins that depend on ASPX as the interface will be limited to the Windows platform. Pity.

    http://bugzilla.homeseer.com/bugzill...ug.cgi?id=2053

    Leave a comment:


  • beerygaz
    replied
    Come to think of it, I'm not sure I've seen even the most basic of ASPX pages work under the Linux version. This could be a mono issue not a Jon00 issue :-)
    [Heads off to do some testing]

    Leave a comment:


  • beerygaz
    replied
    Jon00, not so much under Linux:

    System.Web.Compilation.CompilationException
    VBNC30451: Could not resolve the name 'Type'
    Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
    Details: VBNC30451: Could not resolve the name 'Type'
    Error origin: Compiler
    Error source file: ~/Global.asax
    Exception stack trace:
    at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x00000] in <filename unknown>:0
    at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000] in <filename unknown>:0
    at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, Boolean debug) [0x00000] in <filename unknown>:0
    at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, Boolean debug) [0x00000] in <filename unknown>:0

    Leave a comment:

Working...
X