ArjanKranenburg / virtual-devices

Homey-app to add Virtual Devices that can trigger your flows.
Other
25 stars 17 forks source link

Capability values not updated on Homey v2.0 #76

Closed Amelsfort closed 4 years ago

Amelsfort commented 5 years ago

I just upgraded Homey to version 2.0 and noticed my script that gets executed on a changed virtual light, wasn't working anymore. After some investigation I noticed the line 'device.state.onoff' was invalid now. I changed it to 'device.capabilitiesObj.onoff.value' which seems to be valid.

The only thing is, this still doesn't work: the value is always 'true'. I also logged the whole device-object on each change (tested by switching the light on and off) and didn't see any change.

I solved this now by switching the 'onoff' in my script, but I believe this should be done by the device itself before the trigger is executed.

Amelsfort commented 4 years ago

I just found out the issue is not in Virtual Devices, but in Homey/HomeyScript itself. Someone had the same issue and posted about it in the community forums: https://community.athom.com/t/device-capabilitiesobj-in-homeyscript-stays-the-same-value-when-triggered-in-a-flow/14529