### Authentication and Device Interaction Example Source: https://athombv.github.io/node-homey-api/AthomCloudAPI.html Example demonstrating how to authenticate a user, retrieve their Homey devices, and control device capabilities. ```javascript const AthomCloudAPI = require('homey-api/lib/AthomCloudAPI'); // Create an AthomCloudAPI instance const cloudApi = new AthomCloudAPI({ clientId: 'YOUR_CLIENT_ID', clientSecret: 'YOUR_CLIENT_SECRET', redirectUrl: 'http://localhost', }); // Check if logged in, otherwise initiate authentication flow const loggedIn = await cloudApi.isLoggedIn(); if (!loggedIn) { if (cloudApi.hasAuthorizationCode()) { await cloudApi.authenticateWithAuthorizationCode(); } else { window.location.href = cloudApi.getLoginUrl(); return; } } // Get the authenticated user and their first Homey const user = await cloudApi.getAuthenticatedUser(); const homey = await user.getFirstHomey(); // Authenticate with the Homey const homeyApi = await homey.authenticate(); // Get all zones and devices const zones = await homeyApi.zones.getZones(); const devices = await homeyApi.devices.getDevices(); // Turn all devices on for(const device of Object.values(devices)) { await device.setCapabilityValue({ capabilityId: 'onoff', value: true, }); } ``` -------------------------------- ### Install app from App Store Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerApps.html Installs an application from the Homey App Store. ```APIDOC ## POST /api/manager/apps/store ### Description Installs an application from the Homey App Store. ### Method POST ### Endpoint /api/manager/apps/store ### Parameters #### Request Body - **id** (string) - Required - The unique identifier of the app to install. - **channel** (string) - Optional - The installation channel (e.g., 'stable', 'beta'). ### Request Example ```json { "id": "com.example.app", "channel": "stable" } ``` ### Response #### Success Response (200) - **result** (any) - Confirmation of the installation. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### installUpdate Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerUpdates.html Initiates the installation of an update. ```APIDOC ## installUpdate ### Description Initiates the installation of an update. ### Method POST ### Endpoint `/api/manager/updates/update` ### Parameters #### Request Body - **opts** (object) - Required - **reboot** (boolean) - Optional - **silent** (boolean) - Optional ### Scopes `homey.updates` ``` -------------------------------- ### requestInstallerAccess Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerUsers.html Requests installer access. ```APIDOC ## POST /api/manager/users/installer/request ### Description Requests installer access. ### Method POST ### Endpoint /api/manager/users/installer/request ### Parameters #### Request Body - **jwt** (string) - Required - The JWT for requesting access. ``` -------------------------------- ### Get all apps Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerApps.html Retrieves a list of all installed applications on Homey. ```APIDOC ## GET /api/manager/apps/app ### Description Retrieves a list of all installed applications on Homey. ### Method GET ### Endpoint /api/manager/apps/app ### Response #### Success Response (200) - **apps** (Object.) - An object where keys are app IDs and values are app information. #### Response Example ```json { "com.example.app": { "id": "com.example.app", "name": "Example App", "version": "1.0.0" } } ``` ``` -------------------------------- ### installApp Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerDevkit.html Installs an application on the Homey device. ```APIDOC ## POST /api/manager/devkit/app ### Description Installs an application on the Homey device. ### Method POST ### Endpoint /api/manager/devkit/app ### Scopes homey.app ### Parameters #### Request Body - **manifest** (object) - Required - The manifest of the app to install. - **clean** (boolean) - Optional - Whether to perform a clean installation. ``` -------------------------------- ### Install homey-api with npm Source: https://athombv.github.io/node-homey-api/index.html Install the homey-api package using npm for your Node.js project. ```bash npm install homey-api ``` -------------------------------- ### grantInstallerAccess Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerUsers.html Grants installer access. ```APIDOC ## POST /api/manager/users/installer/grant ### Description Grants installer access. ### Method POST ### Endpoint /api/manager/users/installer/grant ``` -------------------------------- ### getApps Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerApps.html Retrieves a list of all installed applications on Homey. ```APIDOC ## GET /api/manager/apps/app ### Description Retrieves a list of all installed applications on Homey. ### Method GET ### Endpoint /api/manager/apps/app ### Parameters (No parameters specified in the source) ### Response #### Success Response (200) - **Apps** (Object.) - An object where keys are app IDs and values are app details. ``` -------------------------------- ### getInstallerInformation Source: https://athombv.github.io/node-homey-api/AthomCloudAPI.html Retrieves installation information for a specific user, identified by their user ID. ```APIDOC ## GET /user/{userId}/installer-information ### Description Retrieves specific information related to the installation or setup for a given user. ### Method GET ### Endpoint `/user/{userId}/installer-information` ### Parameters #### Path Parameters * `userId` (string) - Required - The unique identifier of the user whose installer information is being requested. #### Query Parameters * None #### Request Body * None ### Request Example (No request body) ### Response #### Success Response (200) * An object containing the installer information for the specified user. #### Response Example ```json { "website": "https://example.com", "email": "user@example.com", "phone": "123-456-7890" } ``` ``` -------------------------------- ### installNodeAvailableFirmwareUpdate Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerMatter.html Installs an available firmware update for a Matter node. Requires 'homey.system.readonly' scope. ```APIDOC ## POST /api/manager/matter/node/:id/firmware-update ### Description Installs an available firmware update for a specified Matter node. ### Method POST ### Endpoint /api/manager/matter/node/:id/firmware-update ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the Matter node. #### Request Body - **softwareVersion** (number) - Required - The version of the software to install. ``` -------------------------------- ### abortInstallUpdate Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerUpdates.html Aborts the currently installing update. ```APIDOC ## abortInstallUpdate ### Description Aborts the currently installing update. ### Method DELETE ### Endpoint `/api/manager/updates/update` ``` -------------------------------- ### get Source: https://athombv.github.io/node-homey-api/HomeyAPIV3.ManagerApps.App.html Make a GET request to the App's Web API. ```APIDOC ### get (async) get(opts): Promise. Make a GET request to the App's Web API. #### Parameters Name | Type | Description ---|---|--- `opts` | object | `path` | string | #### Returns Promise. ``` -------------------------------- ### Create Local API Instance and Get Devices Source: https://athombv.github.io/node-homey-api/HomeyAPI.html This method creates a HomeyAPIV3Local instance for use in a project, requiring the Homey's address and a Personal Access Token. It then fetches all devices. ```javascript import { HomeyAPI } from 'homey-api'; const homeyApi = await HomeyAPI.createLocalAPI({ address: 'http://192.169.1.123', token: '', }); const devices = await homeyApi.devices.getDevices(); ``` -------------------------------- ### Get a specific app Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerApps.html Retrieves detailed information about a specific application installed on Homey. ```APIDOC ## GET /api/manager/apps/app/:id ### Description Retrieves detailed information about a specific application installed on Homey. ### Method GET ### Endpoint /api/manager/apps/app/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the app. #### Request Example ```json { "id": "com.example.app" } ``` ### Response #### Success Response (200) - **app** (HomeyAPIV3Cloud.ManagerApps.App) - Information about the app. #### Response Example ```json { "id": "com.example.app", "name": "Example App", "version": "1.0.0" } ``` ``` -------------------------------- ### get Source: https://athombv.github.io/node-homey-api/AthomCloudAPI.StorageAdapterBrowser.html Retrieves data from local storage. ```APIDOC ## get ### Description Retrieves data from local storage. ### Method `get(): Promise` ### Returns - `Promise`: A promise that resolves with the retrieved data. ``` -------------------------------- ### swapOwnerInstaller Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerUsers.html Swaps the owner installer for a user. This operation requires specific permissions and should be used with caution. ```APIDOC ## POST /api/manager/users/installer/swap-owner ### Description Swaps the owner installer for a user. ### Method POST ### Endpoint /api/manager/users/installer/swap-owner ### Parameters #### Request Body - **newOwnerUserId** (string) - Required - The ID of the new owner user. - **jwt** (string) - Required - The JSON Web Token for authentication. ``` -------------------------------- ### get Method Source: https://athombv.github.io/node-homey-api/AthomCloudAPI.StorageAdapterMemory.html Retrieves data from the in-memory storage. ```APIDOC ## get() ### Description Retrieves data from the in-memory storage. ### Method (async) get ### Endpoint N/A ### Parameters None ### Returns Promise. - The stored data. ### Response Example ```json { "example": "stored data" } ``` ``` -------------------------------- ### Create App API Instance and Get Devices Source: https://athombv.github.io/node-homey-api/HomeyAPI.html Use this method within a Homey App to create an authenticated API instance. Ensure your app has the 'homey:manager:api' permission. It then retrieves and logs the names of all devices. ```javascript const { HomeyAPI } = require('homey-api'); module.exports = class MyApp extends Homey.App { async onInit() { // Create a HomeyAPI instance. Ensure your app has the `homey:manager:api` permission. this.homeyApi = await HomeyAPI.createAppAPI({ homey: this.homey, }); // Get all the devices, and log their names. const devices = await this.homeyApi.devices.getDevices(); for(const device of Object.values(devices)) { this.log(device.name); } } } ``` -------------------------------- ### Initialize and Authenticate with AthomCloudAPI Source: https://athombv.github.io/node-homey-api/AthomCloudAPI.html Demonstrates how to create an instance of AthomCloudAPI, handle user authentication via OAuth2, and retrieve user and Homey details. This snippet is useful for setting up API access and performing initial login flows. ```javascript const AthomCloudAPI = require('homey-api/lib/AthomCloudAPI'); // Create an AthomCloudAPI instance const cloudApi = new AthomCloudAPI({ clientId: '5a8d4ca6eb9f7a2c9d6ccf6d', clientSecret: 'e3ace394af9f615857ceaa61b053f966ddcfb12a', redirectUrl: 'http://localhost', }); // Check if we're logged in // If not, redirect the user to the OAuth2 dialog const loggedIn = await cloudApi.isLoggedIn(); if (!loggedIn) { if (cloudApi.hasAuthorizationCode()) { const token = await cloudApi.authenticateWithAuthorizationCode(); } else { window.location.href = cloudApi.getLoginUrl(); return; } } // Get the logged in user const user = await cloudApi.getAuthenticatedUser(); // Get the first Homey of the logged in user const homey = await user.getFirstHomey(); // Create a session on this Homey const homeyApi = await homey.authenticate(); // Get all Zones from ManagerZones const zones = await homeyApi.zones.getZones(); // Get all Devices from ManagerDevices const devices = await homeyApi.devices.getDevices(); // Turn all devices on for(const device of Object.values(devices)) { // Turn device on await device.setCapabilityValue({ capabilityId: 'onoff', value: true, }); } ``` -------------------------------- ### getDriver Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerDrivers.html Retrieves a specific driver by its ID. This allows you to get detailed information about a particular driver installed on Homey. ```APIDOC ## GET /api/manager/drivers/driver/:id ### Description Retrieves a specific driver by its ID. ### Method GET ### Endpoint /api/manager/drivers/driver/:id ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the driver to retrieve. #### Request Body - **opts** (object) - Required - **id** (string) - Required ### Response #### Success Response (200) - **Driver** (object) - The driver object. ``` -------------------------------- ### virtualdevicerf433.create Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerVirtualDevice.html Creates a new RF433 virtual device. ```APIDOC ## virtualdevicerf433.create ### Description Creates a new RF433 virtual device. ### Method POST ### Endpoint /virtualdevicerf433 ### Parameters #### Request Body - **virtualdevicerf433** (HomeyAPIV3Local.ManagerVirtualDevice.VirtualDeviceRF433) - Required - The virtual device object to create. ``` -------------------------------- ### revokeInstallerAccess Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerUsers.html Revokes installer access. ```APIDOC ## POST /api/manager/users/installer/revoke ### Description Revokes installer access. ### Method POST ### Endpoint /api/manager/users/installer/revoke ``` -------------------------------- ### Device Instance Methods Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerDevices.Device.html Methods available for interacting with and managing device instances. ```APIDOC ## Instance Methods ### connect (async) connect() Connect to this item's Socket.io namespace. ### disconnect (async) disconnect() Discconnect from this item's Socket.io namespace. ### getAdvancedFlows (async) getAdvancedFlows(): Promise.> #### Returns Promise.> ### getDriver (async) getDriver(): Promise. Get the device's driver. #### Returns Promise. ### getFlows (async) getFlows(): Promise.> Get the device's flows. #### Returns Promise.> ### getLogs (async) getLogs(): Promise.> Get the device's logs. #### Returns Promise.> ### getZone (async) getZone(): Promise. Get the device's zone. #### Returns Promise. ### makeCapabilityInstance makeCapabilityInstance(capabilityId, listener): HomeyAPIV3.ManagerDevices.Device.DeviceCapability Creates an HomeyAPIV3.DeviceCapability for realtime capability updates. #### Parameters Name | Type | Description ---|---|--- `capabilityId` | string | `listener` | function | `value` | number | boolean | string | } #### Returns HomeyAPIV3.ManagerDevices.Device.DeviceCapability #### Example ``` const onOffInstance = device.makeCapabilityInstance('onoff', value => { console.log('Device onoff changed to:', value); }); // Turn on onOffInstance.setValue(true).catch(console.error); ``` ### setCapabilityValue (async) setCapabilityValue(opts): Promise. Sets a capability's value. #### Parameters Name | Type | Description ---|---|--- `opts` | object | `capabilityId` | string | `value` | number | boolean | string | `opts` | object | `duration` | number | } } #### Returns Promise. ``` -------------------------------- ### widgetstore.create Event Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerDashboards.html Listens for the creation of a new widget store. ```APIDOC ## widgetstore.create ### Description Listens for the creation of a new widget store. ### Method .on('widgetstore.create') ### Parameters #### Path Parameters - `widgetstore` (HomeyAPIV3Cloud.ManagerDashboards.WidgetStore) - Required - The widget store object being created. ``` -------------------------------- ### Get Variables Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerLogic.html Retrieves all logic variables. ```APIDOC ## GET /api/manager/logic/variable ### Description Retrieves all logic variables. ### Method GET ### Endpoint /api/manager/logic/variable ### Response #### Success Response (200) - **Object.** - An object where keys are variable IDs and values are variable objects. ``` -------------------------------- ### createDashboard Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerDashboards.html Creates a new dashboard with the specified name and columns. Requires 'homey.dashboard' scope. ```APIDOC ## POST /api/manager/dashboards/dashboard ### Description Creates a new dashboard. ### Method POST ### Endpoint /api/manager/dashboards/dashboard ### Parameters #### Request Body - **dashboard** (object) - Required - **name** (string) - Required - **columns** (array) - Required ### Request Example ```json { "dashboard": { "name": "My New Dashboard", "columns": [] } } ``` ### Response #### Success Response (200) - **Dashboard** (object) - Details of the created dashboard. ``` -------------------------------- ### VirtualDeviceRF433 Instance Properties Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerVirtualDevice.VirtualDeviceRF433.html Provides information about the properties of a VirtualDeviceRF433 instance. ```APIDOC ## VirtualDeviceRF433 Instance Properties ### id **Description**: The unique identifier for the VirtualDeviceRF433. **Type**: string ``` -------------------------------- ### StorageAdapterBrowser Constructor Source: https://athombv.github.io/node-homey-api/AthomCloudAPI.StorageAdapterBrowser.html Initializes a new instance of the StorageAdapterBrowser class. ```APIDOC ## new StorageAdapterBrowser() ### Description Initializes a new instance of the StorageAdapterBrowser class. ### Constructor `new StorageAdapterBrowser()` ``` -------------------------------- ### Get State Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerI18n.html Retrieves the current i18n state. ```APIDOC ## GET /api/manager/i18n/state ### Description Retrieves the current i18n state. ### Method GET ### Endpoint /api/manager/i18n/state ### Scopes homey.system.readonly ### Response #### Success Response (200) - **state** (any) - The current i18n state. ``` -------------------------------- ### Listen for Device Create Events Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerDevices.html Use this to subscribe to events when a new device is created. Requires the device object. ```javascript .on('device.create') ``` -------------------------------- ### Get All Experiments Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerExperiments.html Retrieves a list of all available experiments. ```APIDOC ## GET /api/manager/experiments/experiment ### Description Retrieves a list of all experiments. ### Method GET ### Endpoint /api/manager/experiments/experiment ### Parameters This endpoint does not require any parameters. ### Response #### Success Response (200) - **experiments** (array) - A list of experiment objects. ``` -------------------------------- ### Get Mood Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerMoods.html Retrieves a specific mood by its ID. ```APIDOC ## GET /api/manager/moods/mood/:id ### Description Retrieves a specific mood by its ID. ### Method GET ### Endpoint /api/manager/moods/mood/:id ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the mood to retrieve. ### Response #### Success Response (200) - **mood** (HomeyAPIV3Cloud.ManagerMoods.Mood) - The retrieved mood object. ``` -------------------------------- ### StorageAdapter Constructor Source: https://athombv.github.io/node-homey-api/AthomCloudAPI.StorageAdapter.html Initializes a new instance of the StorageAdapter. This is an abstract class and should be extended. ```APIDOC ## Constructor ### StorageAdapter new StorageAdapter() ``` -------------------------------- ### virtualdevicerf433.create Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerVirtualDevice.html Event triggered when a new virtual RF433 device is created. ```APIDOC ## Event: virtualdevicerf433.create ### Description Event triggered when a new virtual RF433 device is created. ### Parameters - **virtualdevicerf433** (HomeyAPIV3Cloud.ManagerVirtualDevice.VirtualDeviceRF433) - Description of the virtual RF433 device object. ``` -------------------------------- ### Create and Use Device Capability Instance Source: https://athombv.github.io/node-homey-api/HomeyAPIV3.ManagerDevices.Device.html Use this method to create a DeviceCapability instance for listening to real-time updates of a specific capability. You can then use the instance to set new values for the capability. ```javascript const onOffInstance = device.makeCapabilityInstance('onoff', value => { console.log('Device onoff changed to:', value); }); // Turn on onOffInstance.setValue(true).catch(console.error); ``` -------------------------------- ### Get Variable Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerLogic.html Retrieves a specific logic variable by its ID. ```APIDOC ## GET /api/manager/logic/variable/:id ### Description Retrieves a specific logic variable. ### Method GET ### Endpoint /api/manager/logic/variable/:id ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the variable to retrieve. ### Response #### Success Response (200) - **Variable** (object) - The requested variable object. ``` -------------------------------- ### Get State Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerLogic.html Retrieves the current state of the logic manager. ```APIDOC ## GET /api/manager/logic/state ### Description Retrieves the current state of the logic manager. ### Method GET ### Endpoint /api/manager/logic/state ### Response #### Success Response (200) - **any** - An object representing the current state. ``` -------------------------------- ### Get Experiment State Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerExperiments.html Retrieves the current state of all experiments. ```APIDOC ## GET /api/manager/experiments/state ### Description Retrieves the current state of experiments. ### Method GET ### Endpoint /api/manager/experiments/state ### Parameters This endpoint does not require any parameters. ### Response #### Success Response (200) - **state** (object) - An object representing the current state of experiments. ``` -------------------------------- ### Capability Instance Methods Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerDevices.Capability.html These are the methods available on a Capability instance. ```APIDOC ## connect (async) connect() ### Description Connect to this item's Socket.io namespace. ### Method connect ### Parameters None ### Response None ``` ```APIDOC ## disconnect (async) disconnect() ### Description Disconnect from this item's Socket.io namespace. ### Method disconnect ### Parameters None ### Response None ``` -------------------------------- ### Get State Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerMoods.html Retrieves the current state of the moods manager. ```APIDOC ## GET /api/manager/moods/state ### Description Retrieves the current state of the moods manager. ### Method GET ### Endpoint /api/manager/moods/state ### Response #### Success Response (200) - **state** (any) - The current state of the moods manager. ``` -------------------------------- ### Get Moods Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerMoods.html Retrieves all moods available on the Homey system. ```APIDOC ## GET /api/manager/moods/mood ### Description Retrieves all moods. ### Method GET ### Endpoint /api/manager/moods/mood ### Response #### Success Response (200) - **moods** (Object.) - An object containing all moods, keyed by their IDs. ``` -------------------------------- ### runCommand Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerZwave.html Executes a Z-Wave command. Requires the 'homey.system' scope. ```APIDOC ## POST /api/manager/zwave/command ### Description Executes a Z-Wave command. ### Method POST ### Endpoint /api/manager/zwave/command ### Scopes homey.system ### Parameters #### Request Body - **opts** (object) - Required - Options for the command. - **command** (string) - Required - The command to execute. ### Request Example ```json { "command": "your_zwave_command" } ``` ### Response #### Success Response (200) - **any** - The result of the command execution. ``` -------------------------------- ### Get All Flow Tokens Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerFlowToken.html Retrieves all available flow tokens. ```APIDOC ## GET /api/manager/flowtoken/flowtoken ### Description Retrieves a collection of all flow tokens. ### Method GET ### Endpoint /api/manager/flowtoken/flowtoken ### Parameters This endpoint does not accept any parameters. ### Response #### Success Response (200) - **Object.** - An object where keys are flow token IDs and values are FlowToken objects. ``` -------------------------------- ### App Instance Methods Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerApps.App.html These are the methods available on an App instance for interacting with the app's API, managing its connection, and performing actions. ```APIDOC ## Instance Methods ### call (async) call(opts): Promise. Call the app's API endpoint. #### Parameters Name | Type | Description ---|---|--- `opts` | Object | `method` | 'GET' | 'POST' | 'PUT' | 'DELETE' | HTTP Method of the API endpoint. `path` | String | Path to the API endpoint. `body` | mixed | #### Returns Promise. ### connect (async) connect() Connect to this item's Socket.io namespace. ### delete (async) delete(opts): Promise. Make a DELETE request to the App's Web API. #### Parameters Name | Type | Description ---|---|--- `opts` | object | `path` | string | #### Returns Promise. ### disconnect (async) disconnect() Discconnect from this item's Socket.io namespace. ### get (async) get(opts): Promise. Make a GET request to the App's Web API. #### Parameters Name | Type | Description ---|---|--- `opts` | object | `path` | string | #### Returns Promise. ### post (async) post(opts): Promise. Make a POST request to the App's Web API. #### Parameters Name | Type | Description ---|---|--- `opts` | object | `path` | string | `body` | object | #### Returns Promise. ### put (async) put(opts): Promise. Make a PUT request to the App's Web API. #### Parameters Name | Type | Description ---|---|--- `opts` | object | `path` | string | `body` | object | #### Returns Promise. ``` -------------------------------- ### Get app states Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerApps.html Retrieves the current state of all applications. ```APIDOC ## GET /api/manager/apps/state ### Description Retrieves the current state of all applications. ### Method GET ### Endpoint /api/manager/apps/state ### Response #### Success Response (200) - **states** (any) - An object containing the state information for each app. #### Response Example ```json { "com.example.app": "running", "com.another.app": "stopped" } ``` ``` -------------------------------- ### Get app settings Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerApps.html Retrieves the settings for a specific application. ```APIDOC ## GET /api/manager/apps/app/:id/setting ### Description Retrieves the settings for a specific application. ### Method GET ### Endpoint /api/manager/apps/app/:id/setting ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the app. #### Request Example ```json { "id": "com.example.app" } ``` ### Response #### Success Response (200) - **settings** (HomeyAPIV3Cloud.ManagerApps.AppSettings) - The settings of the app. #### Response Example ```json { "setting1": "value1", "setting2": "value2" } ``` ``` -------------------------------- ### Log Instance Methods Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerInsights.Log.html Details the methods available for interacting with Log instances, specifically for establishing and terminating connections. ```APIDOC ## Instance Methods ### connect (async) connect() Connect to this item's Socket.io namespace. ### disconnect (async) disconnect() Discconnect from this item's Socket.io namespace. ``` -------------------------------- ### Manager Instance Methods Source: https://athombv.github.io/node-homey-api/HomeyAPIV3.Manager.html This section details the methods available on a HomeyAPIV3 Manager instance. ```APIDOC ## addListener addListener(event, callback) ### Parameters Name | Type | Description ---|---|--- `event` | string | `callback` | function | ``` ```APIDOC ## connect (async) connect(): Promise. Connect to this manager's Socket.io namespace. ### Returns Promise. ``` ```APIDOC ## destroy destroy() Destroy this Manager by cleaning up all references, unbinding event listeners and disconnecting from the Socket.io namespace. ``` ```APIDOC ## disconnect (async) disconnect(): Promise. Disconnect from this manager's Socket.io namespace. ### Returns Promise. ``` ```APIDOC ## emit emit(event, …data) ### Parameters Name | Type | Description ---|---|--- `event` | string | `data` | any | ``` ```APIDOC ## isConnected isConnected(): Boolean If this manager's namespace is connected to Socket.io. ### Returns Boolean ``` ```APIDOC ## off off(event, callback) ### Parameters Name | Type | Description ---|---|--- `event` | string | `callback` | function | ``` ```APIDOC ## on on(event, callback) ### Parameters Name | Type | Description ---|---|--- `event` | string | `callback` | function | ``` ```APIDOC ## once once(event, callback) ### Parameters Name | Type | Description ---|---|--- `event` | string | `callback` | function | ``` ```APIDOC ## removeAllListeners removeAllListeners(eventopt) ### Parameters Name | Type | Description ---|---|--- `event` | string | ``` ```APIDOC ## removeListener removeListener(event, callback) Shortcut to EventEmitter#off ### Parameters Name | Type | Description ---|---|--- `event` | string | `callback` | function | ``` -------------------------------- ### Get State Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerFlowToken.html Retrieves the current state of the flow token manager. ```APIDOC ## GET /api/manager/flowtoken/state ### Description Fetches the current operational state of the flow token manager. ### Method GET ### Endpoint /api/manager/flowtoken/state ### Response #### Success Response (200) - **any** - The current state information. ``` -------------------------------- ### virtualdevicevirtualipcamera.create Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerVirtualDevice.html Creates a new Virtual IP Camera virtual device. ```APIDOC ## virtualdevicevirtualipcamera.create ### Description Creates a new Virtual IP Camera virtual device. ### Method POST ### Endpoint /virtualdevicevirtualipcamera ### Parameters #### Request Body - **virtualdevicevirtualipcamera** (HomeyAPIV3Local.ManagerVirtualDevice.VirtualDeviceVirtualIPCamera) - Required - The virtual device object to create. ``` -------------------------------- ### Get Option Units Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerI18n.html Retrieves the current option units setting. ```APIDOC ## GET /api/manager/i18n/option/units ### Description Retrieves the current option units setting. ### Method GET ### Endpoint /api/manager/i18n/option/units ### Scopes homey.system.readonly ### Response #### Success Response (200) - **value** (any) - The current units option. ``` -------------------------------- ### Get Option Language Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerI18n.html Retrieves the current option language setting. ```APIDOC ## GET /api/manager/i18n/option/language ### Description Retrieves the current option language setting. ### Method GET ### Endpoint /api/manager/i18n/option/language ### Scopes homey.system.readonly ### Response #### Success Response (200) - **value** (any) - The current language option. ``` -------------------------------- ### App Instance Properties Source: https://athombv.github.io/node-homey-api/HomeyAPIV3.ManagerApps.App.html These are the properties available on an App instance. ```APIDOC ## Instance Properties ### homey homey: HomeyAPIV3 The Homey of the Item. #### Type * HomeyAPIV3 ### id id: string The ID of the Item. #### Type * string ### manager manager: HomeyAPIV3.Manager The Manager of the Item. #### Type * HomeyAPIV3.Manager ### uri uri: string The URI of the Item, e.g. `homey:foo:bar`. #### Type * string ``` -------------------------------- ### Get RF State Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerRF.html Retrieves the current state of the RF manager. ```APIDOC ## GET /api/manager/rf/state ### Description Retrieves the current state of the RF manager. ### Method GET ### Endpoint /api/manager/rf/state ### Response #### Success Response (200) - **any** - Returns any as a placeholder for the actual response type. ``` -------------------------------- ### Capability Instance Methods Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerDevices.Capability.html Provides methods to manage the connection to a device's capability. Users can connect to establish a real-time communication channel or disconnect to close it. ```APIDOC ## connect ### Description Connect to this item's Socket.io namespace. ### Method (async) connect() ### Endpoint N/A (SDK Method) ## disconnect ### Description Discconnect from this item's Socket.io namespace. ### Method (async) disconnect() ### Endpoint N/A (SDK Method) ``` -------------------------------- ### getOptionPaaSettings Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerMatter.html Retrieves the PAA settings for Matter options. Requires 'homey.system' scope. ```APIDOC ## GET /api/manager/matter/option/paaSettings ### Description Retrieves the Product Attestation Authority (PAA) settings for Matter. ### Method GET ### Endpoint /api/manager/matter/option/paaSettings ### Response #### Success Response (200) - **any** - Details of the response are not specified. ``` -------------------------------- ### Get State Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerGoogleAssistant.html Retrieves the current state of the Google Assistant integration. ```APIDOC ## GET /api/manager/google-assistant/state ### Description Retrieves the current state of the Google Assistant integration. ### Method GET ### Endpoint /api/manager/google-assistant/state ### Response #### Success Response (200) - **state** (any) - The current state of the Google Assistant integration. ``` -------------------------------- ### Get a specific app setting Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerApps.html Retrieves a specific setting for a given application. ```APIDOC ## GET /api/manager/apps/app/:id/setting/:name ### Description Retrieves a specific setting for a given application. ### Method GET ### Endpoint /api/manager/apps/app/:id/setting/:name ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the app. - **name** (string) - Required - The name of the setting to retrieve. #### Request Example ```json { "id": "com.example.app", "name": "setting1" } ``` ### Response #### Success Response (200) - **value** (any) - The value of the requested setting. #### Response Example ```json "value1" ``` ``` -------------------------------- ### Zone Instance Methods Source: https://athombv.github.io/node-homey-api/HomeyAPIV3.ManagerZones.Zone.html Provides details on the methods available for interacting with a Zone object, including connecting/disconnecting and retrieving parent zones. ```APIDOC ## Zone Instance Methods ### connect Connect to this item's Socket.io namespace. ### disconnect Disconnect from this item's Socket.io namespace. ### getParent Get the parent zone. #### Returns Promise.<(HomeyAPIV3.ManagerZones.Zone|null)> ``` -------------------------------- ### AthomCloudAPI Constructor Source: https://athombv.github.io/node-homey-api/AthomCloudAPI.html Instantiate the AthomCloudAPI class to authenticate users and interact with the Homey API. The API is available at `https://api.athom.com/`. ```APIDOC ## new AthomCloudAPI(opts) ### Description Initializes a new instance of the AthomCloudAPI class. ### Parameters #### Parameters - **opts** (object ) - **baseUrl** (string ) - The Base URL of the API. Defaults to `https://api.athom.com/`. Can be overridden by environment variable `ATHOM_CLOUD_API_BASEURL` or `window.localStorage`. - **debug** (boolean ) - If set to `true`, sends debug messages to `console.log`. Defaults to `false`. Can be overridden by environment variable `ATHOM_CLOUD_API_DEBUG` or `window.localStorage`. - **secret** (secret ) - A shared secret for APIs with a `secret` parameter. Can be overridden by environment variable `ATHOM_CLOUD_API_SECRET` or `window.localStorage`. - **clientId** (string) - Your application's client ID. - **clientSecret** (string) - Your application's client secret. - **redirectUrl** (string) - The URL to redirect to after authentication. - **autoRefreshTokens** (boolean ) - Automatically refresh authentication tokens. Defaults to `true`. - **token** (AthomCloudAPI.Token ) - An existing authentication token. Defaults to `null`. - **store** (AthomCloudAPI.StorageAdapter ) - An adapter for storing authentication tokens. Defaults to `AthomCloudAPI.StorageAdapterBrowser` or `AthomCloudAPI.StorageAdapterMemory`. ``` -------------------------------- ### get Method Source: https://athombv.github.io/node-homey-api/AthomCloudAPI.StorageAdapter.html Retrieves stored data. This method must be implemented by subclasses. ```APIDOC ## Instance Methods ### get (async) get(): Promise. #### Returns Promise. ``` -------------------------------- ### virtualdevicezigbee.create Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerVirtualDevice.html Creates a new Zigbee virtual device. ```APIDOC ## virtualdevicezigbee.create ### Description Creates a new Zigbee virtual device. ### Method POST ### Endpoint /virtualdevicezigbee ### Parameters #### Request Body - **virtualdevicezigbee** (HomeyAPIV3Local.ManagerVirtualDevice.VirtualDeviceZigbee) - Required - The virtual device object to create. ``` -------------------------------- ### Get Google Assistant State Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerGoogleAssistant.html Retrieves the current state of the Google Assistant integration. ```APIDOC ## GET /api/manager/google-assistant/state ### Description Retrieves the current state of the Google Assistant integration. ### Method GET ### Endpoint /api/manager/google-assistant/state ### Response #### Success Response (200) - **state** (any) - The current state. ``` -------------------------------- ### VirtualDeviceZigbee Instance Properties Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerVirtualDevice.VirtualDeviceZigbee.html Details the properties available on a VirtualDeviceZigbee instance. ```APIDOC ## Instance Properties ### id `id`: string #### Type * string ``` -------------------------------- ### Get System State Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerFlowToken.html Retrieves the current state of the system related to flow tokens. ```APIDOC ## GET /api/manager/flowtoken/state ### Description Retrieves the current state of the flow token manager. ### Method GET ### Endpoint /api/manager/flowtoken/state ### Parameters This endpoint does not accept any parameters. ### Response #### Success Response (200) - **any** - The current system state. ``` -------------------------------- ### VirtualDeviceEnergyDongle Instance Properties Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerVirtualDevice.VirtualDeviceEnergyDongle.html Provides information about the properties of a VirtualDeviceEnergyDongle instance. ```APIDOC ## VirtualDeviceEnergyDongle Instance Properties ### id `id` is a string property representing the unique identifier of the VirtualDeviceEnergyDongle. #### Type * string ``` -------------------------------- ### makeCapabilityInstance Source: https://athombv.github.io/node-homey-api/HomeyAPIV3.ManagerDevices.Device.html Creates a DeviceCapability instance for real-time updates of a specific capability. Useful for listening to changes. ```APIDOC ## makeCapabilityInstance ### Description Creates an HomeyAPIV3.DeviceCapability for realtime capability updates. ### Method makeCapabilityInstance(capabilityId, listener) ### Endpoint makeCapabilityInstance(capabilityId, listener) ### Parameters #### Path Parameters - **capabilityId** (string) - Required - The ID of the capability to listen to. - **listener** (function) - Required - The callback function to execute when the capability value changes. ### Response #### Success Response - **deviceCapability** (HomeyAPIV3.ManagerDevices.Device.DeviceCapability) - An instance of DeviceCapability for the specified capability. ### Example ```javascript const onOffInstance = device.makeCapabilityInstance('onoff', value => { console.log('Device onoff changed to:', value); }); // To set a value using this instance: onOffInstance.setValue(true).catch(console.error); ``` ``` -------------------------------- ### createDashboard Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerDashboards.html Creates a new dashboard with the specified name and columns. ```APIDOC ## POST /api/manager/dashboards/dashboard ### Description Creates a new dashboard. ### Method POST ### Endpoint /api/manager/dashboards/dashboard ### Parameters #### Request Body - **dashboard** (object) - Required - Dashboard object containing name and columns. - **name** (string) - Required - The name of the dashboard. - **columns** (array) - Required - An array representing the columns of the dashboard. ### Request Example ```json { "dashboard": { "name": "My New Dashboard", "columns": [{}, {}] } } ``` ### Response #### Success Response (200) - **Dashboard** (object) - The created dashboard object. ``` -------------------------------- ### Get Option Enabled Status Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerGoogleAssistant.html Retrieves the current enabled status of the Google Assistant integration. ```APIDOC ## GET /api/manager/google-assistant/option/enabled ### Description Retrieves the enabled status of the Google Assistant integration. ### Method GET ### Endpoint /api/manager/google-assistant/option/enabled ### Response #### Success Response (200) - **value** (any) - The enabled status. ``` -------------------------------- ### Listen for User Creation Event Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerUsers.html Use this to subscribe to the 'user.create' event. The event handler will receive the created user object as a parameter. ```javascript .on('user.create') ``` -------------------------------- ### Get Option Pin Code Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerGoogleAssistant.html Retrieves the current pin code option for Google Assistant. ```APIDOC ## GET /api/manager/google-assistant/option/pinCode ### Description Retrieves the current pin code option for Google Assistant. ### Method GET ### Endpoint /api/manager/google-assistant/option/pinCode ### Response #### Success Response (200) - **value** (any) - The current pin code option. ``` -------------------------------- ### Get Flow Token by ID Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerFlowToken.html Retrieves the details of a specific flow token using its ID. ```APIDOC ## GET /api/manager/flowtoken/flowtoken/:id ### Description Retrieves the details of a specific flow token. ### Method GET ### Endpoint /api/manager/flowtoken/flowtoken/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the flow token. #### Request Body This endpoint does not accept a request body. ### Response #### Success Response (200) - **FlowToken** (HomeyAPIV3Cloud.ManagerFlowToken.FlowToken) - An object containing the flow token details. ``` -------------------------------- ### VirtualDeviceZwave Instance Properties Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerVirtualDevice.VirtualDeviceZwave.html Provides information about the properties directly available on a VirtualDeviceZwave instance. ```APIDOC ## VirtualDeviceZwave Instance Properties ### id #### Description Represents the unique identifier of the virtual Z-Wave device. #### Type * string ``` -------------------------------- ### getState Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerCloud.html Retrieves the current state of the ManagerCloud service. This can be used to get read-only system information. ```APIDOC ## GET /api/manager/cloud/state ### Description Retrieves the current state of the ManagerCloud service. ### Method GET ### Endpoint /api/manager/cloud/state ### Scopes homey.system.readonly ### Response #### Success Response (200) - **any** - ``` -------------------------------- ### virtualdeviceenergydongle.create Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerVirtualDevice.html Event triggered when a new virtual energy dongle device is created. ```APIDOC ## Event: virtualdeviceenergydongle.create ### Description Event triggered when a new virtual energy dongle device is created. ### Parameters - **virtualdeviceenergydongle** (HomeyAPIV3Cloud.ManagerVirtualDevice.VirtualDeviceEnergyDongle) - Description of the virtual energy dongle device object. ``` -------------------------------- ### getDrivers Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerDrivers.html Retrieves a list of all drivers installed on Homey. This provides an overview of all available drivers and their configurations. ```APIDOC ## GET /api/manager/drivers/driver ### Description Retrieves a list of all drivers installed on Homey. ### Method GET ### Endpoint /api/manager/drivers/driver ### Response #### Success Response (200) - **Object.** - An object where keys are driver IDs and values are driver objects. ``` -------------------------------- ### WidgetStore Instance Properties Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerDashboards.WidgetStore.html Details the properties available on a WidgetStore instance. ```APIDOC ## WidgetStore Instance Properties ### id - **Type**: string - **Description**: The unique identifier for the widget store. ``` -------------------------------- ### createPairSession Source: https://athombv.github.io/node-homey-api/HomeyAPIV3Cloud.ManagerDrivers.html Initiates a new pair session for a driver. ```APIDOC ## POST /api/manager/drivers/pairsession ### Description Creates a new pair session for a driver. ### Method POST ### Endpoint /api/manager/drivers/pairsession ### Parameters #### Request Body - **opts** (object) - Required - **pairsession** (object) - Required - **type** (string) - Required - **driverId** (string) - Required - **deviceId** (string) - Optional - **zoneId** (string) - Optional ### Response #### Success Response (200) - **PairSession** (object) - Details of the created pair session. ```