Welcome to the Web API documentation πŸ‘‹
🌍 Learn how to build great integrations.
The Homey Web API is a HTTP + Socket.IO API to control devices, manage Flows etc. It is used by Athom for the Homey Mobile App, Homey Web App, Alexa, Google Assistant etc.
The Web API is also used by HomeyScript and apps using the homey:manager:api permission. Learn more »​
The Web API is not yet available to the public.
Does your company have a great idea for an app? Contact us to request a Web API key.

Local Development

While the Web API is not yet available, you can use these API Credentials to test your project locally.
Key
Value
Client ID
5a8d4ca6eb9f7a2c9d6ccf6d
Client Secret
e3ace394af9f615857ceaa61b053f966ddcfb12a
Callback URL
http://localhost, http://localhost/oauth2/callback
Scopes
homey
It is not allowed to use these credentials for commercial or non-development purposes.

Example

1
const AthomCloudAPI = require('homey-api/lib/AthomCloudAPI');
2
​
3
// Create a Cloud API instance
4
const cloudApi = new AthomCloudAPI({
5
clientId: '...',
6
clientSecret: '...',
7
});
8
​
9
// Get the logged in user
10
const user = await cloudApi.getAuthenticatedUser();
11
​
12
// Get the first Homey of the logged in user
13
const homey = await user.getFirstHomey();
14
​
15
// Create a session on this Homey
16
const homeyApi = await homey.authenticate();
17
​
18
// Loop all devices
19
const devices = await homeyApi.devices.getDevices();
20
for(const device of Object.values(devices)) {
21
// Turn device on
22
await device.setCapabilityValue({ capabilityId: 'onoff', value: true });
23
}
Copied!

πŸ‘₯ Community

Last modified 4mo ago