Announcement

Collapse
No announcement yet.

Object reference not set to an instance of an object with hs.GETUrl VB Script

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

    #16
    Dec-31 16:16:58 Z-Wave Device: Node 48 Z-Wave Battery Set to 70
    Dec-31 16:16:51 BLLAN Info Computer - Mobile juliet --- 1 PING failure
    Dec-31 16:16:50 Warning Not running script since its already running: C:/Program Files (x86)/HomeSeer HS3/scripts/getnews.vb Single instance option enabled in event properties
    Dec-31 16:16:50 Event Running script in background: C:/Program Files (x86)/HomeSeer HS3/scripts/getnews.vb
    Dec-31 16:16:50 Event Event Trigger "Alarm play around"
    Dec-31 16:16:50 Event Event Alarm play around triggered by the event page 'Run' button.
    Dec-31 16:16:45 Z-Wave Device: Node 48 Z-Wave Temperature Kegerator Set to 40.82 (F)
    Dec-31 16:16:45 Z-Wave Device: Node 48 Z-Wave Battery Set to 100
    Dec-31 16:16:36 BLLAN Info Computer - Mobile juliet is connected (Downtime: 1 mins, 26 secs)
    Dec-31 16:16:01 Z-Wave Device: Node 4 Z-Wave Main Energy Panel kW Hours 2 Set to 2206.207 (2206.207 kW Hours)
    Dec-31 16:16:01 Z-Wave Device: Node 4 Z-Wave kW Hours 1 Set to 2508.082 (2508.082 kW Hours)
    Dec-31 16:16:00 weatherXML Triggers to check: 0
    Dec-31 16:15:20 Z-Wave Device: First Hallway Basement Door Light Set to ON
    Dec-31 16:15:13 Log Info The log database is currently 44.61MB in size.
    Dec-31 16:15:09 BLLAN Info Computer - Mobile juliet is not connected (Uptime: 46 secs)
    Dec-31 16:15:09 BLLAN Info Computer - Mobile juliet --- 3 PING failures
    Dec-31 16:15:00 Log Maintenance 9577 records, selected by date/time, were removed from the log database.
    Dec-31 16:14:54 BLLAN Info Computer - Mobile juliet --- 2 PING failures
    Dec-31 16:14:38 BLLAN Info Computer - Mobile juliet --- 1 PING failure
    Dec-31 16:14:23 BLLAN Info Computer - Mobile juliet is connected (Downtime: 2 mins, 46 secs)
    Dec-31 16:14:01 Z-Wave Device: Node 4 Z-Wave Main Energy Panel kW Hours 2 Set to 2206.153 (2206.153 kW Hours)
    Dec-31 16:14:01 Z-Wave Device: Node 4 Z-Wave kW Hours 1 Set to 2508.03 (2508.03 kW Hours)
    Dec-31 16:12:42 Z-Wave Device: Node 48 Z-Wave Battery Set to 70
    Dec-31 16:12:31 Z-Wave Device: Node 48 Z-Wave Temperature Kegerator Set to 40.46 (F)
    Dec-31 16:12:31 Z-Wave Device: Node 48 Z-Wave Battery Set to 100
    Dec-31 16:12:01 Z-Wave Device: Node 4 Z-Wave Main Energy Panel kW Hours 2 Set to 2206.113 (2206.113 kW Hours)
    Dec-31 16:12:01 Z-Wave Device: Node 4 Z-Wave kW Hours 1 Set to 2507.988 (2507.988 kW Hours)
    Dec-31 16:11:37 BLLAN Info Computer - Mobile juliet is not connected (Uptime: 45 secs)
    Dec-31 16:11:37 BLLAN Info Computer - Mobile juliet --- 3 PING failures
    Dec-31 16:11:21 BLLAN Info Computer - Mobile juliet --- 2 PING failures
    Dec-31 16:11:06 BLLAN Info Computer - Mobile juliet --- 1 PING failure
    Dec-31 16:11:00 weatherXML Triggers to check: 0
    Dec-31 16:10:51 BLLAN Info Computer - Mobile juliet is connected (Downtime: 15 secs)
    Dec-31 16:10:36 BLLAN Info Computer - Mobile juliet is not connected (Uptime: 2 mins, 23 secs)
    Dec-31 16:10:36 BLLAN Info Computer - Mobile juliet --- 3 PING failures
    Dec-31 16:10:21 BLLAN Info Computer - Mobile juliet --- 2 PING failures
    Dec-31 16:10:14 Z-Wave Device: Node 47 Z-Wave Access Control Notification Set to NOTIFICATION for type Access Control Notification, Event: Lock Jammed

    Comment


      #17
      I would consider rebooting the machine to have a fresh start as well. Also is your internet port 80?

      Comment


        #18
        Originally posted by wkrasner View Post
        I appreciate you sticking with me. I copied preciley your syntax and settings and now I get
        Not running script since its already running: C:/Program Files (x86)/HomeSeer HS3/scripts/getnews.vb Single instance option enabled in event properties
        One of the previous errors has the scripting engine locked up. Restart HS3.

        Comment


          #19
          Click image for larger version

Name:	Capture.PNG
Views:	38
Size:	272.7 KB
ID:	1350890

          Comment


            #20
            Is it working?

            Comment


              #21
              Nope int 80 ext different

              Comment


                #22
                The port number is immaterial.

                Does the HS3 server have internet access?

                Change the script as shown to add error trapping which may shed light on the problem

                Code:
                Sub Main(parm as object)
                
                    Dim logName As String = "test"
                    Dim host As String = "http://lite.cnn.io"
                    Dim page As String = "/en"
                    Dim strip_tags As Boolean = False
                    Dim port As Integer = 80
                    Try
                        Dim resp As String = hs.GetURL(host, page, strip_tags, port)
                        hs.WriteLog(logName, resp)
                
                    Catch ex As Exception
                        'Error trapping
                        hs.WriteLogEx(logName, ex.ToString, "#ff0000")
                    End Try
                
                End Sub
                Edit: note the setting of 'strip_tags' false vs. true make a significant difference in the output.

                Comment


                  #23
                  Can you go to the website in a browser and did you reboot? It may even require you to remove the rj45 plug if you are hardwired.

                  Here is my script in text form - I don't see anything different

                  Sub Main(parm As Object)

                  Dim Strdata As String

                  Strdata = hs.GetURL("http://lite.cnn.io", "/en" , true, 80)

                  hs.writelog ("test", Strdata)

                  End Sub

                  Comment


                    #24
                    Thank you all the cold reboot did the trick. Happy New Year

                    Comment

                    Working...
                    X