I'm looking to improve the performance of my dashboard app in cloud mode. Today, I fetch all devices via MakerAPI using the /devices/ endpoint and then fetch individual device details.
I don't use the /devices/all endpoint because of it's slow speed as noted in several places including this one
I remembered there's an undocumented endpoint /devices/* which is a lot faster. I found out about it from this post:
I figured it could be helpful especially over cloud mode. But, while it works great locally it doesn't return anything over the cloud endpoint. Is this something that can be fixed?
TO REPRODUCE:
open MakerAPI
click on "Get All Devices with Full Details" under the Local URL's section
replace the "/all" with "/*" in the URL and re-submit
NOTE: the above steps should work fine..
Now, do the same thing but with the link under Cloud URL's section
in my case "Get All Devices with Full Details" works but replacing /all with /* results in No response from hub
I have done a test using the Maker API app on both of my hubs, C8 (2.3.5.146) and C7 (2.3.5.146).
I have created new instances of the Maker API app on both hubs.
Result when I click on Get All Devices:
C8 - "No response from hub" - not working
C7 - all device details are populated - working fine
I just did (local and cloud access for devices/*). Works fine on my C-8 hub.
Can I ask if your hub's connection to Hubitat's cloud is currently working? Like there are no DNS issues or something that are interfering with cloud access?
I imagine the only difference between local and cloud mode for these API's are that the cloud mode requests are going through Hubitat's cloud service which fwd's requests to your hub.
My best guess is there's some short timeout period when making cloud API requests and if a response isn't returned by X seconds, it'll return "No response from hub"
For whatever reason, the cloud API /devices/all has always worked for me (C-7 Hub) and the /devices/* has never worked for me. I've got ~60 devices that are connected via MakerAPI. The ironic thing is the /devices/* request returns MUCH faster so that doesn't quite make sense to me.
However, from logs I've gotten from users of my dashboard app, HD+, it seems a lot more users can't even access /devices/all without getting that 'no response from hub'
Another cloud API /devices/ has always seemed to work for any user/hub. This one returns the least amount of info though which requires a lot more additional API requests (1 for each device returned) which is why I'd love to replace it.
Anyway, all of these requests seem to work just fine when run locally - sans cloud.
Long-story short I'd just like to figure out what works consistently and what doesn't so I can write an app that will work for everyone.
The only other thing I can think of is maybe there's some limit to how much data can be returned via the cloud API's.. maybe it can only handle so much and anything more results in "No response from hub"...
I did a quick test using local endpoints: /devices/all returns 63k /devices/* returns 123k
I guess for anyone who can reproduce the issue above - via either of the endpoints -- maybe look at how large the responses are (using the local version of the endpoints) and that might explain what's going on
The MakerAPI instance I tried earlier had about 50 devices and worked perfectly.
To test your idea, I created a new MakerAPI instance with 176 devices. And I can reproduce the cloud issue. In this instance, downloading 152 kb over the cloud connection causes a failure, while it works fine locally.
@bobbyD@gopher.ny - is there someway to increase the timeout for cloud connections? As far as I can tell, the timeout occurs at the Hubitat cloud end, and not at the hub end.
@jpage4500, I believe I hijacked this thread previously with the remote access issue that I was having on the C8 with your HD+ app, this has now fixed itself.
I have done the above tests with the urls (not sure how to check size of data?), and confirm the following:
Local - no issues /devices/all no issues with 103 devices /devices/* no issues with 103 devices
Cloud - no issues with /all /devices/all no issues with 103 devices or 58 devices that I use with your HD+ app /devices/* working for about 30 devices /devices/* "no response from hub" for 58 / 103 devices
There is a limit. I have a task to implement compression (and thus raise the limit) on my to do list, but the limit itself is imposed by AWS MQTT implementation. Right now, it is 128k max, and there is no workaround.