A little help with my first SmartApp please

You should probably take a look at Rule Machine:

This would be easy using a “Triggered Rule”:

Set “motion occurred” as a trigger
Set “door closed” as a condition
Set “Push message” as the action when true

2 Likes