Introduction
SmartThings has a “brighten or dim gradually” feature but it’s cloud-based and not that gradual since the minimum time is 5 minutes and it apparently updates the brightness once every 60 seconds.
If that works for you, stop here: what follows is cumbersome, uses virtual switches, the advanced website and Rules API, but it’s potentially more visually attractive and smooth.
Matter lights have the ability to perform fades themselves when instructed, from 10 milliseconds to 108 minutes and, if the vendor did it right, the result should be buttery smooth (spoiler: it’s a hit or miss in each vendor and usually works better with times longer than 30 seconds, but it’s also a good opportunity to ask vendors to fix their stuff).
Creating Matter brightness transitions
Transitions are partially supported by the stock Matter drivers, only for brightness in the setLevel command. The second argument, that you can only see in the advanced website and is called “rate” is the transition time in tenths of a second. You can play with it to see if it works in your Matter lights. For instance, first turn on the light and set it to 100%. Then run the setLevel command with 10 and a rate of 600. It should gradually wind-down the light to 10% during 60 seconds. If level is 0% it should turn off at the end.
When that works, you may want to create a routine. SmartThings makes it hard by not exposing that argument to the user interface, you have to use the Rules API.
A simple rule to create a transition
I created a simple rule that will trigger when you turn on a virtual switch (I called it Start Fading) and will fade a set of two lights to 10% during 60 seconds. In fact, I’m so lazy that I created it as a normal routine and then copy-pasted and modified the auto-generated rule to add the second argument You have to replace the device IDs of course.
[
{
"if": {
"equals": {
"left": {
"device": {
"devices": [
"YOUR-VIRTUAL-SWITCH-DEVICE-ID-HERE"
],
"component": "main",
"capability": "switch",
"attribute": "switch",
"trigger": "Always"
}
},
"right": {
"string": "on"
},
"changesOnly": false
},
"then": [
{
"command": {
"devices": [
"A-LIGHT-DEVICE-ID-HERE",
"ANOTHER-LIGHT-DEVICE-ID-HERE"
],
"commands": [
{
"component": "main",
"capability": "switchLevel",
"command": "setLevel",
"arguments": [
{
"integer": 10
},
{
"integer": 600
}
]
}
]
}
}
],
"sequence": {
"then": "Parallel",
"else": "Parallel"
}
}
}
]
About temperature or color transitions
Commands setColor and setColorTemperature do not currently support transitions in stock drivers, I guess at the very least they could add a second argument to those commands like they did with setLevel so they’re on par.