How to use the lock status to create notification

Is this what you’re looking for?