Announcement

Collapse
No announcement yet.

JSON Calls Blocked - Example

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

  • JSON Calls Blocked - Example

    Continued from prior thread...

    Originally posted by alexbk66 View Post
    Can you please give me some example how to test it, so I can debug the problem. Again, should be really a separate thread....
    Here is an example of a JSON call that executes from SmartThings>webCORE>Homeseer via API call:

    Code:
    http://192.168.5.213:80/JSON?request=controldevicebyvalue&ref=3843&value=255
    That call is received by HS as reflected in the log:

    Click image for larger version

Name:	log.png
Views:	13
Size:	111.9 KB
ID:	1290525

    But the device does not update as seen here:


    Click image for larger version

Name:	officemotion.png
Views:	7
Size:	88.4 KB
ID:	1290526

    The device still shows ownership by the plugin:

    Click image for larger version

Name:	advancedtab.png
Views:	7
Size:	49.8 KB
ID:	1290527

    Here are additional details:

    Click image for larger version

Name:	advanceddetail.png
Views:	7
Size:	66.6 KB
ID:	1290528

    Note: At the time of the above screenshots, the plugin had been disabled and uninstalled.

    Let me know if you need additional details.

    Thanks,

    --Barry

  • #2
    I ran the utility you posted in the other thread and that did release the interface on the 2 orphaned devices. Thanks!

    FYI, I had to run the utility 3 or 4 times to finally get the interface released on both devices. After the first 2 runs I got this result on one of the devices (Again, this is with the plugin uninstalled):

    Click image for larger version

Name:	6008a.png
Views:	9
Size:	38.4 KB
ID:	1290532
    The above tab wasn't there prior to running the utility. After running the utility again, it went away.

    I do notice PED data is still left on each previously orphaned devices:

    Click image for larger version  Name:	6008c.png Views:	1 Size:	37.3 KB ID:	1290531

    I'm not sure if the PED data and count will interfere with any other plugin (my guess is no), but wanted you to be aware just in case.

    Thanks,

    --Barry

    Comment


    • #3
      Thank you Barry londajm , I'll play with JSON. But you said that it didn't work even when the plugin was still enabled? Are you sure?

      Comment


      • #4
        The screenshot above AK PCUtils tabs comes form the util I sent you, when you stop it - the tab will disappear. And PED named data doesn't hurt.

        And regarding assigning device interface to my plugin - as I said, I will change it in the next version. It's more convenient in source code - if HS thinks that device is owned by the plugin. But it's possible also to enable HSEvent callback for devices not owned by the plugin, just a bit more hustle as HS triggers the callback for every device, unfortunately it's not possible to subscribe to particular devices only.

        Comment


        • #5
          Originally posted by alexbk66 View Post
          Thank you Barry londajm , I'll play with JSON. But you said that it didn't work even when the plugin was still enabled? Are you sure?
          Yes, I'm pretty sure. When I noticed the JSON calls weren't working, the device was already orphaned. (Not sure if that makes a difference, but I think it does.) I then disabled the plugin, uninstalled and then reinstalled to attempt to get the plugin to find the orphaned devices (which didn't work).

          --Barry

          Comment


          • #6
            Originally posted by logman View Post
            When I noticed the JSON calls weren't working, the device was already orphaned. I then disabled the plugin, uninstalled and then reinstalled to attempt to get the plugin to find the orphaned devices (which didn't work).
            But what do you mean "the device was already orphaned"? If plugin was running and the device interface was set to the plugin - it means it was not orphaned?

            Of course if device interface is set to the plugin which is disabled - then CAPI tries to call SetIOMulti in the plugin which doesn't exist anymore. Which is wrong IMHO, but that's the current HS behaviour.

            Comment


            • #7
              Originally posted by alexbk66 View Post
              But what do you mean "the device was already orphaned"? If plugin was running and the device interface was set to the plugin - it means it was not orphaned?

              Of course if device interface is set to the plugin which is disabled - then CAPI tries to call SetIOMulti in the plugin which doesn't exist anymore. Which is wrong IMHO, but that's the current HS behaviour.
              What I mean by orphaned is that the interface was set to the plugin (which was running), but the device did not show up under "My Devices" in the configuration tab of the plugin. There was no way to "release" the device because it wasn't showing as being owned in the UI. I still have no idea what caused that, but I suspect it might be related to making a JSON call to a virtual device.

              --Barry

              Comment


              • #8
                I tested - it works as expected. If plugin is enabled - JSON calls work. If plugin disabled and device interface is set to AK Smart Device - CAPI calls don't work as HS if waiting for the plugin to confirm the setting.

                I fixed my code though so it works without assigning the interface to the device, it's just a bit more hustle as HS triggers "value changed" event for every device, there's no way to register for particular devices. Will be available in the next version.

                Comment

                Working...
                X