
Announcement
Collapse
No announcement yet.
Print a Device Inventory Report?
Collapse
X
-
Originally posted by JimSpy View PostSuccess! Thanks.
Now, an enhancement request...is there a way to include the Insteon address triplet as a field?
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:
-
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:
-
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:
-
Originally posted by JimSpy View PostInterestingly, there is no app_path in the settings.ini file.
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:
-
Interestingly, there is no app_path in the settings.ini file. Is this something I need to stick in myself?
Leave a comment:
-
Originally posted by JimSpy View PostDo 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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
Leave a comment: