KeyMaster Z-Wave lock manager and scheduler

That’s what I’m working on with my integration. It depends on the scheduling functionality that exists in keymaster now. Trying to move everything that currently exists for scheduling to using iCal is just shifting the problem somewhere it doesn’t actually belong.

The current design of Keymaster is what is making it possible to do more complex scheduling to something that doesn’t then also have to deal with the vagaries of having to deal with getting codes into and out of locks

I’ll add that I presently use the scheduling functionality that presently exists on my home itself for when I have guests. There’s no iCal associated with something like that and you would end up creating a very different problem by pulling the current scheduling features out completely

SOLVED: Well I figured it out right after posting. When I first creating the Script in the UI I left the Entity ID field blank, which resulted in a numeric script name (vs the script alias).

I’ve successfully set up 3 locks in with keymaster but I’m not having any luck getting notifications working.

I have this script setup:

alias: keymaster_basment_patio_door_lock_manual_notify
mode: parallel
sequence:
  - service: notify.mobile_app_eric_s_phone
    data:
      title: '{{ title }}'
      message: '{{ message }}'
max: 10

I’ve verified that works, but when I trigger that lock I see in the logs:

2022-02-12 18:35:31 INFO (MainThread) [homeassistant.components.automation.keymaster_basment_patio_door_lock_locked] keymaster_basment_patio_door_lock_locked: Running automation actions
2022-02-12 18:35:31 INFO (MainThread) [homeassistant.components.automation.keymaster_basment_patio_door_lock_locked] keymaster_basment_patio_door_lock_locked: Executing step call service
2022-02-12 18:35:31 INFO (MainThread) [homeassistant.components.automation.keymaster_turn_off_retry_basment_patio_door_lock] keymaster_turn_off_retry_basment_patio_door_lock: Running automation actions
2022-02-12 18:35:31 INFO (MainThread) [homeassistant.components.automation.keymaster_turn_off_retry_basment_patio_door_lock] keymaster_turn_off_retry_basment_patio_door_lock: Executing step call service
2022-02-12 18:35:31 INFO (MainThread) [homeassistant.components.automation.keymaster_basment_patio_door_lock_lock_notifications] keymaster_basment_patio_door_lock Lock Notifications: Running automation actions
2022-02-12 18:35:31 INFO (MainThread) [homeassistant.components.automation.keymaster_basment_patio_door_lock_lock_notifications] keymaster_basment_patio_door_lock Lock Notifications: Executing step call service
2022-02-12 18:35:31 INFO (MainThread) [homeassistant.components.automation.keymaster_basment_patio_door_lock_timer_canceled] keymaster_basment_patio_door_lock_timer_canceled: Running automation actions
2022-02-12 18:35:31 INFO (MainThread) [homeassistant.components.automation.keymaster_basment_patio_door_lock_timer_canceled] keymaster_basment_patio_door_lock_timer_canceled: Executing step call service
2022-02-12 18:35:31 ERROR (MainThread) [homeassistant.components.automation.keymaster_basment_patio_door_lock_lock_notifications] keymaster_basment_patio_door_lock Lock Notifications: Error executing script. Service not found for call_service at pos 1: Unable to find service script.keymaster_basment_patio_door_lock_manual_notify
2022-02-12 18:35:31 ERROR (MainThread) [homeassistant.components.automation.keymaster_basment_patio_door_lock_lock_notifications] Error while executing automation automation.keymaster_basment_patio_door_lock_lock_notifications: Unable to find service script.keymaster_basment_patio_door_lock_manual_notify

This is on:
HA: 2022.2.6
KeyMaster: 0.77

Is there an ability to log which user pin/code opens the lock? I’d like to know who is unlocking the door and when. All I see are events pertaining to the change in status with a boolean value.

Yes. In your keymaster_<lock_name>_manual_notify script you add the the following action:

service: logbook.log
data:
  name: '{{ title }}'
  entity_id: <your_lock_entity>
  message: '{{ message }}'

You do have to make sure you’ve got the logger integration configured. I have the following in my configuration.yaml

logger: !include logger.yaml

and logger.yaml look like this to setup the logger integration and maintain the default logger configuration.

default: warning

Now, any slot you want you need to make sure it’s setup to do notifications.

What I’ve done for all of my locks is configure the corresponding manual_notify script to do that logging statement as the first thing it does, and then it sends a notification to my phone, and one to the notification service on my TV.

Thanks for the reply!

Is there a specific path/folder to create this script in? I’m still fairly new to the advanced/custom aspects of HA.

See the wiki documentation on the manual notification script.

Hey guys - I have been trying to get Keymaster working for a few days now, and I can’t figure out my issue… I am using Keymaster (via HACS) on HASSIO 2022.2.x. The lock is connected to zwavejs2mqtt via websocket (it’s hosted on an RPI). The lock is a Schlage a Schalge BE469ZP. I have gone through all the instructions and I have all the frontend pieces installed, but when I check the frontend page… all I see is

The only log I see is

Logger: custom_components.keymaster
Source: custom_components/keymaster/__init__.py:639
Integration: keymaster (documentation, issues)
First occurred: February 15, 2022, 4:35:56 PM (1 occurrences)
Last logged: February 15, 2022, 4:35:56 PM

Unexpected error fetching keymaster data: 'response'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/keymaster/__init__.py", line 602, in async_update_usercodes
    return await self._async_update()
  File "/config/custom_components/keymaster/__init__.py", line 639, in _async_update
    usercode_resp = await get_usercode_from_node(node, code_slot)
  File "/usr/local/lib/python3.9/site-packages/zwave_js_server/util/lock.py", line 101, in get_usercode_from_node
    resp = await node.async_invoke_cc_api(
  File "/usr/local/lib/python3.9/site-packages/zwave_js_server/model/node.py", line 560, in async_invoke_cc_api
    return await self.endpoints[0].async_invoke_cc_api(
  File "/usr/local/lib/python3.9/site-packages/zwave_js_server/model/endpoint.py", line 144, in async_invoke_cc_api
    return result["response"]
KeyError: 'response'`

Any advice to get this working?

Re-interview the lock.

I’ve already done that :frowning:

Make sure your lock is showing the UserCodes command class in the zwavejs2mqtt control panel.

It is indeed. Note I cleared some fields for the screen shot as they showed actual pins :wink:

How does Keymaster handle master code that is programmed on the device?

I have 4 Yale Assure SLs and was dealing with the dreaded “Adding” issue, and after a lot of adding/removing integrations and re-interviewing the devices, I finally have all mode codes synced and “Connected” except for 1 (which says “Adding” on all 4 locks).

After debugging, I realized that this is the master code for the locks and it’s rejecting the code due to it being a “duplicate”.

Was curious how this scenario is handled? I’d love to continue to use/track my master code in Keymaster as it’s still a viable code. I’m new to HA, and unsure if there is a way to force the code state, since it’s on the lock.

It’s still not clear to me where to put the custom (raw) script code.

The MyScripts button in the wiki should be used. It will bring you to the correct place. You just have to then create a script that is named as per the documentation.

keymaster_<doorname>_manual_notify where <doorname> is replaced with the doorname you specified for keymaster.

Hi. I am noticing that sometimes after an upgrade or a reboot, my autolock timers reset to 5 and 15 minutes. Is there something I am doing that is resetting these accidentally?

I just setup notifications and it works, but it is sending the wrong user who opened the door. Any ideas what it might be? I added this to the scripts.yaml

image

Good evening all,
I need to update my Zwave from the old depreciated one to ZwaveJS. I’ve watched a couple of YT tutorials on migrating to the newer system and it looks pretty straight forward. I only have a couple of Zwave devices but my biggest fear is my Schlage Zwave lock on my front door that I use with the awesome Keymaster. I have already made a note of my secure Zwave network key from my configuration.yaml.
Is there anything in particular I need to pay attention too when undertaking the migration?

Regards

Richard

Further to my post above I did migrate to Z-Wave JS successfully and my lock worked after renaming the entities to match what I previously had.

I do have a problem with 3 out of the 6 slots. I had codes in all 6 slots but three if them were disabled as they were not in use. The three slots that were active can be disabled or the code changed and everything syncs. I cannot enable or change the codes in the other slots. The pin status changes to Adding but never changes to connected
image

I have even removed Keymaster completely and re installed it but the same thing still happens.
I’d appreciate any thoughts on what might be causing this

Usually a PIN like 5555 isn’t valid and the locks will reject it.