Announcement

Collapse
No announcement yet.

Set STATUS via JSON

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

    Set STATUS via JSON

    Is it possible to set the status text via a JSON call?

    I have a number of virtual devices used to show power such as voltage, current and wattage. These would be set from an external device on the same network.

    Looking at the online help for development, I can't find any command that would allow me to do this.

    I am looking at the plugin development to see if I need to it from there but if I could do this via an HTTP request it would simplify the development.

    #2
    I set my solar battery voltage, current, and battery temperature from an application on my network. Here's the battery:

    Code:
    http://192.168.0.6:80/JSON?request=controldevicebyvalue&ref=1253&value=12.78
    set ref= to the referenceID of the virtual device.

    This will set the device value. With the configuration below, it will display as indicated.

    Unfortunately I can't do anything about the drop-down box being displayed on the device, it needs to be set as a controlled device in order for the JSON command to not fail (set Status-Control to 'both').
    Attached Files
    Mike

    Comment


      #3
      Thanks for the information. I know have it working. Took a bit though as I still had the STATUS ONLY checked but once this was removed I now have it working.

      I was a bit skeptical about switching to HS3 with all the work needed to get it up and running but the last few days have made it worth the work. With a recent Amazon Echo purchase I know have voice activation.

      Cheers.
      Dave...

      Comment


        #4
        Is it possible to pass a variable to a JSON command? Something like temp1=HS.devicevalue(123)...........ref=(temp1)

        Steve Q


        Sent from my iPod touch using Tapatalk
        HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
        2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

        Comment


          #5
          Originally posted by Steve Q View Post
          Is it possible to pass a variable to a JSON command? Something like temp1=HS.devicevalue(123)...........ref=(temp1)

          Steve Q


          Sent from my iPod touch using Tapatalk
          You can set a devices value from a JSON command so you could pass in a value from elsewhere? Or do you want to get data out from HS?

          Comment


            #6
            I have 2 computers running HS3. My TEMP08 is on machine A. I would like to pass the temperature to machine B via JSON.


            Sent from my iPod touch using Tapatalk
            HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
            2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

            Comment


              #7
              Currently, I am writing the temperatures from machine A to a text file every 30 minutes. I then read them from the file into machine B. JSON would be a bit easier?


              Sent from my iPod touch using Tapatalk
              HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
              2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

              Comment


                #8
                You could virtually eliminate the reading on machine B if you wanted, if you ran a script on machine A to do a HTTP POST to machine B to set the device value then you could do everything you needed from there. http://homeseer.com/support/homeseer..._with_json.htm - see the bottom of the page.

                Comment


                  #9
                  The JSON POST function is exactly what I need. I did a search and found some examples of how to use it in a vbscript. It looks pretty complicated but I will try to get something working. I find it always difficult to get the syntax right!

                  Steve Q


                  Sent from my iPad using Tapatalk HD
                  HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
                  2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

                  Comment


                    #10
                    I can't quite get the POST to work with hs.URLAction, it keeps saying that it has invalid data for some reason.

                    You could do a GET just as easily and likely to behave the same - I don't know if there is an advantage/disadvantage in this situation. This works;

                    Code:
                    Sub Main(ByVal Parm As Object)
                            hs.URLAction("http://192.168.1.150/JSON?request=controldevicebyvalue&ref=289&value=100", "GET", "", "")
                    End Sub
                    And you would just change your ref and value to suit you...

                    Comment


                      #11
                      Thanks, I'll try it this evening


                      Sent from my iPod touch using Tapatalk
                      HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
                      2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

                      Comment


                        #12
                        I'm confused about the inclusion of "value" in the GET statement for JSON. The device value is what I am trying to retrieve. In your example, what is returned by the URLAction function?

                        Steve Q


                        Sent from my iPad using Tapatalk HD
                        HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
                        2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

                        Comment


                          #13
                          Oh right I thought you wanted to set a device value - if you are trying to retrieve a value then matters get a bit more complex and you would need to look at the request=getstatus and then digging out the value from in the return batch of data - not the most straightforward really. Other option would be to make your own ASP/ASPX file that sat on the web server, accepted the device reference in by URL and then gave you the data back out.

                          In that example above you will get a load of information back about the device - that could help but there is all sorts of data in there.

                          Comment


                            #14
                            I am not able to get JSON POST or GET commands to work from a vbscript. However, after much trial and error, I was able to incorporate a variable into a normal JASON request command. I am now able to send temperatures from my TEMP08 on HS2 directly to HS3.

                            Steve Q


                            Sent from my iPad using Tapatalk HD
                            HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
                            2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

                            Comment

                            Working...
                            X