I’m new to HA, coming from a SmartThings setup previously. One thing I find lacking in HA and OpenZWave is support for door locks. Sure, you can lock and unlock most models but a lot of the other info presented by the device isn’t made available. One feature I love in SmartThings comes from a custom SmartApp called “Lock multi user management with notifications and automatic relock”. Among other things it allows for different automations based on what user code was used to unlock a door. Because I’m not skilled enough to write something like that in HA or OZW, I decided to use my ST hub to make it happen.
First I link HA with ST, and for that there is the famous Smartthings MQTT Bridge. This makes all devices in ST available to HA and vice-versa. The next challenge is making the unique unlock events available outside of the SmartApp, where they are fairly limited. This was easily solved by creating simulated switches for each user, (“Unlock Trigger Mom”, etc), in the ST IDE and then setting the SmartApp to turn on said switches when the user unlocks the door. To make those events available outside of ST, I include them into the MQTT Bridge SmartApp. Great, now the events are exposed to HA!
In my config file I then setup automations for each user such that they are greeted by a custom message on the Google Home each time they unlock the door. It also resets the switch in ST so it’s ready to go next time. Pretty simple and looks like this for my son who happens to also be a Ninja Turtle:
- alias: Silas Unlock Routine
trigger:
platform: mqtt
topic: smartthings/Unlock Trigger Silas/switch
payload: 'on'
action:
- service: media_player.volume_set
entity_id: media_player.living_room_home
data:
volume_level: 0.7
- service: tts.google_say
entity_id: media_player.living_room_home
data:
message: 'Welcome home Leonardo! Cowabunga Dude!'
- service: mqtt.publish
data:
topic: 'smartthings/Unlock Trigger Silas/switch'
payload: 'off'
There is a several second delay due to all the high latency things happening here but it’s actually perfect because that gives time for the person to enter first. One nice thing about this versus a presence tracking version is that it works for people who don’t have presence tracking established at my house. for example, my young son who doesn’t carry a phone, my mom, or even guests. I’ve been thinking of another good use for this at a friend’s house who has an AirBnb rental. She assigns a door code for guests when she can’t be there to greet them personally. It would be cool to have a welcome and basic instruction message for those instances.
Overall, this is pretty sweet and goes to show why HA is so awesome! It also shows me that there are still some things that my SmartThings hub does better and it’s fine to keep using the best of both platforms together. One day, I’d like to see better support for these features in OZW and HA and hope to acquire the skills to contribute to them.
Let me know if you like the project and if you have any ideas to improve it! Thanks!