Still new to this, but took a look at the KeyMaster Code and realized its not involved at all in the locking/unlocking process. This just synchronizes the codes in the lock… I don’t think my lock reports back to Home Assistant if the door is unloced via code, or which code, or key, or picked… I’ll figure something out eventually!
I have this via an automation that only runs if the door is unlocked by pin. It should be apart of the lock report and alarm level
There are events emitted by keymaster that you can automate off of.
unlocking events? When I looked at the code it seems to only sync the code to the lock… I didnt see any interaction in the script and the lock when unlocking… I assume all of the unlocking is done at the lock level, and I’m not sure if/how to find out if the lock passes that information back to HA
Ah… thanks… I’m still new to this, but I believe that’s only monitoring for lock/unlocking (for relocking purposes). If you use that, it will disarm the alarm everytime the lock is unlocked… from the inside… picked… etc… was hoping to be able to figure out who unlocked the door given the code that was used…
Thanks for the help! Gonna keep looking!
If you dig deeper you’ll see that we match up the usercode with the input_text field for the slot and emit the text as the user. Listen to the keymaster_lock_state_changed
events under Configuration → Dev Tools → Events and you’ll see.
Thanks again! I’ll do that now!
anyone knows what this entity is:
Whoops… replied to the incorrect message…
IIRC its the open/close sensor… if you have an open/close sensor on the door you can enable auto locking… Not sure if it works without the sensor…
I do have my alarm sensor which is in my hassio, do I just change the binary_sensor.fake
to that?
badges:
- input_text.frontdoor_lockname
- input_boolean.frontdoor_lock_notifications
- input_boolean.frontdoor_dooraccess_notifications
- input_boolean.frontdoor_garageacess_notifications
- entity: >-
lock.front_door
- entity: >-
binary_sensor.fake
- entity: input_text.keymaster_frontdoor_autolock_door_time_day
- entity: input_text.keymaster_frontdoor_autolock_door_time_night
- entity: input_boolean.keymaster_frontdoor_autolock
- entity: timer.keymaster_frontdoor_autolock
by the way input_boolean.frontdoor_garageacess_notifications
what is this for? Can I hook my garage door to this?
You can, you can also set it in the integration for door monitoring as well.
Worked perfectly. Thanks so much!
Did you look at the wiki under extensions:
(Advanced) Create your own automations based on lock state changes · FutureTense/keymaster Wiki · GitHub
It tells how to use the Keymaster events to determine what happened including who unlocked it
@jwsample I am exploring HASS/KeyMaster in my search for hubs that expose smart lock codes management APIs. Ultimately, I want to be able to manage the codes through webhook triggers. Are you successfully doing that with KeyMaster?
Your’s is the only post I see in this thread mentioning webooks.
edit:
I have also seen discussion about RBoy’s ability to offer services utilizing a lock-code management API on SmartThings. I explored that for a long time, but hit dead ends trying to see if the lock-code-manager was available directly from the SmartThings capabilities (without licensing through RBoy), but it appears not to be published, but since RBoy succeeded in developing/exposing an API, it seems I must be missing something (or maybe just missing expertise). Is anyone else familiar of lock-code management API on SmartThings?
I am, or at least, I am to the point where keymaster is doing all that I need for that particular portion.
My case might be a little extreme because it has the added complexity of having 3 hassio installations in different geographic locations all talking to each other in addition to third party software.
The process of setting the codes is working well although it hasn’t been battle tested yet.
The biggest difficulty was getting the unlock events because my locks don’t give the notification event that is referenced everywhere and on the wiki. Mine report code unlock events as “alarm level” which by default is disabled in zwavejs. The workaround is enabling it and making a standard hassio state change trigger on alarm level. (Thats if you even want code entry notifications.)
The most useful thing keymaster does for me is connecting a changeable and persistent name input_text.<lock>_name_1
and the pin input_text.<lock>_pin_1
My approach to automating it has been to ignore all the various scripts and whatnot keymaster installs and just directly change the same varibales you change in the UI. So far it seems to be working.
@jwsample thanks. At this stage, I don’t have use-cases in mind that will need lock status information…just ability to add/remove lock codes.
I downloaded the keymaster git project but since this is my intro to hass “code”, I am not quite sure how to interpret it including how input from a webhook (presumably JSON?) is given as input to keymaster, but the fact that you are succeeding gives me enough confidence to move forward with testing. I may need to come back with questions
Here’s a static example that will set the second pin code of your lock to 1111, the pin name to “the_trigger_worked” with a POST request to <your_hassio_addres>/api/webhook/4aca598d-b4f3-4030-92d1-3a242e6d0ec7
Getting the variables in there would be the second step but I’d get this working first.
I’d also make sure everything works through the keymaster UI first.
alias: example web trigger code change
description: ''
trigger:
- platform: webhook
webhook_id: 4aca598d-b4f3-4030-92d1-3a242e6d0ec7
condition: []
action:
- service: input_text.set_value
data:
value: the_trigger_worked
target:
entity_id: input_text.<lock>_name_2
- service: input_text.set_value
target:
entity_id: input_text.<lock>_pin_2
data:
value: '1111'
- service: input_boolean.turn_off
target:
entity_id: input_boolean.enabled_<lock>_2
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: input_boolean.turn_on
target:
entity_id: input_boolean.enabled_<lock>_2
mode: single
Awesome, thanks much @jwsample. I am going to start work on resurrecting a system with VMWare under ubuntu to flash hass on and get started in that direction.
What kind of lock are you working with? I currently have a Schlage BE468CAM625 Camelot, which uses z-wave on my SmartThings.
Most of my locks are Schlage FE599s