Announcement

Collapse
No announcement yet.

Help with graphing in HSTouch.

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

    Help with graphing in HSTouch.

    May 13 2018 edit: Solution for a Zee-S2 involves adding "New Object()" in the text string. For example with Device 126, 2 days line graph:
    <img src='http://192.168.1.200/[$SCRIPT=&nhs.PluginFunction("Device History","","CreateChartByDays", New Object() {"126", "2", "", "", "2", "false", "320", "240"})]' />

    - - - - - - - - - - - - - - -
    Hopefully this is a simple edit... I tried following the HSTouch example from the Device History help file, but always get the same error in HomeSeer:

    Compiling script /tmp/K2.vb: Visual Basic.Net Compiler version 0.0.0.5943 Copyright (C) 2004-2010 Rolf Bjarne Kvinge. All rights reserved. /tmp/19070578/6304ec00.0.vb (2,16) : Warning VBNC40056: The import 'System.Core' could not be found. /tmp/19070578/6304ec00.0.vb (19,9) : Warning VBNC42024: Function without an 'As' clause; Object return type assumed. /tmp/19070578/6304ec00.0.vb (21,42) : Error VBNC99999: Internal compiler error close to this location Error : VBNC99999: Unexpected error: Object reference not set to an instance of an object at vbnc.Argument.ResolveCode (vbnc.ResolveInfo Info) [0x00000] in :0 at vbnc.BaseObjects`1[vbnc.Argument].ResolveCode (vbnc.ResolveInfo Info) [0x00000] in :0 at vbnc.ArgumentList.ResolveCode (vbnc.ResolveInfo Info) [0x00000] in :0 at vbnc.InvocationOrIndexExpression.ResolveExpressionInternal (vbnc.ResolveInfo Info) [0x00000] in :0 at vbnc.Expression.ResolveExpression (vbnc.ResolveInfo ResolveInfo) [0x00000] in :0 Compilation took 00:00:04.3367470

    This happens when I use any of the following as the text for an isHTML field in HSTouch:
    <img src='http://192.168.1.200/[$SCRIPT=&nhs.PluginFunction("Device History","","CreateChartByDays",{"126", "1", "", "", "2", "false", "170", "120"})]' />

    <img src='http://192.168.1.200/[$SCRIPT=&nhs.PluginFunction("Device History","","CreateChartByDays",{"126", "1"})]' />

    Where 192.168.1.200 is my local Zee-S2, and 126 is the device I want to graph (which is configured under Device History).

    System Info:
    Current Date/Time: 3/31/2018 12:15:03 PM
    HomeSeer Version: HS3 ZEE S2 Edition 3.0.0.422
    Linux version: Linux HomeTrollerZeeS2 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux System Uptime: 0 Days 14 Hours 37 Minutes 48 Seconds
    IP Address: 192.168.1.200
    Number of Devices: 92
    Number of Events: 17
    Available Threads: 399
    HSTouch Enabled: True
    Event Threads: 0
    Event Trigger Eval Queue: 0
    Event Trigger Priority Eval Queue: 0
    Device Exec Queue: 0
    HSTouch Event Queue: 0
    Email Send Queue: 0
    Anti Virus Installed:
    License: Registered
    Web Server Port: 80

    Enabled Plug-Ins
    1.2.2.0: Device History
    3.0.0.31: Nest
    3.0.1.190: Z-Wave

    PS: Viewing a graph from the Device History page in HomeSeer works fine
    Last edited by NutsyHome; May 13, 2018, 07:10 AM.

    #2
    Nothing relevant seems to be in the Device History Trace log...

    3/31/2018 12:11:48.107 Trace HSPI.HSEvent - >>>> HSPI.HSEvent(VALUE_CHANGE,<Object()>)
    3/31/2018 12:11:48.115 Debug HSPI.HSEvent - HSEvent: VALUE_CHANGE
    3/31/2018 12:11:48.125 Trace PluginLogic.LogValueChange - >>>> PluginLogic.LogValueChange(<Object()>)
    3/31/2018 12:11:48.132 Trace PluginLogic.LogValueChange - <<<< PluginLogic.LogValueChange
    3/31/2018 12:11:48.139 Trace HSPI.HSEvent - <<<< HSPI.HSEvent
    3/31/2018 12:11:48.189 Trace HSPI.HSEvent - >>>> HSPI.HSEvent(VALUE_CHANGE,<Object()>)
    3/31/2018 12:11:48.196 Debug HSPI.HSEvent - HSEvent: VALUE_CHANGE
    3/31/2018 12:11:48.203 Trace PluginLogic.LogValueChange - >>>> PluginLogic.LogValueChange(<Object()>)
    3/31/2018 12:11:48.210 Trace PluginLogic.LogValueChange - <<<< PluginLogic.LogValueChange
    3/31/2018 12:11:48.217 Trace HSPI.HSEvent - <<<< HSPI.HSEvent
    3/31/2018 12:11:48.318 Trace HSPI.HSEvent - >>>> HSPI.HSEvent(VALUE_CHANGE,<Object()>)
    3/31/2018 12:11:48.327 Debug HSPI.HSEvent - HSEvent: VALUE_CHANGE
    3/31/2018 12:11:48.336 Trace PluginLogic.LogValueChange - >>>> PluginLogic.LogValueChange(<Object()>)
    3/31/2018 12:11:48.345 Trace PluginLogic.LogValueChange - <<<< PluginLogic.LogValueChange
    3/31/2018 12:11:48.354 Trace HSPI.HSEvent - <<<< HSPI.HSEvent
    3/31/2018 12:11:48.366 Trace HSPI.HSEvent - >>>> HSPI.HSEvent(VALUE_CHANGE,<Object()>)
    3/31/2018 12:11:48.375 Debug HSPI.HSEvent - HSEvent: VALUE_CHANGE
    3/31/2018 12:11:48.383 Trace PluginLogic.LogValueChange - >>>> PluginLogic.LogValueChange(<Object()>)
    3/31/2018 12:11:48.393 Trace PluginLogic.LogValueChange - <<<< PluginLogic.LogValueChange
    3/31/2018 12:11:48.403 Trace HSPI.HSEvent - <<<< HSPI.HSEvent
    3/31/2018 12:11:48.425 Trace HSPI.HSEvent - >>>> HSPI.HSEvent(VALUE_CHANGE,<Object()>)
    3/31/2018 12:11:48.433 Debug HSPI.HSEvent - HSEvent: VALUE_CHANGE
    3/31/2018 12:11:48.457 Trace PluginLogic.LogValueChange - >>>> PluginLogic.LogValueChange(<Object()>)
    3/31/2018 12:11:48.465 Trace PluginLogic.LogValueChange - <<<< PluginLogic.LogValueChange
    3/31/2018 12:11:48.473 Trace HSPI.HSEvent - <<<< HSPI.HSEvent
    3/31/2018 12:11:48.529 Trace HSPI.HSEvent - >>>> HSPI.HSEvent(VALUE_CHANGE,<Object()>)
    3/31/2018 12:11:48.538 Debug HSPI.HSEvent - HSEvent: VALUE_CHANGE
    3/31/2018 12:11:48.547 Trace PluginLogic.LogValueChange - >>>> PluginLogic.LogValueChange(<Object()>)
    3/31/2018 12:11:48.557 Trace PluginLogic.LogValueChange - <<<< PluginLogic.LogValueChange
    3/31/2018 12:11:48.567 Trace HSPI.HSEvent - <<<< HSPI.HSEvent
    3/31/2018 12:11:48.611 Trace HSPI.HSEvent - >>>> HSPI.HSEvent(VALUE_CHANGE,<Object()>)
    3/31/2018 12:11:48.620 Debug HSPI.HSEvent - HSEvent: VALUE_CHANGE
    3/31/2018 12:11:48.628 Trace PluginLogic.LogValueChange - >>>> PluginLogic.LogValueChange(<Object()>)
    3/31/2018 12:11:48.637 Trace PluginLogic.LogValueChange - <<<< PluginLogic.LogValueChange
    3/31/2018 12:11:48.646 Trace HSPI.HSEvent - <<<< HSPI.HSEvent
    3/31/2018 12:11:49.970 Trace HSPI.HSEvent - >>>> HSPI.HSEvent(VALUE_CHANGE,<Object()>)
    3/31/2018 12:11:49.977 Debug HSPI.HSEvent - HSEvent: VALUE_CHANGE
    3/31/2018 12:11:49.985 Trace PluginLogic.LogValueChange - >>>> PluginLogic.LogValueChange(<Object()>)
    3/31/2018 12:11:49.993 Trace PluginLogic.LogValueChange - <<<< PluginLogic.LogValueChange
    3/31/2018 12:11:50.001 Trace HSPI.HSEvent - <<<< HSPI.HSEvent
    3/31/2018 12:11:52.950 Trace HSPI.HSEvent - >>>> HSPI.HSEvent(VALUE_CHANGE,<Object()>)
    3/31/2018 12:11:52.966 Debug HSPI.HSEvent - HSEvent: VALUE_CHANGE
    3/31/2018 12:11:52.974 Trace PluginLogic.LogValueChange - >>>> PluginLogic.LogValueChange(<Object()>)
    3/31/2018 12:11:52.984 Trace PluginLogic.LogValueChange - <<<< PluginLogic.LogValueChange
    3/31/2018 12:11:52.992 Trace HSPI.HSEvent - <<<< HSPI.HSEvent

    Comment


      #3

      Comment


        #4
        Sorry, I missed this notification not once but twice! I'll take a look - clearly there's an error (based on the initial log message you posted) rather than "no way to display on HSTouch"

        Comment


          #5

          Comment


            #6
            Partially. I was testing your situation and found there was an issue if not all parameters were provided, so mostly this change was to force them all to be required (since the way HS calls the function doesn't allow for "Optional" parameters, even though I coded it that way...).

            For your example, I used this content in a text box with "IsHTML" set to True:

            <img src='http://192.168.0.6/[$SCRIPT=&nhs.PluginFunction("Device History","","CreateChartByDays",{"617", "1", "", "", "2", "false", "550", "400"})]' />

            And it generated the attached on my test screen.
            Attached Files

            Comment


              #7
              Thinking about this some more made me wonder... the "vbnc" references in the errors (in addition to the /tmp directories) make it clear you're running this on a linux-based server. Unfortunately, Mono is only 95% compatible with .NET, so it's possible this is a defect in Mono where it doesn't behave the same way true .NET would. And it's in the code that interfaces with HS3, so it's not something over which I really have control.

              Originally posted by NutsyHome View Post
              Compiling script /tmp/K2.vb: Visual Basic.Net Compiler version 0.0.0.5943 Copyright (C) 2004-2010 Rolf Bjarne Kvinge. All rights reserved. /tmp/19070578/6304ec00.0.vb (2,16) : Warning VBNC40056: The import 'System.Core' could not be found. /tmp/19070578/6304ec00.0.vb (19,9) : Warning VBNC42024: Function without an 'As' clause; Object return type assumed. /tmp/19070578/6304ec00.0.vb (21,42) : Error VBNC99999: Internal compiler error close to this location Error : VBNC99999: Unexpected error: Object reference not set to an instance of an object at vbnc.Argument.ResolveCode (vbnc.ResolveInfo Info) [0x00000] in :0 at vbnc.BaseObjects`1[vbnc.Argument].ResolveCode (vbnc.ResolveInfo Info) [0x00000] in :0 at vbnc.ArgumentList.ResolveCode (vbnc.ResolveInfo Info) [0x00000] in :0 at vbnc.InvocationOrIndexExpression.ResolveExpressionInternal (vbnc.ResolveInfo Info) [0x00000] in :0 at vbnc.Expression.ResolveExpression (vbnc.ResolveInfo ResolveInfo) [0x00000] in :0 Compilation took 00:00:04.3367470
              So I set out to see if I could find any evidence that this method gave other people problems in Mono, and lo and behold one of the few other hits I got on Google was also from HS3 (our use of Mono is pretty significant in the ecosystem):

              https://forums.homeseer.com/showthread.php?t=191003

              And their error message was almost exactly the same, and they solved it by adding "New Object()" before the in-line array definition. Might be worth a try for you, too.

              Comment


                #8
                That did it!

                I'll provide more details tomorrow when I get everything fully understood.
                PS: This is on a Zee-S2.

                Comment


                  #9
                  Originally posted by NutsyHome View Post
                  That did it!

                  I'll provide more details tomorrow when I get everything fully understood.
                  PS: This is on a Zee-S2.
                  Glad to hear that. I'll test the "New Object()" syntax on Windows - if it works there, I'll just update the example to show that as the way to go; if not, I'll have to expand a little to describe how it has to change based on whether your server is Windows or Linux - frustrating little things like that make it tough to commit to developing plugins on Linux, but with so many people using a Zee, it's a hard market to ignore!

                  Comment


                    #10
                    Success!

                    Here's a cut & paste of what works. 192.168.1.200 is the local IP address of my Zee-S2.

                    First graph: Single device (126) line graph for two days in 320x240.
                    <img src='http://192.168.1.200/[$SCRIPT=&nhs.PluginFunction("Device History","","CreateChartByDays", New Object() {"126", "2", "", "", "2", "false", "320", "240"})]' />

                    Second graph: Two devices (29 and 24) on separate axis for one day.
                    <img src='http://192.168.1.200/[$SCRIPT=&nhs.PluginFunction("Device History","","CreateChartByDays", New Object() {"29", "1", "", "24", "2", "false", "320", "240"})]' />

                    Comment

                    Working...
                    X