Athom Homey Developer Portal - API Example

Welcome to the Homey Developer API

This example page demonstrates how to use the Homey API to interact with devices and create automation flows.

Retrieving Devices

Here's an example of how to retrieve a list of devices using our API:


GET https://api.athom.com/api/v1/devices
Authorization: Bearer {your_access_token}
      

Connected Devices

💡
Living Room Lamp
On
🌡️
Thermostat
21°C
🚪
Front Door
Locked
📺
Smart TV
Standby

Flow Editor

[A visual flow editor would be displayed here for creating automation rules]

Creating a Flow

To create a new automation flow:


POST https://api.athom.com/api/v1/flows
Authorization: Bearer {your_access_token}
Content-Type: application/json

{
  "name": "Evening Routine",
  "trigger": {
    "type": "time",
    "time": "19:00"
  },
  "actions": [
    {
      "type": "device",
      "uri": "homey:device:living-room-lamp",
      "action": "turnOn"
    },
    {
      "type": "device",
      "uri": "homey:device:thermostat",
      "action": "setTemperature",
      "args": { "temperature": 20 }
    }
  ]
}
      

Note: This is a simulated example. In a real implementation, you would need to authenticate and use actual device IDs and access tokens.

Integrating with Homey

With the Homey API, you can create powerful integrations and applications. Some popular use cases include:

Realtime Events

Subscribe to realtime events using WebSockets:


const socket = new WebSocket('wss://api.athom.com/realtime');
socket.onopen = () => {
  socket.send(JSON.stringify({
    type: 'authenticate',
    access_token: '{your_access_token}'
  }));
};
socket.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log('Received event:', data);
};
      

Ready to start building with Homey?

Get API Access