Does anyone know of maybe a virtual lock driver that incorporates the door's contact sensor so it doesnt try to lock (or unlock) it if its not actually closed, and would send a notifier if it tries and fails? I think ST had such a creature - seems like a cool idea. There may be other benefits to including the door open/close state in a lock driver that I haven't thought of too.
I use rule machine with a contact sensor like @aaron does. Works very well. Notifying when there's an error isn't something I think you'll be able to do. RM sends a command to lock or unlock based on the parameters measured at the time the rule fires. It's a one shot deal. There's no parameter to measure an error state from the lock, where it's neither unlocked, nor locked.
I was rather hoping someone had put together an integrated driver with this contact feature built in.
Regarding the notifier, I would want to know if it was told to lock but couldn't because the door was open.
Also, there is a class of z-wave commands that report exceptions that it would be very nice to be able to expose to the user in some other way than the log. I saw such alerts int he log from a Nano dimmer when it was over-current, and also from a Schlage lock when it was jammed and stalled once.
What lock are you referring to? August Pro is the only one that comes to mind with a door sensor included.
I have Yale YRD256 and the Generic Z-Wave Lock driver does not support that for my lock, or the lock does not support it. I don't know which it is. You'd have to check with @mike.maxwell if other locks support that and so too the driver. My August Lock does that if I close with the app, but I don't anymore, so I would never know if it jammed when I wasn't paying attention.
This part is easy to do with Rule Machine.
I realize it could all be done with RM, yep. I'm just looking to "bind" a contact with a lock into a virtual lock device that won't try to lock a door that's not closed, and tell me if it failed. Seems like this would be a handy and popular thing. Im nowhere near to being smart enough to create it myself.
Such a simple thing to do with RM, that a dedicated app just doesn't make sense. To me anyway.
In my rule here, HE Autolock is a virtual switch that turns on for 1 second and then turns off again. The reason for that is so I can use the virtual switch with Alexa and other automations.
By simply making another rule that had my HE Autolock On and Front Door Sensor Open as the conditions, I could then send a notification as the action if I wanted, that an attempt to lock the door was made, but the door isn't closed. For notification, you can use Pushover which is a built-in app, you can send a text message directly (limit 10 per day) or you can trigger IFTTT to notify you.