www.homeseer.com    
 

Go Back   HomeSeer Message Board > HomeSeer Products & Services > HomeSeer Software > HS3 / HS3PRO > HS3 / HS3PRO Discussion

HS3 / HS3PRO Discussion Discussions related to the released version of HS3/HS3PRO

Reply
 
Thread Tools Display Modes
  #21  
Old March 29th, 2018, 09:29 PM
morgan.rinehart morgan.rinehart is offline
Seer
 
Join Date: Mar 2018
Location: Indiana
Posts: 6
Thanks now I am 100% up and running. This has put big smile on my face to finally have this data workable format. Homeseer is great but lacks the piece I have been looking for on the data collection. Now I have nice graphs and starting tonight running analytics on my data. Thanks again Reidfo made my day!
Reply With Quote
  #22  
Old March 29th, 2018, 09:32 PM
reidfo's Avatar
reidfo reidfo is offline
Seer Master
 
Join Date: May 2006
Location: Near Galveston, TX
Posts: 1,342
GREAT! I'm glad you are up and running. I'm a bit of a data geek and have wanted logging, charting, and analytics for a long time. Was happy to find the original post that got me started. I'm happy that the script by default logs all devices since sometimes I want to look at trends I hadn't thought of monitoring before. Like I said, I'm a data geek.
__________________
HS Pro 3.0 | Linux Ubuntu 16.04 x64 virtualized under Proxmox (KVM)
Hardware: Z-NET - W800 Serial - Digi PortServer TS/8 and TS/16 serial to Ethernet - Insteon PLM - RFXCOM - X10 Wireless
Plugins: HSTouch iOS and Android, RFXCOM, BlueIris, BLLock, BLDSC, BLRF, Insteon PLM (MNSandler), Device History, Ecobee, BLRing, Kodi, UltraWeatherWU3
Second home: Zee S2 with Z-Wave, CT101 Z-Wave Thermostat, Aeotec Z-Wave microswitches, HSM200 occupancy sensor, Ecolink Z-Wave door sensors, STI Driveway Monitor interfaced to Zee S2 GPIO pins.
Reply With Quote
  #23  
Old April 5th, 2018, 10:35 AM
rmohsen rmohsen is offline
Seer
 
Join Date: May 2016
Location: Egypt
Posts: 62
thank you so much for this , always wanted to use Grafana with Homeseer

I have trouble setting it up though , database and script done , i have zero experience with this so i don't know how to check what's wrong , database is showing in grafana so it means i did it right , but i'm not sure how to import the data or build the graph , doesn't pull anything

is there anyway you have a step by step guide ?
Reply With Quote
  #24  
Old April 15th, 2018, 03:50 AM
torhaala torhaala is offline
Viewer
 
Join Date: Apr 2018
Location: Norway
Posts: 1
Hi,

First of all, thanks for this! After trying a host of different workarounds this solution seems to be perfect for the logging i would like to do.

Had issues running the version that needed to specify the devices to include, switching to the normal one where you only specify to exclude works fine. Initially had some issues with errors being returned on certain devices, however this turned out to be where there were a comma in the device name in HomeSeer. After replacing this for another character this script now posts all devices correctly.

Last edited by torhaala; April 15th, 2018 at 02:30 PM. Reason: Solved
Reply With Quote
  #25  
Old April 23rd, 2018, 08:05 AM
gjelsvik gjelsvik is offline
Seer
 
Join Date: Apr 2010
Location: Norway
Posts: 73
A total noob on influx/grafana, but the charts looks so good, so I will give it a try.


Can this be done with the default influxdb.conf ? Or is there some "must-do" changes to the config?

Is "Telegraf" a must? I cant see what purpouse it does. Its the .vb script that is pushing the data right?
Reply With Quote
  #26  
Old April 23rd, 2018, 09:16 AM
gjelsvik gjelsvik is offline
Seer
 
Join Date: Apr 2010
Location: Norway
Posts: 73
I have influxdb and grafana running now.

Trying to get the vb.script to post data.

It fails with 2 (3 at first) errors.

First there was an error of an unused declared variable 'problem' So i just removed the declaration.

The next two errors are these:

Quote:

Apr-23 15:12:34 Error Compiling script L2DB-influxdb.vb: Expected declaration
Apr-23 15:12:34 Error Compiling script L2DB-influxdb.vb: The namespace or type specified in System.Core does not contain any common member or does not exist. Verify that the name range or type is defined and contains at least one common member. Make sure that the imported item name does not use any aliases
EDIT:

The above errors are only there on the "iverse" version of the script (with an allow_list in stead of an skip_list)
So I tried the normal version now, but now it gives this error:

Quote:
Error: System.IO.FileNotFoundException: Finner ikke filen C:\Program Files (x86)\HomeSeer HS3\System.Net.ConnectStream.
The same as the user morgan.rhinehart also reported in post #18
Reply With Quote
  #27  
Old April 23rd, 2018, 10:27 PM
Rob2791's Avatar
Rob2791 Rob2791 is offline
Seer
 
Join Date: Dec 2009
Location: NY
Posts: 38
This script will be a great addition to my Grafana!
Does this script need to be passed anything? I tried just creating a manual event to run the script but it seems to throws an error that doesn't give a lot to go on.

Apr-23 10:23:03 PM Error 1 Running script C:\Program Files (x86)\HomeSeer HS3\scripts\L2DB-influxdb.vb :Exception has been thrown by the target of an invocation.Index was outside the bounds of the array.
Apr-23 10:23:03 PM L2DB-InfluxDB Script running
Apr-23 10:23:02 PM Event Running script and waiting: C:/Program Files (x86)/HomeSeer HS3/scripts/L2DB-influxdb.vb
Apr-23 10:23:02 PM Event Event Trigger "Monitoring Script1"
Reply With Quote
  #28  
Old April 24th, 2018, 04:15 AM
gjelsvik gjelsvik is offline
Seer
 
Join Date: Apr 2010
Location: Norway
Posts: 73
Quote:
Originally Posted by Rob2791 View Post
This script will be a great addition to my Grafana!
Does this script need to be passed anything? I tried just creating a manual event to run the script but it seems to throws an error that doesn't give a lot to go on.

Apr-23 10:23:03 PM Error 1 Running script C:\Program Files (x86)\HomeSeer HS3\scripts\L2DB-influxdb.vb :Exception has been thrown by the target of an invocation.Index was outside the bounds of the array.
Apr-23 10:23:03 PM L2DB-InfluxDB Script running
Apr-23 10:23:02 PM Event Running script and waiting: C:/Program Files (x86)/HomeSeer HS3/scripts/L2DB-influxdb.vb
Apr-23 10:23:02 PM Event Event Trigger "Monitoring Script1"
When you run it via the startupscript, it uses the hs.RegisterStatusChangeCB.
Its an callback that adds these 4 params:

parm(0) = house code of the device that changed status
parm(1) = device code of the device that changed status
parm(2) = the X10 status that the device changed to.
parm(3) = the device reference number. Can be used with GetDevice to find the DeviceClass of the specific device.

Untested, but it should work if you add those params manually when calling it.
Reply With Quote
  #29  
Old April 24th, 2018, 09:39 PM
Rob2791's Avatar
Rob2791 Rob2791 is offline
Seer
 
Join Date: Dec 2009
Location: NY
Posts: 38
Quote:
Originally Posted by gjelsvik View Post
When you run it via the startupscript, it uses the hs.RegisterStatusChangeCB.
Its an callback that adds these 4 params:

parm(0) = house code of the device that changed status
parm(1) = device code of the device that changed status
parm(2) = the X10 status that the device changed to.
parm(3) = the device reference number. Can be used with GetDevice to find the DeviceClass of the specific device.

Untested, but it should work if you add those params manually when calling it.
I'm sorry, i didn't understand that "hs.RegisterStatusChangeCB" would run this script every time a device changed by just having that in the startup script. I missed that part when I looked everything over, and it was late at night and nothing was changing status in the house so i never found it being called in the logs until today, to my surprise i looked at the logs and found all the "L2DB-InfluxDB" log entries.

So now I'm getting a "real" error in the logs every time a device changes state, but everything seems to be logging. I got some graphs up and working. I've commented out the hs.writelog line (see below), is this something I should worry about?


Dim httpResponse = DirectCast(HttpWebRequest.GetResponse(), HttpWebResponse)
Using streamReader = New StreamReader(httpResponse.GetResponseStream().ToString)
Dim responseText = StreamReader.ReadToEnd()
hs.WriteLog("L2DB-InfluxDB", "Response: " & responseText)
End Using
Catch ex As Exception
'hs.WriteLog("L2DB-InfluxDB", "Error: " & ex.ToString())
hs.WriteLog("L2DB-InfluxDB", "Request was: " & postdata)
End Try


Here is the error:
Error: System.IO.FileNotFoundException: Could not find file 'C:\Program Files (x86)\HomeSeer HS3\System.Net.ConnectStream'. File name: 'C:\Program Files (x86)\HomeSeer HS3\System.Net.ConnectStream' at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost) at System.IO.StreamReader..ctor(String path) at scriptcode13.VBWrapper.Main(Object Parms)
Reply With Quote
  #30  
Old April 26th, 2018, 04:31 PM
gjelsvik gjelsvik is offline
Seer
 
Join Date: Apr 2010
Location: Norway
Posts: 73
Quote:
Originally Posted by Rob2791 View Post
So now I'm getting a "real" error in the logs every time a device changes state, but everything seems to be logging. I got some graphs up and working. I've commented out the hs.writelog line (see below), is this something I should worry about?
I had that error aswell. My google-fu told me that the line:

Quote:
Using streamReader = New StreamReader(httpResponse.GetResponseStream().ToString)
Is trying to cast a byte stream over to a string. (Or something like that)
I never figured it out. I also had a lot of trouble with the influxDB, so I found a other script that uses MySQL.

I have also changed the way the script is called, as the RegisterStatusChangeDB is not triggered when a device value is set to the same value that it was. (I want continous graphs, even though the value doesnt change all the time) So i am calling the scrip every 5 minutes.
Added a list of devicerefs that i want to log, and loop through them, putting the values into mysql.
Reply With Quote
  #31  
Old May 2nd, 2018, 04:04 PM
actibus actibus is offline
Seer
 
Join Date: May 2013
Location: Norway
Posts: 27
I get this error for every device, it worked for 1 device, the first time, then this:
Any idea?

Error: System.Net.WebException: The operation has timed out at Microsoft.VisualBasic.CompilerServices.Symbols.Container.Inv okeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.Object LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGe t(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at scriptcode9.VBWrapper.Main(Object Parms)
Reply With Quote
  #32  
Old May 8th, 2018, 07:47 PM
Rob2791's Avatar
Rob2791 Rob2791 is offline
Seer
 
Join Date: Dec 2009
Location: NY
Posts: 38
Quote:
Originally Posted by actibus View Post
I get this error for every device, it worked for 1 device, the first time, then this:
Any idea?

Error: System.Net.WebException: The operation has timed out at Microsoft.VisualBasic.CompilerServices.Symbols.Container.Inv okeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.Object LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGe t(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at scriptcode9.VBWrapper.Main(Object Parms)
I'm getting the same thing, it timing out after 2 mintues. It works like once every 100 tries. I can't find any rhyme or reason. All of a sudden it seems to start working for a couple hours then quit again. If it works i get one error in the log, if it fails i get two error lines in the log.
Reply With Quote
  #33  
Old May 11th, 2018, 12:35 PM
lveatch lveatch is offline
Seer Deluxe
 
Join Date: Dec 2012
Location: USA - Illinois
Posts: 177
Quote:

Error: System.Net.WebException: The operation has timed out at Microsoft.VisualBasic.CompilerServices.Symbols.Container.Inv okeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.Object LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGe t(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at scriptcode9.VBWrapper.Main(Object Parms)
I don't use influx for homeseer, rather graylog, but I do use influx/telegraf/chronograf for my home infrastructure monitoring.

My thought is to remove the code from the script to call influxdb server. Instead, write the device information to a log file and let telegraf's tail or logparser plugins handle the communication to the influxdb.


I'm assuming you can write influx's line protocol to the log file and process it without much telegraf input configuration.
__________________
Len


HomeSeer Version: HS3 Pro Edition 3.0.0.368
Linux version: Linux homeseer Ubuntu 16.04 x86_64
Number of Devices: 555
Number of Events: 750
Available Threads: 600

Enabled Plug-Ins
2.0.49.0: BLBackup
2.0.38.0: BLLAN
3.0.0.40: EasyTrigger
30.0.0.36: RFXCOM
3.0.0.76: weatherXML
3.0.1.130: Z-Wave
Reply With Quote
  #34  
Old May 13th, 2018, 01:16 AM
mminehan mminehan is offline
Seer Deluxe
 
Join Date: Jun 2011
Location: New Zealand
Posts: 366
Can someone post a copy of their working windows script (entire script) with the "allow" list instead of the "skip" list?

I can't seem to get mine working. Every time I put a device number in the list I get a series of errors.

Thanks, Marty.
__________________
iCore5 Win 10 Pro x64 SSD

HS3 Pro Edition 3.0.0.435 Windows

BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:
Reply With Quote
  #35  
Old May 13th, 2018, 03:09 PM
OliP OliP is offline
Seer Deluxe
 
Join Date: Sep 2014
Location: Kent
Posts: 125
Thank you for this script - been wanting to send data onto InfluxDB/Grafana for years.

Sadly im yet to get it working. Im getting a 404 error, suggesting it cant find the db. The db exists, and the servername is localhost. Other agents on my network are writing to it fine.

Any ideas?

Code:
Error: System.Net.WebException: The remote server returned an error: (404) Not Found. at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at scriptcode5.VBWrapper.Main(Object Parms)
Reply With Quote
  #36  
Old May 14th, 2018, 10:28 AM
OliP OliP is offline
Seer Deluxe
 
Join Date: Sep 2014
Location: Kent
Posts: 125
OKay so the 404 was my fault, was writing to a db that didnt exist - server had ignored the config file on last boot.

I can now see metrics in my db - but my log is still full of errors.

Error: System.IO.FileNotFoundException: Could not find file 'C:\Program Files (x86)\HomeSeer HS3\System.Net.ConnectStream'. File name: 'C:\Program Files (x86)\HomeSeer HS3\System.Net.ConnectStream' at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost) at System.IO.StreamReader..ctor(String path) at scriptcode4.VBWrapper.Main(Object Parms)

for example.
Going to let it run for a few hours, make my dashboards and see if errors continue.

Thanks again for an awesome script!
Reply With Quote
  #37  
Old May 14th, 2018, 05:54 PM
mminehan mminehan is offline
Seer Deluxe
 
Join Date: Jun 2011
Location: New Zealand
Posts: 366
Ok....for those of us less apt at coding, like me who fumbles their way through it, here is the section of code for the 'allow list' section:

Quote:
Dim Allowed As Boolean = False
If ALLOW_LIST <> "" Then
Dim Allows As String() = ALLOW_LIST.Split(New Char() {","c})
If Allows.Contains(devRef) = True Then
Allowed = True
hs.WriteLog("L2DB-InfluxDB", "Allowed: " & devRef)
End If
End If
If Not Allowed Then Exit Sub
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anybody using Grafana? Freddan101 HS3 / HS3PRO Discussion 16 April 28th, 2018 12:15 PM
Grafana / InfluxDB Plugin? OliP Jon00's plugins and scripts 2 October 5th, 2016 02:26 PM
activate device script button from a txt script peterpc HS3 Scripting 21 January 2nd, 2016 02:46 PM
X-10 device firing a script that controls the same device - is there a better way? mosleyh HS2 / HSPRO 3 April 3rd, 2006 01:42 PM
[script] Remote_Translate v2.0 - remap ALL device codes via single script alevey Script & Plug-In Library 0 March 1st, 2002 08:42 PM


All times are GMT -4. The time now is 10:47 AM.


Copyright HomeSeer Technologies, LLC