MakerAPI: "devices/*" doesn't work via cloud mode

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

image

Sounds like something I should follow :stuck_out_tongue_winking_eye:

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

(C8 seems to be becoming a pain!)

Cloud URL's are working again on my C8... not sure about the cause or resolution?

If the “solution” occurred without a hub platform update, then you know what you can exclude from your list of possibilities.

Working fine for me on my C-8 Hub. :person_shrugging:

1 Like

did you do that last part?

Now, do the same thing with the "Get All Devices with Full Details" under Cloud URL's section and notice the result No response from hub

https://cloud.hubitat.com/api/CLOUD-TOKEN/apps/38/devices/*?access_token=ACCESS-TOKEN

image

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?

Ok, thanks for testing this!

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.

1 Like

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

1 Like

Can confirm this.

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.

3 Likes

@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

/* - okay with 30 devices

No response from hub for more than 58 devices

1 Like

If you use curl or wget, you can save the output to a file and see what the size of the file is.

1 Like

Tagging @bobbyD @gopher.ny

The following output from wget seems to confirm the idea that the issue @jpage4500 noticed results from a gateway timeout on cloud.hubitat.com:

Being a cloud gateway timeout, it occurs with all hub models, not just C-8. Hoping there is a simple solution for this .... :smiley:

2 Likes

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.

4 Likes

Don't know if this is possible, but one of the node-red applications I use (for the Weatherflow Tempest) transmits the data as CBOR from AWS.

Then I convert CBOR to JSON for my needs.