Dim or brighten gradually while pressing button? Lerp problem?

Is there a simple solution to gradually increase the brightness of a light while holding a button, and stop dimming as soon as I release? I'm harkening back to my game dev days where we'd do this with linear interpolation. I'm hoping someone has a node or flow out there that'll handle all the maths so I don't have to reinvent the wheel. Thanks!

Home Assistant user.

The 'easing' node might help you with this.
Do you get payloads while holding the button ?

You should perhaps also note that LED mains-powered lights are notoriously difficult to dim smoothly. So maybe don't assume that any stepping is being caused by your app.

The easing node actually is a great solution. I'm combining this with Mat's Tradfri tutorial for something I hope to be pretty awesome.

2 Likes