I have been testing the Device History plugin for a couple days now. I was struggling with this error for quite a while trying to run an event script using the GetRangeStats plugin function.
Jan-05 17:19:49 Error Compiling script /usr/local/HomeSeer/scripts/TestGenDivHistChart.vb: http://mono-project.com/Bugs)
Jan-05 17:19:49 Error Compiling script /usr/local/HomeSeer/scripts/TestGenDivHistChart.vb: The import 'System.Core' could not be found.
I found several threads in other forums mentioning the System.Core error, but none had a real solution other than suggesting it was some issue in the script.
My initial script passed an array of strings inside curly braces in the function call, just like in the user guide and an example I found in the forum.
I tried lots of different changes like using literals, defining string variables, using the toString() function on other variables. But the only way I found to get rid of the error was to define a separate array object (arrStrings in my test script below) and pass it in the function call.
Since my initial script was based on sample code in the plugin user guide, I wanted to share the solution in case it helps others.
I don't know if this issue is unique to the Linux (I'm running a HomeTrollerZee).
Here is the working code.
Thanks,
Dave
HomeSeer Version: HS3 ZEE S2 Edition 3.0.0.368
Linux version: Linux HomeTrollerZeeS2V2 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux System Uptime: 3 Days 23 Hours 50 Minutes 34 Seconds
Enabled Plug-Ins
1.2.2.0: Device History
3.0.1.130: Z-Wave
Jan-05 17:19:49 Error Compiling script /usr/local/HomeSeer/scripts/TestGenDivHistChart.vb: http://mono-project.com/Bugs)
Jan-05 17:19:49 Error Compiling script /usr/local/HomeSeer/scripts/TestGenDivHistChart.vb: The import 'System.Core' could not be found.
I found several threads in other forums mentioning the System.Core error, but none had a real solution other than suggesting it was some issue in the script.
My initial script passed an array of strings inside curly braces in the function call, just like in the user guide and an example I found in the forum.
I tried lots of different changes like using literals, defining string variables, using the toString() function on other variables. But the only way I found to get rid of the error was to define a separate array object (arrStrings in my test script below) and pass it in the function call.
Since my initial script was based on sample code in the plugin user guide, I wanted to share the solution in case it helps others.
I don't know if this issue is unique to the Linux (I'm running a HomeTrollerZee).
Here is the working code.
Code:
Sub Main(ByVal Parm As String) Dim dtFromDate as Date = DateTime.Now.AddDays(-1) Dim dtToDate as Date = DateTime.Now ' Define the array object Dim arrStrings = New String() {"88", dtFromDate.toString(), dtToDate.toString()} Dim strRangeVals as String strRangeVals = hs.PluginFunction("Device History", "", "GetRangeStats", arrStrings) hs.writelog("test","Range Stats = " & strRangeVals) End Sub
Dave
HomeSeer Version: HS3 ZEE S2 Edition 3.0.0.368
Linux version: Linux HomeTrollerZeeS2V2 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux System Uptime: 3 Days 23 Hours 50 Minutes 34 Seconds
Enabled Plug-Ins
1.2.2.0: Device History
3.0.1.130: Z-Wave
Comment