No announcement yet.

Watchdog Script - Error

  • Filter
  • Time
  • Show
Clear All
new posts

    Watchdog Script - Error

    This looks like a greatscript. Downloaded and changed extension to .vb. Change the Private Const WatchdogResponse As String to B1 and ran the script, got an error1 in the log with message method not found. Looks like I am doing something very wrong.

    Any ideas??



    Can you please post the full log error line?

    Also, please describe how you are running the script.

    Cross-link to script posting:

    Also, have you setup an event, such as shown below, to run the watchdog script?


    Finally, did you execute the installation procedure?

    PHP Code:
    (Replacing A1;Z10 with your corresponding house and devicecodes - A1;B1 in your case, I believe)

    You can run this command from the HS "Control", "Immediate Script Command" web page.

    And, as a reminder, here is a snapshot image of what the devices should look like:

    Last edited by Fuego; January 10, 2008, 05:54 AM. Reason: More details



      Sorry about the delay in getting back to you.
      The log error is

      13/01/2008 22:11:53 - Error 1 - Running script watchdog.vb :method not found

      I just set up a manual event to test the script, ie, just ran the vb script. I have a TM13U set up as device B1.

      At what stage should I run the installation procedure:


      When I tried to run this from the intermediate script command I get the following arror in the log

      13/01/2008 22:17:43 - Error - Running script, init error: Cannot use parentheses when calling a Sub

      Think I need a step by step setup here, sorry for the brain freeze




        Don't use parens. Look in the HS help file for the control device screen for an example of an immediate script command.


          RegForte is correct. I forgot to remove the parenthesis for immediate mode, in the RunEx command above. Replace with spaces.

          PHP Code:
          &hs.RunEx "watchdog.vb","hs_install","install;B1;Z10" 
          Run the install procedure once you have the script in the HS script directory, so that it creates the Watchdog device, or just create the virtual device manually and the associated event as per above screenshots. The latter approach is probably better, as I may have not completed the install procedure (since I am not explicitly going to test it again, at the moment, as I am busy with other things).

          Sorry, but that's the nature of "pre-release" code. I had intended to complete it and release it, but someone asked for it, so I posted it.

          So, to recap; Create the script (as watchdog.vb) in the HS scripts directory, create the virtual device, create the associated event, edit the script to change the TM13 and virtual device house and device codes as appropriate and it should then run when you turn the watchdog on.


            Ok, Thanks for the replies but still have a bit of trouble.

            The TM13U is set to B1 and the watchdog.vb script is in the scripts directory. I ran the install script(without the parenthesis ) and it created the virtual device z10 watchdog controller with the on/off buttons.
            When I turned on the controller, I get an error is the log

            17/01/2008 20:45:29 - Info - Running script in background: watchdog.vb("Watchdog","Z10")

            17/01/2008 20:45:29 - Error - Invalid parameter passed to Watchdog script: Z10

            Have I incorrectly configure the script.

            Here are the first few lines of the script as I have configured it

            ' Powerline Watchdog Script
            ' Fuego (on HS board)
            ' 5th May, 2007
            ' Version 1.7.0
            ' All Rights Reserved
            ' Personal non-profit use only
            Imports Scheduler.Classes
            Private Const INI As String = "Watchdog.ini"
            Private Const SectionName As String = "Watchdog"
            ' Control Device Virtual device
            Private Const ControlDeviceHCDefault As String = "Z"
            Private Const ControlDeviceDCDefault As String = "10"
            Private Const ControlDeviceNameDefault As String = "Control"
            Private Const ControlDeviceLoc1Default As String = "Watchdog"
            Private Const ControlDeviceLoc2Default As String = "Appliance"
            Private Const ControlDeviceEventNameDefault As String = "Watchdog"
            Private Const ControlDevice As String = "Z10"
            Private Const WatchdogDevice As String = "B1"
            ' For a TM13 the response will be HCHC (e.g. "AA"). Other appliances
            ' could respond with HCDC (e.g. "A1"). Set this here:
            Private Const WatchdogResponse As String = "AA" ' TM13
            'Private Const WatchdogResponse As String = "B1" ' Something else
            ' The name of the plugin being used as powerline controller
            Private Const PowerlinePlugin As String = "CM11A"
            ' Timeout should be set long enough to ensure that a reply
            ' isn't going to be coming in at all, or the sequencing
            ' will fail, causing a secodary error - as in all
            ' communication protocols timeout handling - so don't be
            ' tempted to shorten it unless you have the cleanest of
            ' powerlines
            Private Const Timeout As Integer = 20 ' Secs

            Thanks for your help



              No, probably not. That's probably my fault for starting something and not finishing it

              Ignore the install procedure.

              Delete the virtual device (Z10) manually and recreate it manually, using Homeseer. Manually add the event as per the screenshot above and it should all work.


                Sorry for annoying yo about this, but did as requested, but still no luck, when the watchdog script runs the following error comes up

                19/01/2008 14:26:04 - Warning - VB.Net script exception, re-starting: Index was outside the bounds of the array.

                Any ideas




                  When do you get this error? When you turn the watchdog virtual device on?

                  What's in the HS log please?

                  Can you post a screenshot image of what your watchdog virtual device looks like and the attached event as well please?



                    After restarting HS, the error in the log is not repeated. However, I am still not getting the correct watchdog values in the status page.
                    The attached screenshots show you how the devices are set up and the log shows that the script runs buts does not seem to do anything, is this due to the parameter 'watchdog'


                    Attached Files


                      Firstly, the "Run Script" action of the Event associated with the Watchdog device (Z10 in this case) should look like this:

                      <TABLE cellSpacing=0 cellPadding=0 width=0&#37; border=0><TBODY><TR><TD class=tablecellscript noWrap align=right width=160> Run script:</TD><TD class=tablecellscript align=left>watchdog.vb("Watchdog","")</TD></TR></TBODY></TABLE>

                      Does it?

                      Secondly, are you hearing HS speak "Starting Watchdog"?

                      If so, then the process loop is starting and if there are no errors in the log, then it must be running reasonably also.

                      Next, is there any on/off activity, once a minute (or whatever you've set the poll value to) on the TM13 device?

                      Finally, check any watchdog.ini file that may have been created, to ensure it has the expected values.

                      To help you, I'll need some answers to all of the above points.

                      PS. I take it that you have named the script watchdog.vb?
                      PPS. You could also try turning on debug in the script. Easiest way to do this might be to simply find this code:
                      PHP Code:
                          Private Sub WriteDebug(ByVal Text As String)
                      Dim Debug As String ""
                      Debug CStr(hs.GetVar("DebugScripts")).ToLower
                      Catch ex As Exception
                      End Try
                      ScriptName() IsNot Nothing Then
                      If Debug.Contains(ScriptName.ToLower ";"Then
                      End If
                      End If
                      End Sub 
                      and change this line:
                      PHP Code:
                                  If Debug.Contains(ScriptName.ToLower ";"Then 
                      PHP Code:
                                  If True Then 


                        Hi Fuego

                        I am havinbg the same probelms as the other poster.

                        The devices are there, but the watchdog device shows ON and I have on/off/on/off/reset buttons! See attached

                        I enabled debug as per your post and the error below stopped...

                        24/01/2008 23:13:46 - Warning - VB.Net script exception, re-starting: Index was outside the bounds of the array.

                        ...and..the error below appeared when run again....

                        24/01/2008 23:02:48 - Error - Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list. at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args) at System.String.Format(IFormatProvider provider, String format, Object[] args) at System.String.Format(String format, Object arg0) at scriptcode11.scriptcode11.hs_install(String InstallString) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)

                        The log does not show any debug staements though and the device remains the same.

                        Watchdog.ini contents:


                        W4 is the device for your script to update and P1 is my TM13.

                        The TM13, P1, does not change state when the script runs.


                        Attached Files


                          I'll uninstall my script and delete my devices later today and run through the setup and see if I get the same issues.


                            I got the script (I think!!) but I still think there is something strange going on.

                            From a reliable X10 system to a dodgy one, I was hoping this script would help me pinpoint some noises sources.
                            I have added some filters and there has been some improvements but generally the watchdog condition is always red, the round trip time is over 700 to 800 ms and the success rate is usally x:2x.

                            So I got a XTBII(an X10 booster) from Jeff Voip and it seems to overcome all the noise issues and my system is responding 100%.
                            But the script is still showing condition red, even though the round trip time is on average 50 to 60 ms. The success rate is still x:2x.
                            There is an error in the log saying WATCHDOG ERROR: tIMEOUT WAITING FOR RESPONSE FOR B1.
                            If I tried to poll the TM13U via Homeseer it work fine.
                            Surely if the system is responding 100%, the results of the script should be better!!




                              I have also the same problem, did anyone of you resolve this allready?

                              The condition stays red and the TM13 does respond all the time
                              Attached Files

                              Rien du Pre
                              The Netherlands
                              Homeseer PRO latest HS4 BETA on a Raspberry
                              RFXCOM, mcsMQTT, Z-Wave