That depends on your skill level and also how much you want to tinker with the system.
Here’s a good overview of the different methods:
I used AppDaemon heavily in the past, but moved everything to HA automations. You can do almost everything with HA automations now.