Device CapabilitiesObj in HomeyScript stays the same value when triggered in a flow

Looks like you need a workaround:

const device = await Homey.devices.getDevice({ id: '45f27858-c506-4d3c-a800-1954d803e3e3' });
const cap    = device.makeCapabilityInstance('measure_power');

console.log(cap.value);

I think it has to do with lazy evaluation, where capability values are only updated when explicitly required.

1 Like