Announcement

Collapse
No announcement yet.

XML HTTP RESTful API for HS3 - Discussion Thread

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

    #76
    Anyone got a line on this item? Would like to have icons represent the status (on/off), be able to tap them to change the status which would update Homeseer. I can write an event that will run a script to toggle the status so I can get basic on/off functionality now but the status reporting would be good. Would also like to poll variables and display the content.

    Comment


      #77
      Hate to keep posting the question but does anyone have an idea on how to implement the above? My office tablet runs a music visualizer and some widgets which I would hate to lose to have HSTouch running. Also I use Airbubble and would have to give that up for the HSTouch speaking event. I hear there is a way to have an android widget that will display a web page, maybe the answer is that and a custom page to display the items in question but that is exceeding my abilities (might play around with the HS3 Page builder by JON00)

      Comment


        #78
        Toggling in Tasker

        [QUOTE=kideon;1126273]Is there a way to use this to toggle status with tasker? I know it can be used t trigger events and the solution there would be to create two events and then act based on present status then a third to trigger both but that's kind of kludgy.


        It appears you've moved past this question to a more complex solution, but I thought I'd share how I got device toggle working in Tasker.

        First off, my goal was to create toggles for my entertainment center and a few lights so they could be controlled by my new Android Wear smartwatch. I'm using Trigger on the watch to activate a Tasker task which sends an HTTP Get to the RESTful API to interface with HS3. It's working just as planned after 2-3 hours of tinkering.

        I've seen a few posts from people who are taking a more complex approach, but my programming skills being what they are (I generally learn as I go ) I just took a logical approach in Tasker.

        Since the latest version of the API adds the option to get current device status using (getdevicestatusvaluebyid), all I needed was an if-else to change the status. If the device is currently off, turn it on. Else turn it off. Easy, right? The problem I ran into was getting the device status into a variable. Tasker documentation claims the return value from an HTTP Get should be stored in HTTPR, but I was having trouble accessing it. So what I did to work around it was to store the return from the getdevicestatusvaluebyid call in an Output file. I then used READ FILE to transfer the value stored there into a variable (%Status in my case).

        This introduced another problem, as the data saved in the file includes a trailing carriage return. To fix this, I run Variable Split on the new variable. I then used %Status1 as the test in my If-Else. If %Status1 matches on then turn light off, else turn light on.

        As usual, I'm already coming up with ways to improve my work, but so far just the option of controlling things from my Android Wear device is pretty sweet. I hope this if this is no longer helpful to you, then at least someone else can avoid a bunch of trial and error, or having to reinvent the wheel.

        WeaslyD

        Comment


          #79
          I have a problem with the API being in response. Sometimes it takes a second of ten before an event is triggered or a device is toggled. I tried to use jonoo aspx loader. But it doesn't help. Do you guys experience this as well?

          Verstuurd vanaf mijn Nexus 5 met Tapatalk

          Comment


            #80
            Originally posted by Phaeton View Post
            I have a problem with the API being in response. Sometimes it takes a second of ten before an event is triggered or a device is toggled. I tried to use jonoo aspx loader. But it doesn't help. Do you guys experience this as well?

            Verstuurd vanaf mijn Nexus 5 met Tapatalk

            Indeed, I experience the same delay issues. Sometimes the command is executed instantly, other times there is a delay of several seconds before a change occurs. I'm not sure which component to attribute the delay to, so troubleshooting will be a pain.

            WeaslyD

            Comment


              #81
              Use with Tasker

              Hello! I have a pretty straight forward question for you whiz people I currently want to use a post command from Android Tasker for NFC tag use. Could anyone explain how I would go about doing this.

              http://User:Pass@MyIP:Port/HomeSeer_...1=56&param2=on

              the above code works perfectly in the browser but i cant figure out how to get it into tasker. the fields available are

              SERVER:PORT
              PATH
              DATA/FILE
              COOKIES
              USER AGENT
              CONTENT TYPE
              OUTPUT FILE

              Thanks!!!

              Comment


                #82
                Originally posted by weaslyd View Post
                Indeed, I experience the same delay issues. Sometimes the command is executed instantly, other times there is a delay of several seconds before a change occurs. I'm not sure which component to attribute the delay to, so troubleshooting will be a pain.

                WeaslyD
                I don't think it's related to a specific device or event. I did some testing and it look like it occurs randomly. I think it's related to the fact that homeseer has to to compile the aspx page through which we give a command to homeseer. That's what I read somewhere here. Maybe redtechie can help us find a sollution?

                Verstuurd vanaf mijn Nexus 5 met Tapatalk

                Comment


                  #83
                  Anyone tried or been successful getting this to work hosted on a Zee? That is all I have, and this is exactly what I would like to be able to do.

                  Comment


                    #84
                    Originally posted by Phaeton View Post
                    I have a problem with the API being in response. Sometimes it takes a second of ten before an event is triggered or a device is toggled. I tried to use jonoo aspx loader. But it doesn't help. Do you guys experience this as well?

                    Verstuurd vanaf mijn Nexus 5 met Tapatalk
                    Yeah, to be honest I have seen this issue as well with my Adobe Air/PHP based desktop widget. It seems like it starts lagging after sending a number of commands to Homeseer over a period of time. The one way I know of clearing the lag is restarting homeseer.

                    I am not 100% sure at this point what is causing it so rather not point fingers. But I believe it is the backend HS API Controls I am calling. As all my script does is essentially wrap them in a pretty container that makes them accessible via simple URL calls. It could also be something with the embedded IIS server (web core) they are using in HS3, but then again I never really see the HS3 control panel lag....

                    Comment


                      #85
                      Version 1.2.0 Released!

                      Alright! Sorry for the long wait but the additions Gear added have now been released as version 1.2.0 on the official release thread located here: http://board.homeseer.com/showthread.php?t=163200

                      Version 1.2.0
                      • This version is a community based update with large contributions from the user 'Geer/Gear'
                      • New Set Device Value by Name (Recommended for non light fixtures)
                      • New Set Device Value by ID (Recommended for non light fixtures)
                      • "GetDeviceStatusValueByName" and "GetDeviceStatusValueByID" should now allow getting and setting of the status of a device which doesn't have defined controls
                      • Additional HS logging added to a few functions


                      Enjoy!

                      Comment


                        #86
                        Thanks for the email as well. I honk I can get the file uploaded to Zee, but it can't be an IIS backend, so we'll see.


                        Sent from my iPhone using Tapatalk

                        Comment


                          #87
                          Originally posted by TechFan View Post
                          Thanks for the email as well. I honk I can get the file uploaded to Zee, but it can't be an IIS backend, so we'll see.


                          Sent from my iPhone using Tapatalk
                          I think you will be out of luck. Even the most simple ASPX pages will take several minutes to compile on a Zee...anything else will normally time out.

                          From the Zee FAQ:

                          Q: Is ASP.NET supported?
                          A: No, while it may run, it is too slow to be usable so it is not supported.
                          Jon

                          Comment


                            #88
                            Another annoying thing about the Zee. If the http call functionality was just core, I guess it wouldn't matter, but this is frustrating. I guess I really should test out the Mi Casa Verde I have had sitting here under my desk. Sounds like this functionality is core in that product.

                            Comment


                              #89
                              Originally posted by RedTechie View Post
                              Alright! Sorry for the long wait but the additions Gear added have now been released as version 1.2.0 on the official release thread located here: http://board.homeseer.com/showthread.php?t=163200

                              Version 1.2.0
                              • This version is a community based update with large contributions from the user 'Geer/Gear'
                              • New Set Device Value by Name (Recommended for non light fixtures)
                              • New Set Device Value by ID (Recommended for non light fixtures)
                              • "GetDeviceStatusValueByName" and "GetDeviceStatusValueByID" should now allow getting and setting of the status of a device which doesn't have defined controls
                              • Additional HS logging added to a few functions


                              Enjoy!
                              Sorry, sent you a PM before reading that I could post in this thread.
                              Code:
                              RESTful-API	'(virtual virtual gs3 presence)' has no controls. Add some controls or set value directly.
                              Virtual devices give this problem, with a status of "All_Failed"
                              Is there anything we can do to get this to work?

                              Comment


                                #90
                                Originally posted by Furious View Post
                                Sorry, sent you a PM before reading that I could post in this thread.
                                Code:
                                RESTful-API	'(virtual virtual gs3 presence)' has no controls. Add some controls or set value directly.
                                Virtual devices give this problem, with a status of "All_Failed"
                                Is there anything we can do to get this to work?
                                Ok, even weirder.
                                The above function doesn't work at all. If I use SetDeviceByID, I can get it to work some of the time.....
                                Code:
                                Aug-16 22:55:08	 	RESTful-API	Device reference 149 has no controls. Add some controls or set value directly.
                                This gets logged as the code is checking for the leaf objects of the device, and the count is 1 or less:
                                foreach (HomeSeerAPI.CAPI.CAPIControl objCAPIControl in hs.CAPIGetControl(deviceRef))

                                For some reason, this can vary - so either something is not being instantiated right, or the CAPI side is fluctuating for the device.....?

                                Comment

                                Working...
                                X