No announcement yet.

Help using &hs.GetURLIE immediate script command

  • Filter
  • Time
  • Show
Clear All
new posts

  • DMT

    Thank you ever so much mrhappy !!!

    Both your solutions work 100% without modification, no log errors whatsoever

    &hs.GetURL - works

    httpWebRequest script - works and logs the response from the webserver switch (example off)

    I must have done something wrong before with &hs.GetURL

    Very much appreciate your guidance. Thanks again.

    Leave a comment:

  • mrhappy
    Suprised the geturl does not work but not having the hardware to test with makes things quite difficult, the same with any other script. Does

    &hs.GetURL("","",TRUE ,80)

    Work out of interest? Does it also put any errors in the HS log?

    In response to the question about using httpWebRequest then this would be a start (which is a straight lift from MSDN just adapted to HS).

    Imports System.Net
    Imports System.Text
    Imports System.IO
    Sub Main(ByVal Parms As Object)
            ' Create a request for the URL. 
            Dim request As WebRequest = WebRequest.Create("")
            ' If required by the server, set the credentials.
            request.Credentials = CredentialCache.DefaultCredentials
            ' Get the response.
            Dim response As WebResponse = request.GetResponse()
            ' Display the status.
            hs.writelog("", CType(response, HttpWebResponse).StatusDescription)
            ' Get the stream containing content returned by the server.
            Dim dataStream As Stream = response.GetResponseStream()
            ' Open the stream using a StreamReader for easy access.
            Dim reader As New StreamReader(dataStream)
            ' Read the content.
            Dim responseFromServer As String = reader.ReadToEnd()
            ' Display the content.
            hs.writelog("", responseFromServer)
            ' Clean up the streams and the response.
        Catch ex As Exception : hs.writelog("", "Exception: " & ex.message)
        End Try
    End Sub

    Leave a comment:

  • DMT

    I am still trying to solve a problem with hs.GetURLIE

    This simple script turns a web switch on or off by changing the p61= parameter. It works fine for a bit then productes an ActiveX error in the log and won't work again until a reboot.

    Sub Main()
    Dim Page

    Page = hs.GetURLIE("",TRUE)

    End Sub

    HomeSeer support said this appears to be a bug in HS3 and in the meantime I could "use native .net calls to do the same thing. Check out the httpWebRequest .net class.".

    One earlier suggestion was to try hs.GetURL however that doesn't work at all. I have to admit I am very new to this and have no idea how to create a script using httpWebRequest.

    Any guidance would be appreciated while I continue to research and learn.

    HomeSeer HS3
    Windows 10 Pro Version 1511

    Many thanks.

    Leave a comment:

  • DMT
    Thanks for your help. I tried GetURL in various forms and while I can get a version not to produce any log errors, nothing I tried will actually operate the switch. Only the GetURLIE command works.


    Leave a comment:

  • mrhappy
    hs.geturlie uses/used Internet Explorer and has been a HS command for some time (I think the intention was that IE rendered some pages rather than just try and get all of the raw data), being as though you use Windows 10 (and it is now Edge) I wonder if this is a bug that has not come up before. Wikipedia even says "In 2015, Microsoft Edge, the replacement for Internet Explorer, dropped ActiveX support, marking the end of the technology" so it may be that it can't create the component because Edge no longer supports it. Try instead:

    &hs.GetURL("","/set.cmd?user=admin+pass=password+cmd=setpower+p61=1",TRUE,80 )

    Leave a comment:

  • DMT
    started a topic Help using &hs.GetURLIE immediate script command

    Help using &hs.GetURLIE immediate script command

    Hi, new to HomeSeer, really enjoying so far. My Z-Wave devices are working extremely well.

    I have an IP power switch with 4 relays on my LAN that can be controlled as follows:
    ON (Relay1)
    OFF (Relay1)