Button with actions depending on recent events (complex if/else)

I’ve recently purchased a Aqara Wireless Mini Switch integrated via ZHA, a blueprint allows to configure actions for short/double/long press and for long press release.

What I’d like to do is to let the single press action change to react to whatever happened recently, e.g. something like:

  • Has the doorbell been activated in the past 60 seconds? If yes, open the door and play a confirmation sound on a homepod. If not…
  • Have the window blinds been opened or closed in the past 60 seconds? If yes, toggle their state. If not…
  • Have any lights turned on/off in the past 60 seconds? If yes, toggle their state. If not…
  • Toggle the lights in the living room

Also I’d like to configure the long press to slowly increase the current light level on a “normal” long press and the slowly decrease the current light level on a “press - double press”.

I’m not yet familiar with Jinja and Templates, so I wonder if there is a UI way of configuring such if/else logic, or if not, if you can point me to a template which I could use as a basis for creating my own. Thanks!