Announcement

Collapse
No announcement yet.

JSON with Tasker knowledge

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

    JSON with Tasker knowledge

    I'm using Tasker and HTTP Get with the JSOn command to get a status of the device as of Server Port: http://192.168.0.17:8017
    Path: JSON?user=aaaaaaaa&pass=xxxxxxxx&request=getstatus&ref=2249

    What would the next command to get the status of the device in the "Flash" command. I'm not 100% sure but before I upgraded to HS3, I think I was able to get the status of it using the javaScriptlet.

    #2
    Should be something like the following javaScriptlet:

    Code:
    var status = JSON.parse(local('http_data')).Devices[0].status;
    setGlobal("%Status", status);
    var value = JSON.parse(local('http_data')).Devices[0].value;
    setGlobal("%Value", value);

    Then you can use Tasker variables %Status and %Value as needed.
    Len


    HomeSeer Version: HS3 Pro Edition 3.0.0.435
    Linux version: Linux homeseer Ubuntu 16.04 x86_64
    Number of Devices: 633
    Number of Events: 773

    Enabled Plug-Ins
    2.0.54.0: BLBackup
    2.0.40.0: BLLAN
    3.0.0.48: EasyTrigger
    30.0.0.36: RFXCOM
    3.0.6.2: SDJ-Health
    3.0.0.87: weatherXML
    3.0.1.190: Z-Wave

    Comment


      #3
      I'm sure I'm missing something stupid, unfortunately the flash %status return %status, I know the http get before the javascriptlet is working fine because when I put the flash text %HTTPD it returns the entire device structure. Thank you for your help.
      Attached Files

      Comment


        #4
        Case is important with Tasker variables.

        First letter should be uppercase as bolded below.
        setGlobal("%Status", status);
        Len


        HomeSeer Version: HS3 Pro Edition 3.0.0.435
        Linux version: Linux homeseer Ubuntu 16.04 x86_64
        Number of Devices: 633
        Number of Events: 773

        Enabled Plug-Ins
        2.0.54.0: BLBackup
        2.0.40.0: BLLAN
        3.0.0.48: EasyTrigger
        30.0.0.36: RFXCOM
        3.0.6.2: SDJ-Health
        3.0.0.87: weatherXML
        3.0.1.190: Z-Wave

        Comment


          #5
          Click image for larger version

Name:	Screenshot_20201211-145901_Tasker.jpg
Views:	348
Size:	66.5 KB
ID:	1440074

          Click image for larger version

Name:	Screenshot_20201211-145921_Tasker.jpg
Views:	322
Size:	26.1 KB
ID:	1440075
          Len


          HomeSeer Version: HS3 Pro Edition 3.0.0.435
          Linux version: Linux homeseer Ubuntu 16.04 x86_64
          Number of Devices: 633
          Number of Events: 773

          Enabled Plug-Ins
          2.0.54.0: BLBackup
          2.0.40.0: BLLAN
          3.0.0.48: EasyTrigger
          30.0.0.36: RFXCOM
          3.0.6.2: SDJ-Health
          3.0.0.87: weatherXML
          3.0.1.190: Z-Wave

          Comment


            #6
            Sorry to bug you more with this, I changed it as well with different settings, still getting the same results. Here all all my screenshots, I know the first query works 100%. Sue to the user and password, I included the query here

            HTTP Get
            Server Port https://connected.homeseer.com
            Path
            JSON?user=xxxxxx&pass=xxxxx&request=getstatus&ref=2187

            Thank you
            Attached Files

            Comment


              #7
              That looks correct. Try adding a new step after your first action to flash the contents of %http_data to confirm

              Click image for larger version

Name:	20201213_010233.jpg
Views:	271
Size:	80.5 KB
ID:	1440332
              Len


              HomeSeer Version: HS3 Pro Edition 3.0.0.435
              Linux version: Linux homeseer Ubuntu 16.04 x86_64
              Number of Devices: 633
              Number of Events: 773

              Enabled Plug-Ins
              2.0.54.0: BLBackup
              2.0.40.0: BLLAN
              3.0.0.48: EasyTrigger
              30.0.0.36: RFXCOM
              3.0.6.2: SDJ-Health
              3.0.0.87: weatherXML
              3.0.1.190: Z-Wave

              Comment


                #8
                Thank you again, I think I have it figured out, I was using http get instead of request, could you please post the first statement of your http request?

                Thanks

                Sent from my SM-G973U1 using Tapatalk

                Comment


                  #9
                  Originally posted by alphatech View Post
                  could you please post the first statement of your http request?

                  Thanks

                  Sent from my SM-G973U1 using Tapatalk
                  Sure. Here it is.
                  Click image for larger version

Name:	Screenshot_20201213-140721_Tasker.jpg
Views:	264
Size:	44.8 KB
ID:	1440456
                  Len


                  HomeSeer Version: HS3 Pro Edition 3.0.0.435
                  Linux version: Linux homeseer Ubuntu 16.04 x86_64
                  Number of Devices: 633
                  Number of Events: 773

                  Enabled Plug-Ins
                  2.0.54.0: BLBackup
                  2.0.40.0: BLLAN
                  3.0.0.48: EasyTrigger
                  30.0.0.36: RFXCOM
                  3.0.6.2: SDJ-Health
                  3.0.0.87: weatherXML
                  3.0.1.190: Z-Wave

                  Comment


                    #10
                    From within the network, that worked great, thank you. How would I do the query that uses connect2 from outside my network using user name and password?

                    Sent from my SM-G973U1 using Tapatalk

                    Comment


                      #11
                      Actually I got it, I was looking at your exemple and I figured it out. Thank you again for all your help.


                      Sent from my SM-G973U1 using Tapatalk

                      Comment


                        #12
                        You are welcome! Glad you got it working.
                        Len


                        HomeSeer Version: HS3 Pro Edition 3.0.0.435
                        Linux version: Linux homeseer Ubuntu 16.04 x86_64
                        Number of Devices: 633
                        Number of Events: 773

                        Enabled Plug-Ins
                        2.0.54.0: BLBackup
                        2.0.40.0: BLLAN
                        3.0.0.48: EasyTrigger
                        30.0.0.36: RFXCOM
                        3.0.6.2: SDJ-Health
                        3.0.0.87: weatherXML
                        3.0.1.190: Z-Wave

                        Comment

                        Working...
                        X