Best way is probably the official SmartLighting feature, as it’s the only option that runs locally at the present time. Assuming you’re in a country where it’s available.
After that, it’s dealer’s choice. There are lots of options, including the new rules api. Each method has pluses and minuses.
As far as triggering a scene, see the following: