Skip to content

Development

ctrlcmdshft edited this page May 17, 2026 · 1 revision

Development

There is no official documentation for the Hubspace consumer API. All functionality here was gained by experimenting with real devices and observing API responses.

Local setup

git clone https://github.com/ctrlcmdshft/homebridge-hubspace-platform.git
cd homebridge-hubspace-platform
npm install
npm run build    # compile once
npm run watch    # recompile on save
npm test         # run tests

Authentication

Hubspace uses Keycloak for auth. To obtain a token manually, POST to:

https://accounts.hubspaceconnect.com/auth/realms/thd/protocol/openid-connect/token

with Content-Type: application/x-www-form-urlencoded and the body:

grant_type=password
client_id=hubspace_android
username=<your email>
password=<your password>
scope=openid offline_access

API endpoints

Authentication

POST https://accounts.hubspaceconnect.com/auth/realms/thd/protocol/openid-connect/token

Resolve account ID

GET https://api2.afero.net/v1/users/me

List all devices

GET https://semantics2.afero.net/v1/accounts/{accountId}/metadevices?expansions=state

Get device state

GET https://semantics2.afero.net/v1/accounts/{accountId}/metadevices/{deviceId}?expansions=state

Set device state

PUT https://semantics2.afero.net/v1/accounts/{accountId}/metadevices/{deviceId}/state

Exploring the API

Copy .env.example to .env, fill in your credentials, then run the discovery script:

USERNAME=you@example.com PASSWORD=yourpass node discover.mjs

This dumps the complete raw API response for all devices on your account — useful for inspecting field names and value formats when adding support for a new device.

Clone this wiki locally