Announcement

Collapse
No announcement yet.

MyHS JSON controls not working - HS4 4.1.1

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

    #16
    So I setup BI to send the calls out to another server running netcat to capture what's being sent.

    It is in fact sending a get request, but for some reason HS doesn't like the following data? If the same URL is called in a web browser it works.

    Maybe the User Agent plays a roll in this?

    Netcat Output

    GET /JSON?request=controldevicebylabel&ref=3918&label=On HTTP/1.1
    Authorization: Basic "removed this info"
    User-Agent: ─ü
    Host: 192.168.1.50
    Cache-Control: no-cache

    Firefox Output - This works

    GET /JSON?request=controldevicebylabel&ref=3918&label=On HTTP/1.1
    Host: 192.168.1.50
    Connection: keep-alive
    Cache-Control: max-age=0
    Upgrade-Insecure-Requests: 1
    DNT: 1
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
    Accept-Encoding: gzip, deflate
    Accept-Language: en

    Comment


      #17
      Originally posted by mik3 View Post
      So I setup BI to send the calls out to another server running netcat to capture what's being sent.

      It is in fact sending a get request, but for some reason HS doesn't like the following data? If the same URL is called in a web browser it works.

      Maybe the User Agent plays a roll in this?

      Netcat Output

      GET /JSON?request=controldevicebylabel&ref=3918&label=On HTTP/1.1
      Authorization: Basic "removed this info"
      User-Agent: ─ü
      Host: 192.168.1.50
      Cache-Control: no-cache

      Firefox Output - This works

      GET /JSON?request=controldevicebylabel&ref=3918&label=On HTTP/1.1
      Host: 192.168.1.50
      Connection: keep-alive
      Cache-Control: max-age=0
      Upgrade-Insecure-Requests: 1
      DNT: 1
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
      Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
      Accept-Encoding: gzip, deflate
      Accept-Language: en
      You are clearly more technical than I am, but it would seem to me this does to a homeseer issue, does it not? :-)

      it was easily fixed adding the username and password to the call, and I've moved on :-) :-) :-)

      Sent from my SM-G975U using Tapatalk

      Comment


        #18
        Originally posted by Tomgru View Post
        You are clearly more technical than I am, but it would seem to me this does to a homeseer issue, does it not? :-)

        it was easily fixed adding the username and password to the call, and I've moved on :-) :-) :-)

        Sent from my SM-G975U using Tapatalk
        Possibly, it's hard to point the finger. Did BI make a change on how the requests go out, or did Homeseer make a change how it receives it?

        I haven't tested with a username and password, only because the exact same URL request over my axis camera and firefox work.

        Comment


          #19
          I have latest BI5 and HS 4 running same machine. HS is port 80 BI is 81. And this still works after upgrade from HS3.

          BI to HS to run an event:

          Code:
          192.168.2.184:80/JSON?user=xxxxxxxxx&pass=xxxxxx&request=runevent&id=65
          HS to BI to turn off and on Camera Motion Detection:

          Code:
          &hs.urlaction("http://192.168.2.184:81/admin?camera=Drvway&motion=0&user=xxxxxxxx&pw=xxxxxxxxx", "GET", "", "")
          &hs.urlaction("http://192.168.2.184:81/admin?camera=Drvway&motion=1&user=xxxxxxxx&pw=xxxxxxxxx", "GET", "", "")

          Comment


            #20
            I just tried https://connected2.homeseer.com/JSON...er=xxxxxxxxxx& pass=xxxxxxxx and it fired and works fine from a browser on another machine.

            Comment


              #21
              I'm having an issue with Geofency with PHLocation which also uses JSON via MyHS. While I can see my iPhone log into to my system......it appears the JSON command are not working.

              Comment

              Working...
              X