Announcement

Collapse
No announcement yet.

Secure JSON

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

  • Secure JSON

    Anybody advise on the best and safest way for me to have a change of status on a remote site homeseer eg. workplace then send this data via script for example &hs.geturl but via https or something safe? but i have 2 servers under myhs so it would need to point to the correct one to be able to change the virtual device status at home to (armed/disarmed) etc...

    so simplified!

    work alarm says i am armed then send that to a virtual device at home but without plain text password etc

    thank you

  • #2
    If you are doing a POST or a GET to the MyHS server you are using HTTPS (SSL) and all the data is already encrypted. Do I misunderstand what you are trying to do? SSL encrypts both the data and the URL.

    Originally posted by deanrparry View Post
    Anybody advise on the best and safest way for me to have a change of status on a remote site homeseer eg. workplace then send this data via script for example &hs.geturl but via https or something safe? but i have 2 servers under myhs so it would need to point to the correct one to be able to change the virtual device status at home to (armed/disarmed) etc...

    so simplified!

    work alarm says i am armed then send that to a virtual device at home but without plain text password etc

    thank you
    website | buy now | support | youtube

    Comment


    • #3
      Originally posted by rjh View Post
      If you are doing a POST or a GET to the MyHS server you are using HTTPS (SSL) and all the data is already encrypted. Do I misunderstand what you are trying to do? SSL encrypts both the data and the URL.
      I am trying to do this remotely from work to home but i cannot get it to talk to the right server as i have two listed on myhs

      Could you provide example of changing value in device 1234 for example if it was server #2 on myhs list

      Comment


      • #4
        The HS server is chosen by the login. So if you want to just send a command to your HS server with login "joe", password "1234", you can do this:


        Code:
        https://connected2.homeseer.com/JSON?request=controldevicebylabel&ref=###&label=ON&user=joe&pass=1234
        Where ### is the reference # of the device you want to control and the label is the control string you want to send. You can get the control strings from the "Status/Graphics" tab in the device properties. You can get the device reference # from the Advanced tab.

        USER and PASS are the username and password for the HS system you want to connect to. Note that if you have a premium account you can create multiple users, make sure that each user is set to access only ONE system, otherwise the call will fail.

        There are some other JSON commands you can use if you want to control a device by some other means, or maybe just trigger an event that does the work.

        Originally posted by deanrparry View Post
        I am trying to do this remotely from work to home but i cannot get it to talk to the right server as i have two listed on myhs

        Could you provide example of changing value in device 1234 for example if it was server #2 on myhs list
        website | buy now | support | youtube

        Comment


        • #5
          Originally posted by rjh View Post
          The HS server is chosen by the login. So if you want to just send a command to your HS server with login "joe", password "1234", you can do this:


          Code:
          https://connected2.homeseer.com/JSON?request=controldevicebylabel&ref=###&label=ON&user=joe&pass=1234
          Where ### is the reference # of the device you want to control and the label is the control string you want to send. You can get the control strings from the "Status/Graphics" tab in the device properties. You can get the device reference # from the Advanced tab.

          USER and PASS are the username and password for the HS system you want to connect to. Note that if you have a premium account you can create multiple users, make sure that each user is set to access only ONE system, otherwise the call will fail.

          There are some other JSON commands you can use if you want to control a device by some other means, or maybe just trigger an event that does the work.
          and my initial issue was same user multiple servers ;-) exactly as you suggested

          *** thank you kindly sir... i have it working from a browser but failing to get it to trigger on &hs.geturl() any advice?

          Comment


          • #6
            hs.GetURL was added in HS2 as the original .net did not offer a solution, but now you have a few options built into .net. Try:

            dim wc as new WebClient
            dim st as string = wc.DownloadString(url)

            Originally posted by deanrparry View Post
            and my initial issue was same user multiple servers ;-) exactly as you suggested

            *** thank you kindly sir... i have it working from a browser but failing to get it to trigger on &hs.geturl() any advice?
            website | buy now | support | youtube

            Comment


            • #7
              OK! Sussed it out thank you... not sure if it is right... but it works and it seems secure as its https

              Comment

              Working...
              X