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.
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
Lithium
Member
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:
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
Could it be that i am not able to attach a variable at the intensity dimmer in the "then" side?
While dragging and dropping the tag into the slider i looks like the app freezes.
Edit: nvm, works but it takes a few minutes for the app to response again.
I successfully created a dimmer in colour and intensity for my lamps.
Unfortunately it does not work 100% correct. When testing the flow it works for a few steps; say 10 minutes. After the 10 minutes i still see the value colourdimmer changing but don't see the actual value of the lamp changing any more.
Found that the problem is more than 2 decimals makes the flow to break. Adding this works:
https://forum.athom.com/discussion/comment/55676/#Comment_55676