REST access to findmyhub.hubitat.com

I am automating some stuff with Telegram bots, and I wonder if I can get the hubs' ips and names from https://findmyhub.hubitat.com/ programmatically. Just issuing a GET request doesn't work, I get We're sorry but portal.hubitat.com doesn't work properly without JavaScript enabled. Please enable it to continue.

I believe the short answer is "Not possible using FindMyHub"; however, you can likely obtain this info using Hub Information Driver (which can report its host hub's localIP as well as locationName) and Maker API (which affords you a REST-ful cloud endpoint thru which to extract device attributes). Assuming your consuming web app can then parse the needed string(s) from the reply, this should work, e.g.:


where deviceID 599 belongs to Hub Info Driver v3.

1 Like

It's kinda a chicken and an egg problem, since I need to know an IP of the hub to access it's Maker API. But what can work is assuming hubitat.local is the domain name for the hub with Maker API and then expecting the HID to be meshed to that hub. Maybe...

1 Like

You just made me realize that what I thought was a Cloud Endpoint in MakerAPI, is only a Local Endpoint for the "Attribute" feature, sorry:

I'm not sure why this distinction is being made in the API, but assume it has to do with hub security. If you try the same URL with cloud.hubitat.com instead, you receive this warning:
image

You should still be able to access Hub Info Driver via MakerAPI in the normal "Get Device Info" way, although this will return dozens of attributes more than you seek.

We can always try hubitat.local; chances are it will work.

You dont have a reserved IP set for the hubs such that you always know the IP of the hubs?

If you want to go the hostname route, In the hub settings you can change the mDNS name so that each hub is unique. Or you can also set a static hostname on the router (if it supports that).

1 Like

I do have a reserved IP. I am writing a TG bot and would prefer not to hardcode IPs.
In any way, accessing Maker API through hubitat.local and parsing Hub Information Drivers to find the rest of the hubs worked.

2 Likes