Announcement

Collapse
No announcement yet.

Watchdog Script - Error

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

    #16
    Heyas all. I'll clean-up the script and repost it, tested with a scratch install, step by step on my config. Give me a day, or two to get to it.

    Comment


      #17
      Also, it's probably worth checking this:

      Paste the following lines of debug code into the Homeseer web page Control, Immediate Script Command window and execute them, then post the relevant lines displayed on the HS log.

      PHP Code:
      &hs.Transmit "A1""Status Request"00TrueFalse
      hs.lastx10
      hs
      .writelog "TM13"
      e.g.

      Mine responds with:

      06/05/2008 18:57:26 Info Control Panel Immediate Script: &hs.Transmit "A1", "Status Request", 0, 0, True, Falsex = hs.lastx10hs.writelog "TM13 X10 Reply is", x
      06/05/2008 18:57:26 TM13 A;A;14;0;
      06/05/2008 18:57:27 X10 Received A Status Off

      The main line of interest is the second one, labelled TM13.

      Comment


        #18
        Mine does:

        6-5-2008 20:48:59 Info Control Panel Immediate Script: &hs.Transmit "A1", "Status Request", 0, 0, True, Falsex = hs.lastx10hs.writelog "TM13", x
        6-5-2008 20:48:59 TM13 I;I5;2;;

        I5 is the last device which has changed before I executed the command !!
        Regards,

        Rien du Pre
        The Netherlands
        Using:
        Homeseer PRO latest HS4 BETA on a Raspberry
        Plugin's:
        RFXCOM, mcsMQTT, Z-Wave

        Comment


          #19
          Odd. I'm wondering if your TM13 is maybe not providing a status report. It's either that, or it is not getting the "status request".

          Your TM13 is definitely on "A1", right?

          If so, it may be just slow (very noisy powerline). try inserting a short delay before the lastx10 command.

          i.e.

          PHP Code:
          &hs.Transmit "A1""Status Request"00TrueFalse 
          hs
          .WaitSecs 5
          hs.lastx10 
          hs
          .writelog "TM13"
          If it's really slow, you might need to up that to 10 secs. Alternatively, process in a loop, something like this:

          PHP Code:
          &hs.Transmit "A1""Status Request"00TrueFalse 
          for i=1 to 30
            hs
          .waitsecs 1
            x 
          hs.lastx10 
            hs
          .clearlastx10
            hs
          .writelog "TM13"x
          next i 

          Comment


            #20
            Now it's like this !!!

            7-5-2008 14:25:25 Info Control Panel Immediate Script: &hs.Transmit "A1", "Status Request", 0, 0, True, False hs.WaitSecs 5 x = hs.lastx10 hs.writelog "TM13", x
            7-5-2008 14:25:30 TM13 I;I3;3;;
            7-5-2008 14:25:31 X10 Received A1 ( Watchdog Device) A1 ( Watchdog Device) A Status Request
            7-5-2008 14:25:31 X10 Received A Status Off
            7-5-2008 14:25:32 X10 Received A Status Off
            Regards,

            Rien du Pre
            The Netherlands
            Using:
            Homeseer PRO latest HS4 BETA on a Raspberry
            Plugin's:
            RFXCOM, mcsMQTT, Z-Wave

            Comment


              #21
              Okay, I think I got it working.....

              Somewhere at the end of the script you combine Reply(0) and Reply(1) en check this against the "WatchdogResponse" variable. In the original script this variable was set on AA. But when you combine Reply(0) and Reply(1) it will be AA1 and this should be the same in your situation according to you response.

              Now I've changed the "WatchdogResponse" variable to AA1 and now it's seems to be working.

              Thanks,
              Regards,

              Rien du Pre
              The Netherlands
              Using:
              Homeseer PRO latest HS4 BETA on a Raspberry
              Plugin's:
              RFXCOM, mcsMQTT, Z-Wave

              Comment


                #22
                Glad you got it working.

                The two TM13s I tried, both gave the originally coded response, but I did expect that the response would need to be tweaked, depending on what was being used as the watchdog device to supply a status response - just didn't expect the response to vary with the same type of device (TM13s).

                Comment


                  #23
                  I'm also trying to implemet this script. It seems to run, but I have a few questions; sorry i'm still new in scripting stuff:

                  1. what's the preffered way to autostart this script from reboot (i'm using hs as service on winXP)

                  2. when the script runs, I always get response times of 1 ms. This never seems to change to other values. Is this still a bug, or am I doing something wrong? 1 ms seems way too quick to be true.

                  3. What's the preffered way to restart the pc on a 'code RED' condition (my cm11 fails to respond)

                  Comment


                    #24
                    Another question;

                    what's the benefit of changing the TM13's status from ON --> OFF --> ON everytime, can't we just poll the status and wait for the reply and timeout on this?

                    Sometimes the watchdog script will fail and set the Z10 status to off, I made an event on devicechange Z10 --> OFF and set the device to ON again to restart the script. I don't know the reason why it fails, it happens once in a while (sometimes within 1 hour, sometimes it keeps running for 2 days). The log only shows Watchdog is stopped.

                    Offcourse I still want to know my questions in the previous post:

                    Should I make an event for autostart after restart homeseer the same way? So if device Z10 is ON at least 5 minutes then turn Z10 off or Z10 is OFF at least 5 minutes then turn Z10 ON?

                    How to detect a code RED to start a program to restart my PC; should I 'hack' this into the script to execute some program to restart the PC.

                    Also the response-times are still strange, it varies in the range 0 - 3 ms; this can't be true, on a 50HZ net 0,5 phase is 10 ms already. Aren't these seconds? 0-3 seconds seems more realistic

                    Comment

                    Working...
                    X