Homey Community Forum

Basics with HomeyScript - device capabilities

Hi, im starting with HomeyScript and right at the beginning have a question.

i have this construction

let someDevice = await Homey.devices.getDevice({id: 'ed766ab2-21fb-44cf-b9c6-d58bf75bed44'});

why i can’t use

someDevice.getCapabilities()
//or
someDevice.getCapability('measure_temperature')
// returning someDevice.getCapability is not a function

only way i found is

someDevice.capabilitiesObj.measure_temperature

?
thanks

Homeyscript uses the Web API, not the App API.

So Homey.devices.getDevice() returns a HomeyAPI.ManagerDevices.Device instance. And the only method this instance has is makeCapabilityInstance().

1 Like

Thank you, my fault… now its all ok :slight_smile: