Getting started with Core (for Dummies)

There is a great app created by AaronZON which will do what you are asking for. I use it to dim my front lights when motion is detected from my Ring doorbell.

You could probably setup two instances of the app, one for the motion and one for the sliding door.