Announcement

Collapse
No announcement yet.

API setdeviceproperty doesn't trigger events nor updates Last Change time

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

    API setdeviceproperty doesn't trigger events nor updates Last Change time

    I'm using the API with setdeviceproperty to update Status on a handful of devices. I'm using setdeviceproperty because the device status in question are either Status only values or Status only devices, so you can't update them using controlbydevicelabel.

    After much splunking through the board, and trial and error, I ended up with the following:

    Code:
    2018-07-07 10:00:27,364 DEBUG: http://home.myhsserver.ca/JSON?&request=setdeviceproperty&ref=569&property=NewDevValue&value=0
    2018-07-07 10:00:28,384 DEBUG: http://home.myhsserver.ca/JSON?&request=setdeviceproperty&ref=569&property=ChangedValueORString&value=TRUE
    This works to update the Status value and Status string, and HS3Touch appropriately updates and picks up the status change.

    HOWEVER, I have events that need to trigger off of the status change, and they aren't triggering. I also notice that the Last Change time for the device isn't getting updated with the above code - I don't know if that's a symptom or a cause, but thought I'd raise it in case it is relevant.

    So basically, does anyone know how to get the above to also trigger event's that trigger off that status, or if Last Changed time is the issue anyone know how to force the API to update the last Changed time for the device?

    regards,

    Paul

    #2
    I have the same issue with JSON setdeviceproperty. It seems like that call only changes the display but does not initiate any of the underlying handlers in HS.

    I think JSON controldevicebyvalue would be more appropriate to use in this case, HOWEVER that only seems to work for a device that that has a value of type "control". When I use it for a device that has a value of type "status" I get the following JSON error:
    { "Response":"Error, controlling device, value not found" } I hope there is a way to solve this. TJ

    Comment


      #3
      rjh This is a very frustrsting bug. I think this has been here since a long time now

      Comment


        #4
        I am not sure we are going to change this. You are changing an actual property on the device class itself which means you are bypassing our API. When you go through the API other things happen and I don't want to run those just because a property is set. You should use "hs.setdevicevalue" to change a device. You should be using the json call:

        Code:
        /JSON?request=controldevicebyvalue&ref=###&value=#
        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

        Comment


          #5
          Thank you Rich,

          But how can we change a value of a non-control device by the json api?


          Is there a simple way to do this?

          Thank you

          Comment


            #6
            There is actually another discussion on this and I answered here:

            https://forums.homeseer.com/forum/ul...34#post1283834

            Originally posted by MattL0 View Post
            Thank you Rich,

            But how can we change a value of a non-control device by the json api?


            Is there a simple way to do this?

            Thank you
            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

            Comment


              #7
              Originally posted by TjTrolinger View Post
              I have the same issue with JSON setdeviceproperty. It seems like that call only changes the display but does not initiate any of the underlying handlers in HS.

              I think JSON controldevicebyvalue would be more appropriate to use in this case, HOWEVER that only seems to work for a device that that has a value of type "control". When I use it for a device that has a value of type "status" I get the following JSON error:
              { "Response":"Error, controlling device, value not found" } I hope there is a way to solve this. TJ
              I'm having the exact same problem. Whenever I set a device value of 0 or 100 it works but anything in between:
              Code:
               { "Response":"Error, controlling device, value not found" }

              Comment


                #8
                Originally posted by DJF3 View Post

                I'm having the exact same problem. Whenever I set a device value of 0 or 100 it works but anything in between:
                Code:
                 { "Response":"Error, controlling device, value not found" }
                You need to set the device to accept value in the range of 0 to 100 in the device property page of your device.

                I assume 0 and 100 are set for now as unique value , and nothing in between
                Attached Files

                Comment

                Working...
                X