Access this instance at HomeyAPIV2.devices
.
Extends
Classes
Instance Properties
homey
homey: HomeyAPIV3uri
uri: StringThe URI of the Item, e.g. homey:manager:bar
.
Type
- String
Instance Methods
addListener
addListener(event, callback)Parameters
Name | Type | Description |
---|---|---|
event
|
string | |
callback
|
function |
connect
(async) connect(): Promise.<void>Connect to this manager's Socket.io namespace.
Returns
deleteDevice
(async) deleteDevice(opts)Scopes
homey.device
HTTP
DELETE /api/manager/devices/device/:id
Parameters
Name | Type | Description |
---|---|---|
opts
|
object | |
id
|
string | |
|
destroy
destroy()Destroy this Manager by cleaning up all references, unbinding event listeners and disconnecting from the Socket.io namespace.
disconnect
(async) disconnect(): Promise.<void>Disconnect from this manager's Socket.io namespace.
Returns
emit
emit(event, …data)Parameters
Name | Type | Description |
---|---|---|
event
|
string | |
data
|
any
<repeatable> |
getCapabilities
(async) getCapabilities(): Promise.<Object.<string, HomeyAPIV2.ManagerDevices.Capability>>Scopes
homey.device.readonly
HTTP
GET /api/manager/devices/capability
Returns
getCapability
(async) getCapability(opts): Promise.<HomeyAPIV2.ManagerDevices.Capability>Scopes
homey.device.readonly
HTTP
GET /api/manager/devices/capability/:uri/:id
Parameters
Name | Type | Description |
---|---|---|
opts
|
object | |
id
|
string | |
uri
|
string | |
|
Returns
getDevice
(async) getDevice(opts): Promise.<HomeyAPIV2.ManagerDevices.Device>Scopes
homey.device.readonly
HTTP
GET /api/manager/devices/device/:id
Parameters
Name | Type | Description |
---|---|---|
opts
|
object | |
id
|
string | |
|
Returns
getDeviceSettingsObj
(async) getDeviceSettingsObj(opts): Promise.<any>Scopes
homey.device.readonly
HTTP
GET /api/manager/devices/device/:id/settings_obj
Parameters
Name | Type | Description |
---|---|---|
opts
|
object | |
id
|
string | |
|
Returns
getDevices
(async) getDevices(): Promise.<Object.<string, HomeyAPIV2.ManagerDevices.Device>>Scopes
homey.device.readonly
HTTP
GET /api/manager/devices/device/
Returns
isConnected
isConnected(): BooleanIf this manager's namespace is connected to Socket.io.
Returns
off
off(event, callback)Parameters
Name | Type | Description |
---|---|---|
event
|
string | |
callback
|
function |
on
on(event, callback)Parameters
Name | Type | Description |
---|---|---|
event
|
string | |
callback
|
function |
once
once(event, callback)Parameters
Name | Type | Description |
---|---|---|
event
|
string | |
callback
|
function |
removeAllListeners
removeAllListeners(eventopt)Parameters
Name | Type | Description |
---|---|---|
event
|
string
<optional> |
removeListener
removeListener(event, callback)Shortcut to EventEmitter#off
Parameters
Name | Type | Description |
---|---|---|
event
|
string | |
callback
|
function |
setCapabilityValue
(async) setCapabilityValue(opts): Promise.<any>Scopes
homey.device.control
HTTP
PUT /api/manager/devices/device/:deviceId/capability/:capabilityId
Parameters
Name | Type | Description |
---|---|---|
opts
|
object | |
capabilityId
|
string | |
deviceId
|
string | |
transactionId
|
*
<optional> |
|
opts
|
*
<optional> |
|
value
|
* | |
|
Returns
setDeviceSettings
(async) setDeviceSettings(opts): Promise.<any>Scopes
homey.device
HTTP
PUT /api/manager/devices/device/:id/settings
Parameters
Name | Type | Description |
---|---|---|
opts
|
object | |
id
|
string | |
settings
|
* | |
|
Returns
updateDevice
(async) updateDevice(opts): Promise.<HomeyAPIV2.ManagerDevices.Device>Scopes
homey.device
HTTP
PUT /api/manager/devices/device/:id
Parameters
Name | Type | Description |
---|---|---|
opts
|
object | |
id
|
string | |
device
|
* | |
|
Returns
Events
capability.create
.on('capability.create')Parameters
Name | Type | Description |
---|---|---|
capability
|
HomeyAPIV2.ManagerDevices.Capability |
capability.delete
.on('capability.delete')Parameters
Name | Type | Description |
---|---|---|
capability
|
HomeyAPIV2.ManagerDevices.Capability |
capability.update
.on('capability.update')Parameters
Name | Type | Description |
---|---|---|
capability
|
HomeyAPIV2.ManagerDevices.Capability |
device.create
.on('device.create')Parameters
Name | Type | Description |
---|---|---|
device
|
HomeyAPIV2.ManagerDevices.Device |
device.delete
.on('device.delete')Parameters
Name | Type | Description |
---|---|---|
device
|
HomeyAPIV2.ManagerDevices.Device |
device.update
.on('device.update')Parameters
Name | Type | Description |
---|---|---|
device
|
HomeyAPIV2.ManagerDevices.Device |