HomeyAPI

Members

alarms :HomeyAPI.ManagerAlarms

apps :HomeyAPI.ManagerApps

audio :HomeyAPI.ManagerAudio

backup :HomeyAPI.ManagerBackup

ble :HomeyAPI.ManagerBLE

cloud :HomeyAPI.ManagerCloud

coprocessor :HomeyAPI.ManagerCoprocessor

database :HomeyAPI.ManagerDatabase

devices :HomeyAPI.ManagerDevices

drivers :HomeyAPI.ManagerDrivers

energy :HomeyAPI.ManagerEnergy

experiments :HomeyAPI.ManagerExperiments

flow :HomeyAPI.ManagerFlow

flowToken :HomeyAPI.ManagerFlowToken

geolocation :HomeyAPI.ManagerGeolocation

googleAssistant :HomeyAPI.ManagerGoogleAssistant

i18n :HomeyAPI.ManagerI18n

images :HomeyAPI.ManagerImages

insights :HomeyAPI.ManagerInsights

ledring :HomeyAPI.ManagerLedring

logic :HomeyAPI.ManagerLogic

mobile :HomeyAPI.ManagerMobile

notifications :HomeyAPI.ManagerNotifications

presence :HomeyAPI.ManagerPresence

reminder :HomeyAPI.ManagerReminder

reports :HomeyAPI.ManagerReports

rf :HomeyAPI.ManagerRF

sessions :HomeyAPI.ManagerSessions

speechInput :HomeyAPI.ManagerSpeechInput

speechOutput :HomeyAPI.ManagerSpeechOutput

system :HomeyAPI.ManagerSystem

users :HomeyAPI.ManagerUsers

weather :HomeyAPI.ManagerWeather

zigBee :HomeyAPI.ManagerZigBee

zones :HomeyAPI.ManagerZones

zwave :HomeyAPI.ManagerZwave

Methods

destroy()

Unsubscribes all realtime events, clear all caches, and remove all event listeners for all managers and their managed objects

enableRouteDetection(intervalopt)

Enables automatic route detection
Parameters:
Name Type Attributes Description
interval number <optional>
Alternative interval in milliseconds (defaults to 15 seconds)

disableRouteDetection()

Disables automatic route detection

async detectRoute() → {string}

forces a detection of routes
Returns:
string - Detected baseUrl

async logout()

Log out on Homey

hasScope(scope) → {boolean}

A shortcut to HomeyAPI.ManagerSessions.Session#hasScope for the current session.
Parameters:
Name Type Description
scope string
Returns:
boolean - true if the scope is available, false otherwise

hasScopes(scopes) → {boolean}

A shortcut to HomeyAPI.ManagerSessions.Session#hasScopes for the current session.
Parameters:
Name Type Description
scopes Array.<string>
Returns:
boolean - true if the scopes are available, false otherwise

async, static forCurrentHomey(homeyopt, tokenopt) → {HomeyAPI}

Creates a new HomeyAPI that connects to the homey that the invoking script is hosted on.
Parameters:
Name Type Attributes Description
homey object <optional>
The Homey instance (`this.homey`), only required in SDK v3
token string <optional>
The Homey Token to use
Returns:
HomeyAPI - The HomeyAPI instance

Events

online

Emits whenever the online status changes. Requires at least one manager subscription or routeDetection to fire.
Parameters:
Name Type Description
online boolean The online status

logout

Emits whenever the authorization on this Homey expires and cannot be refreshed.

permissionsChanged

Emits whenever the scopes or user role of the user change. This event is only fired in response to the first API call after the change in permissions occured.
Parameters:
Name Type Description
session HomeyAPI.ManagerSessions.Session The new session

routeChanged

Emits whenever the route to the homey has changed. Requires routeDetection to be enabled
Parameters:
Name Type Description
baseUrl string The new baseUrl, or null when Homey is offline

Classes

ManagerAlarms

ManagerApps

ManagerAudio

ManagerBackup

ManagerBLE

ManagerCloud

ManagerCoprocessor

ManagerDatabase

ManagerDevices

ManagerDrivers

ManagerEnergy

ManagerExperiments

ManagerFlow

ManagerFlowToken

ManagerGeolocation

ManagerGoogleAssistant

ManagerI18n

ManagerImages

ManagerInsights

ManagerLedring

ManagerLogic

ManagerMobile

ManagerNotifications

ManagerPresence

ManagerReminder

ManagerReports

ManagerRF

ManagerSessions

ManagerSpeechInput

ManagerSpeechOutput

ManagerSystem

ManagerUsers

ManagerWeather

ManagerZigBee

ManagerZones

ManagerZwave