This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

How to make IKEA lamps to fade from color and brightness

The title of this topic already tells what my question is :)

I bought a few IKEA led lamps that can change in intensity and in colour temperature.
After adding them and tested them out i wanted to try to make a flow that changes the colour and intensity during the evening. Sound very simple. The problem i am facing now is that i am not able to change the intensity or colour with an given interval. Say go to 50% in 2 hours.

Yesterday i saw that it's possible to install homeyscript so i thought that my solution!
As exited as i was i tried to make a little for loop that changes the intensity value from 1 to 0. Should be easy and indeed after some testing the console gave me the right output. I noticed that the intensity only changes when the script returns true (when your script is over). So no fading at all. I could be wrong but i wasn't able to find any function that could set the state of the device between each new value.

The forum didn't helped me how to make a fading process :(
I hoped one of you could help me out to make it fading. If it's also great if it works in the Homey app.

The js script looks like:
let test = await Homey.devices.getDevice({id: "3067d60e-4de0-40bb-b41c-1a5875056a7f"});
console.log(test.name);

for (i = 0; i < 10; i++) {
console.log(i);
test.setCapabilityValue('light_temperature', (1/i));
sleep(1000);
}

return true;

Comments

Sign In or Register to comment.