You can use this tutorial as base. You just need to add the brightness logic flow card:
Or you can use Zone Activity as already mentioned by @Rmb. For more info about Zone Activity please check these support articles: