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

  • wkrasner
    replied
    Thank you all the cold reboot did the trick. Happy New Year

    Leave a comment:


  • AllHailJ
    replied
    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

    Leave a comment:


  • zwolfpack
    replied
    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.

    Leave a comment:


  • wkrasner
    replied
    Nope int 80 ext different

    Leave a comment:


  • AllHailJ
    replied
    Is it working?

    Leave a comment:


  • wkrasner
    replied
    Click image for larger version

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

    Leave a comment:


  • zwolfpack
    replied
    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.

    Leave a comment:


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

    Leave a comment:


  • wkrasner
    replied
    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

    Leave a comment:


  • aa6vh
    replied
    Originally posted by wkrasner View Post
    VB.Net script exception(0), re-starting: Object reference not set to an instance of an object.

    Yes same error with just writelog
    If you are getting the same error without the GetUrl statement (in other words, just the writelog statement), then it is something else.

    Is it possible that some other script is trying to run, or is running, at the same time? The error may be unrelated directly with your script.

    Hate to ask this, but if you can dump out the actual log with some lines before and after the script, maybe we can spot something.

    Otherwise, I am not seeing it yet.

    (This assumes you have made the corrections mentioned above, including adding back "Main" to your subroutine declaration.)

    Leave a comment:


  • wkrasner
    replied
    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

    Leave a comment:


  • AllHailJ
    replied
    This is how it looks in an event

    Click image for larger version  Name:	Screenshot from 2019-12-31 13-18-45.png Views:	0 Size:	59.3 KB ID:	1350865

    here is the data from my log - Notice i changed for "test" to StrData

    CNN - Breaking News, Latest News and VideosCNN | 12/31/2019 | ListenMain StoriesAll the cadets pictured giving a Nazi salute will be fired, West Virginia governor saysOpinion: Anti-Semitic attacks show a society at risk of falling apartThe suspect in the NY Hanukkah stabbings now faces federal hate crime charges. Here's what authorities foundReligion is widening the partisan divideProtesters attack US embassy in Baghdad after airstrikesUS flies Apache helicopters over protesters at US embassy in IraqTrump spent 1 of every 5 days at one of his golf clubs in 2019Australian wildfires force thousands to flee to beachPuffins scratched their itches with sticks. It's the first evidence seabirds use toolsJudge dismisses impeachment witness lawsuit after House rescinds subpoenaLawyer for indicted Giuliani associate asks court's permission to share material with House investigatorsNYT: White House predicted congressional pushback for holding Ukraine aidOpinion: The case for letting senators vote secretly on Trump's fateEx-Nissan chief Carlos Ghosn has fled Japan for Lebanon8 extraordinary video moments from 2019Anderson Cooper Full CircleQuickly catch up on the day's newsFollow the New Year around the world A cop said McDonald's workers wrote a derogatory term on his cup. He made it up, police chief saysTrump signs robo-call bill into lawSyd Mead, the visual artist behind 'Blade Runner' dies at 86A Georgia Tech football recruit's death on a train track is ruled a suicideCorey Lewandowski drops potential Senate run in New HampshireProjection shows Florida and North Carolina among states that could gain congressional seats after CensusWhat 2020 could bring for the stock marketTexas church security team member who shot gunman had 'eyes' on the man as soon as he walked into the roomOpinion: Texas shooting isn't as simple as it seemsTexas pastor says he knew and helped the gunman before the shootingThe gunman in the Texas church shooting had run-ins with police and had been homeless, his sister saysSonny Mehta, editor-in-chief of Knopf, dies at 77Greyhound is giving free tickets to runaways who want to return homeAn Alabama woman texted 'I feel in trouble' before she disappeared, mother saysAnalysis: A grim end to a dark political year 347 people were killed in Baltimore this year. The mayor pledges to fight the culture of violenceChicago's homicide rate decreases for the third straight yearThe mother of two missing Idaho siblings is not cooperating with investigators, police sayCourt rules against Marc Veyrat in Michelin 'cheddar gate' soufflé caseA mom trying to film her daughter's proposal ended up taking a selfie insteadElizabeth Warren invokes hope in New Year's Eve speech commemorating 2020 launchPete Buttigieg leaves behind economic progress and racial tensions in South BendFact check: Biden makes misleading comments on his past positions on Iraq, Afghanistan warsHe was mocked for proposing in KFC, but the internet found them and will give them their dream weddingOhio doctor charged with killing 25 patients sues hospital for defamationScientist says he's figured out time travelMichelle Williams and 'Hamilton' director Thomas Kail are engaged and expectingCarrie Underwood announces she's stepping down as CMA Awards hostTravis Scott breaks silence over split with Kylie Jenner'Murder Mystery' tops Netflix's most-popular titles of 2019Former tennis champion Margaret Court claims LGBTQ teaching in schools is controlled by 'the devil'Biden would nominate Obama to Supreme Court 'if he'd take it'Linda Ronstadt's vocal genius in 7 songsLinda Ronstadt on the rare brain condition that ended her singing careerTrump's latest call with Putin raises more questions than it answersPutin sent Trump a Christmas and New Year message and invited him again to visit MoscowPutin and Trump spoke by phone to discuss counter-terrorism effortsOpinion: 2020 is prime time for PutinPrince William launches multi-million pound prize to tackle climate crisisTrump and Obama tied for the most admired men in the US this year. Michelle is the most admired woman, Gallup reportsOpinion: The Obama and Trump reading lists, comparedBarack Obama shares his favorite songs of 2019Barack Obama lists his favorite books of 2019Barack Obama's favorite movies and TV shows of 2019The 2010s were relentless. Here are some of the most fascinating news stories that shaped the decade20 things to look forward to in 2020Remembering the decade in political memesHere are 10 of the decade's most influential booksWhen does the decade begin and end anyway?© 2019 Cable News Network. Turner Broadcasting System, Inc. All Rights Reserved.Listen to CNN (low-bandwidth usage)Go to the full CNN experiencewindow.version = "0.19.0" !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.consol e&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","page view ","identify","reset","group","track","ready","alias","de bug" ,"page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analyti cs.push(e);return analytics}};for(var t=0;t

    Leave a comment:


  • AllHailJ
    replied
    You are missing main after the sub. I was talking about the call from event to remove the main.

    Leave a comment:


  • wkrasner
    replied
    Code:
    Sub (parm as object)
    
    Dim Strdata as string
    Strdata = hs.GetURL("http://lite.cnn.io", "/en" , true, 80)
    hs.writelog ("test", "test")
    End Sub

    Leave a comment:


  • sparkman
    replied
    Can you post your whole script with the forums script tags around it?

    Leave a comment:

Working...
X