FutureTense / keymaster

Home Assistant integration for managing Z-Wave enabled locks
MIT License
218 stars 44 forks source link

ISSUE: Stuck on Adding/Deleting pin Kwikset 620 #310

Closed bergerz closed 1 year ago

bergerz commented 1 year ago

Describe the bug Hello I am attempting to get keymaster to work with my Kwikset 620 locks. Once I tried adding a second lock and using my front door lock as the parent, i ran into some syncing issues where they were stuck on adding/removing so I removed both integrations, removed any associated entities then re-added the integration so that everything could generate again.

However, now I am stuck with each slot saying "Deleting" and when I try to enable them with a pin they just move to "Adding".

I have attempted to manually sync by calling the service as was recommended in previous threads but I am still struggling.

Environment (please complete the following information):

Logs 2022-11-26 13:48:00.233 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2022-11-26 13:48:00.252 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration ble_monitor which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2022-11-26 13:48:00.257 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration keymaster which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2022-11-26 13:48:07.891 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly 2022-11-26 13:48:08.674 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=19 from 2022-11-26 18:41:29.069537) 2022-11-26 13:48:38.442 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform keymaster is taking over 10 seconds. 2022-11-26 13:48:45.196 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:48:48.357 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:48:55.513 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:49:01.742 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547452085408] Z-Wave error 202: Failed to send the command after 3 attempts (Status Fail) (ZW0202) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1744, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1781, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 208, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 943, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/light/init.py", line 581, in async_handle_light_off_service await light.async_turn_off(filter_turn_off_params(light, params)) File "/usr/src/homeassistant/homeassistant/components/zwave_js/light.py", line 294, in async_turn_off await self._async_set_brightness(0, kwargs.get(ATTR_TRANSITION)) File "/usr/src/homeassistant/homeassistant/components/zwave_js/light.py", line 351, in _async_set_brightness await self.info.node.async_set_value( File "/usr/local/lib/python3.10/site-packages/zwave_js_server/model/node/init.py", line 473, in async_set_value result = await self.async_send_command( File "/usr/local/lib/python3.10/site-packages/zwave_js_server/model/node/init.py", line 430, in async_send_command result = await self.client.async_send_command(message, kwargs) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/client.py", line 116, in async_send_command return await future zwave_js_server.exceptions.FailedZWaveCommand: Z-Wave error 202: Failed to send the command after 3 attempts (Status Fail) (ZW0202) 2022-11-26 13:49:05.321 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:49:11.156 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:49:17.092 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:49:31.052 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:49:34.281 ERROR (MainThread) [frontend.js.latest.202211080] :0:0 ResizeObserver loop completed with undelivered notifications. 2022-11-26 13:49:37.099 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:49:43.230 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:49:49.106 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:49:55.098 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:50:01.101 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:50:07.096 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:50:13.113 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:50:19.104 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:50:25.122 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:50:31.104 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:50:37.104 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:50:43.129 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:50:49.093 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:50:52.271 ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('ValueError: Template error: int got invalid input 'None' when rendering template '{## This template checks whether the PIN should be considered active based on ##} {## all of the different ways the PIN can be conditionally enabled/disabled ##} {## Get current date and time ##} {% set now = now() %} {## Get current day of week, date (integer yyyymmdd), and time (integer hhmm) ##} {% set current_day = now.strftime('%a')[0:3] | lower %} {% set current_date = now.strftime('%Y%m%d') | int %} {% set current_time = now.strftime('%H%M') | int %} {% set current_timestamp = as_timestamp(now) | int %} {## Get whether date range toggle is enabled as well as start and end date (integer yyyymmdd) ##} {## Determine whether current date is within date range using integer (yyyymmdd) comparison ##} {% set is_date_range_enabled = is_state('input_boolean.daterange_frontdoor_3', 'on') %} {% set start_date = state_attr('input_datetime.start_date_frontdoor_3', 'timestamp') | int %} {% set end_date = state_attr('input_datetime.end_date_frontdoor_3', 'timestamp') | int %} {## Only active if within the full datetime range. To get a single day both start and stop times must be set ##} {% set is_in_date_range = (start_date < end_date and current_timestamp >= start_date and current_timestamp <= end_date) %} {## Get current days start and end time (integer hhmm). Assume time range is considered enabled if start time != end time. ##} {## If time range is inclusive, check if current time is between start and end times. If exclusive, check if current time is before start time or after end time. ##} {% set current_day_start_time = (states('input_datetime.' + current_day + '_start_date_frontdoor_3')[0:5]).replace(':', '') | int %} {% set current_day_end_time = (states('input_datetime.' + current_day + '_end_date_frontdoor_3')[0:5]).replace(':', '') | int %} {% set is_time_range_enabled = (current_day_start_time != current_day_end_time) %} {% set is_time_range_inclusive = is_state('input_boolean.' + current_day + '_inc_frontdoor_3', 'on') %} {% set is_in_time_range = ( (is_time_range_inclusive and (current_time >= current_day_start_time and current_time <= current_day_end_time)) or (not is_time_range_inclusive and (current_time < current_day_start_time or current_time > current_day_end_time)) ) %} {## Get whether code slot is active and current day is enabled ##} {% set is_slot_enabled = is_state('input_boolean.enabled_frontdoor_3', 'on') %} {% set is_current_day_enabled = is_state('input_boolean.' + current_day + '_frontdoor_3', 'on') %} {## Check if access limit is enabled and if there are access counts left. ##} {% set is_access_limit_enabled = is_state('input_boolean.accesslimit_frontdoor_3', 'on') %} {% set is_access_count_valid = states('input_number.accesscount_frontdoor_3') | int > 0 %} {## Code slot is active if slot is enabled + current day is enabled + date range is not enabled or current date is within date range ##} {## + time range is not enabled or current time is within time range (based on include/exclude) + access limit is not enabled or there are more access counts left ##} {{ is_slot_enabled and is_current_day_enabled and (not is_date_range_enabled or is_in_date_range) and (not is_time_range_enabled or is_in_time_range) and (not is_access_limit_enabled or is_access_count_valid) }}' but no default was specified') while processing template 'Template("{## This template checks whether the PIN should be considered active based on ##} {## all of the different ways the PIN can be conditionally enabled/disabled ##} {## Get current date and time ##} {% set now = now() %} {## Get current day of week, date (integer yyyymmdd), and time (integer hhmm) ##} {% set current_day = now.strftime('%a')[0:3] | lower %} {% set current_date = now.strftime('%Y%m%d') | int %} {% set current_time = now.strftime('%H%M') | int %} {% set current_timestamp = as_timestamp(now) | int %} {## Get whether date range toggle is enabled as well as start and end date (integer yyyymmdd) ##} {## Determine whether current date is within date range using integer (yyyymmdd) comparison ##} {% set is_date_range_enabled = is_state('input_boolean.daterange_frontdoor_3', 'on') %} {% set start_date = state_attr('input_datetime.start_date_frontdoor_3', 'timestamp') | int %} {% set end_date = state_attr('input_datetime.end_date_frontdoor_3', 'timestamp') | int %} {## Only active if within the full datetime range. To get a single day both start and stop times must be set ##} {% set is_in_date_range = (start_date < end_date and current_timestamp >= start_date and current_timestamp <= end_date) %} {## Get current days start and end time (integer hhmm). Assume time range is considered enabled if start time != end time. ##} {## If time range is inclusive, check if current time is between start and end times. If exclusive, check if current time is before start time or after end time. ##} {% set current_day_start_time = (states('input_datetime.' + current_day + '_start_date_frontdoor_3')[0:5]).replace(':', '') | int %} {% set current_day_end_time = (states('input_datetime.' + current_day + '_end_date_frontdoor_3')[0:5]).replace(':', '') | int %} {% set is_time_range_enabled = (current_day_start_time != current_day_end_time) %} {% set is_time_range_inclusive = is_state('input_boolean.' + current_day + '_inc_frontdoor_3', 'on') %} {% set is_in_time_range = ( (is_time_range_inclusive and (current_time >= current_day_start_time and current_time <= current_day_end_time)) or (not is_time_range_inclusive and (current_time < current_day_start_time or current_time > current_day_end_time)) ) %} {## Get whether code slot is active and current day is enabled ##} {% set is_slot_enabled = is_state('input_boolean.enabled_frontdoor_3', 'on') %} {% set is_current_day_enabled = is_state('input_boolean.' + current_day + '_frontdoor_3', 'on') %} {## Check if access limit is enabled and if there are access counts left. ##} {% set is_access_limit_enabled = is_state('input_boolean.accesslimit_frontdoor_3', 'on') %} {% set is_access_count_valid = states('input_number.accesscount_frontdoor_3') | int > 0 %} {## Code slot is active if slot is enabled + current day is enabled + date range is not enabled or current date is within date range ##} {## + time range is not enabled or current time is within time range (based on include/exclude) + access limit is not enabled or there are more access counts left ##} {{ is_slot_enabled and is_current_day_enabled and (not is_date_range_enabled or is_in_date_range) and (not is_time_range_enabled or is_in_time_range) and (not is_access_limit_enabled or is_access_count_valid) }}")' for attribute '_state' in entity 'binary_sensor.active_frontdoor_3' 2022-11-26 13:50:52.290 ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('ValueError: Template error: int got invalid input 'None' when rendering template '{## This template checks whether the PIN should be considered active based on ##} {## all of the different ways the PIN can be conditionally enabled/disabled ##} {## Get current date and time ##} {% set now = now() %} {## Get current day of week, date (integer yyyymmdd), and time (integer hhmm) ##} {% set current_day = now.strftime('%a')[0:3] | lower %} {% set current_date = now.strftime('%Y%m%d') | int %} {% set current_time = now.strftime('%H%M') | int %} {% set current_timestamp = as_timestamp(now) | int %} {## Get whether date range toggle is enabled as well as start and end date (integer yyyymmdd) ##} {## Determine whether current date is within date range using integer (yyyymmdd) comparison ##} {% set is_date_range_enabled = is_state('input_boolean.daterange_frontdoor_1', 'on') %} {% set start_date = state_attr('input_datetime.start_date_frontdoor_1', 'timestamp') | int %} {% set end_date = state_attr('input_datetime.end_date_frontdoor_1', 'timestamp') | int %} {## Only active if within the full datetime range. To get a single day both start and stop times must be set ##} {% set is_in_date_range = (start_date < end_date and current_timestamp >= start_date and current_timestamp <= end_date) %} {## Get current days start and end time (integer hhmm). Assume time range is considered enabled if start time != end time. ##} {## If time range is inclusive, check if current time is between start and end times. If exclusive, check if current time is before start time or after end time. ##} {% set current_day_start_time = (states('input_datetime.' + current_day + '_start_date_frontdoor_1')[0:5]).replace(':', '') | int %} {% set current_day_end_time = (states('input_datetime.' + current_day + '_end_date_frontdoor_1')[0:5]).replace(':', '') | int %} {% set is_time_range_enabled = (current_day_start_time != current_day_end_time) %} {% set is_time_range_inclusive = is_state('input_boolean.' + current_day + '_inc_frontdoor_1', 'on') %} {% set is_in_time_range = ( (is_time_range_inclusive and (current_time >= current_day_start_time and current_time <= current_day_end_time)) or (not is_time_range_inclusive and (current_time < current_day_start_time or current_time > current_day_end_time)) ) %} {## Get whether code slot is active and current day is enabled ##} {% set is_slot_enabled = is_state('input_boolean.enabled_frontdoor_1', 'on') %} {% set is_current_day_enabled = is_state('input_boolean.' + current_day + '_frontdoor_1', 'on') %} {## Check if access limit is enabled and if there are access counts left. ##} {% set is_access_limit_enabled = is_state('input_boolean.accesslimit_frontdoor_1', 'on') %} {% set is_access_count_valid = states('input_number.accesscount_frontdoor_1') | int > 0 %} {## Code slot is active if slot is enabled + current day is enabled + date range is not enabled or current date is within date range ##} {## + time range is not enabled or current time is within time range (based on include/exclude) + access limit is not enabled or there are more access counts left ##} {{ is_slot_enabled and is_current_day_enabled and (not is_date_range_enabled or is_in_date_range) and (not is_time_range_enabled or is_in_time_range) and (not is_access_limit_enabled or is_access_count_valid) }}' but no default was specified') while processing template 'Template("{## This template checks whether the PIN should be considered active based on ##} {## all of the different ways the PIN can be conditionally enabled/disabled ##} {## Get current date and time ##} {% set now = now() %} {## Get current day of week, date (integer yyyymmdd), and time (integer hhmm) ##} {% set current_day = now.strftime('%a')[0:3] | lower %} {% set current_date = now.strftime('%Y%m%d') | int %} {% set current_time = now.strftime('%H%M') | int %} {% set current_timestamp = as_timestamp(now) | int %} {## Get whether date range toggle is enabled as well as start and end date (integer yyyymmdd) ##} {## Determine whether current date is within date range using integer (yyyymmdd) comparison ##} {% set is_date_range_enabled = is_state('input_boolean.daterange_frontdoor_1', 'on') %} {% set start_date = state_attr('input_datetime.start_date_frontdoor_1', 'timestamp') | int %} {% set end_date = state_attr('input_datetime.end_date_frontdoor_1', 'timestamp') | int %} {## Only active if within the full datetime range. To get a single day both start and stop times must be set ##} {% set is_in_date_range = (start_date < end_date and current_timestamp >= start_date and current_timestamp <= end_date) %} {## Get current days start and end time (integer hhmm). Assume time range is considered enabled if start time != end time. ##} {## If time range is inclusive, check if current time is between start and end times. If exclusive, check if current time is before start time or after end time. ##} {% set current_day_start_time = (states('input_datetime.' + current_day + '_start_date_frontdoor_1')[0:5]).replace(':', '') | int %} {% set current_day_end_time = (states('input_datetime.' + current_day + '_end_date_frontdoor_1')[0:5]).replace(':', '') | int %} {% set is_time_range_enabled = (current_day_start_time != current_day_end_time) %} {% set is_time_range_inclusive = is_state('input_boolean.' + current_day + '_inc_frontdoor_1', 'on') %} {% set is_in_time_range = ( (is_time_range_inclusive and (current_time >= current_day_start_time and current_time <= current_day_end_time)) or (not is_time_range_inclusive and (current_time < current_day_start_time or current_time > current_day_end_time)) ) %} {## Get whether code slot is active and current day is enabled ##} {% set is_slot_enabled = is_state('input_boolean.enabled_frontdoor_1', 'on') %} {% set is_current_day_enabled = is_state('input_boolean.' + current_day + '_frontdoor_1', 'on') %} {## Check if access limit is enabled and if there are access counts left. ##} {% set is_access_limit_enabled = is_state('input_boolean.accesslimit_frontdoor_1', 'on') %} {% set is_access_count_valid = states('input_number.accesscount_frontdoor_1') | int > 0 %} {## Code slot is active if slot is enabled + current day is enabled + date range is not enabled or current date is within date range ##} {## + time range is not enabled or current time is within time range (based on include/exclude) + access limit is not enabled or there are more access counts left ##} {{ is_slot_enabled and is_current_day_enabled and (not is_date_range_enabled or is_in_date_range) and (not is_time_range_enabled or is_in_time_range) and (not is_access_limit_enabled or is_access_count_valid) }}")' for attribute '_state' in entity 'binary_sensor.active_frontdoor_1' 2022-11-26 13:50:52.298 ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('ValueError: Template error: int got invalid input 'None' when rendering template '{## This template checks whether the PIN should be considered active based on ##} {## all of the different ways the PIN can be conditionally enabled/disabled ##} {## Get current date and time ##} {% set now = now() %} {## Get current day of week, date (integer yyyymmdd), and time (integer hhmm) ##} {% set current_day = now.strftime('%a')[0:3] | lower %} {% set current_date = now.strftime('%Y%m%d') | int %} {% set current_time = now.strftime('%H%M') | int %} {% set current_timestamp = as_timestamp(now) | int %} {## Get whether date range toggle is enabled as well as start and end date (integer yyyymmdd) ##} {## Determine whether current date is within date range using integer (yyyymmdd) comparison ##} {% set is_date_range_enabled = is_state('input_boolean.daterange_frontdoor_2', 'on') %} {% set start_date = state_attr('input_datetime.start_date_frontdoor_2', 'timestamp') | int %} {% set end_date = state_attr('input_datetime.end_date_frontdoor_2', 'timestamp') | int %} {## Only active if within the full datetime range. To get a single day both start and stop times must be set ##} {% set is_in_date_range = (start_date < end_date and current_timestamp >= start_date and current_timestamp <= end_date) %} {## Get current days start and end time (integer hhmm). Assume time range is considered enabled if start time != end time. ##} {## If time range is inclusive, check if current time is between start and end times. If exclusive, check if current time is before start time or after end time. ##} {% set current_day_start_time = (states('input_datetime.' + current_day + '_start_date_frontdoor_2')[0:5]).replace(':', '') | int %} {% set current_day_end_time = (states('input_datetime.' + current_day + '_end_date_frontdoor_2')[0:5]).replace(':', '') | int %} {% set is_time_range_enabled = (current_day_start_time != current_day_end_time) %} {% set is_time_range_inclusive = is_state('input_boolean.' + current_day + '_inc_frontdoor_2', 'on') %} {% set is_in_time_range = ( (is_time_range_inclusive and (current_time >= current_day_start_time and current_time <= current_day_end_time)) or (not is_time_range_inclusive and (current_time < current_day_start_time or current_time > current_day_end_time)) ) %} {## Get whether code slot is active and current day is enabled ##} {% set is_slot_enabled = is_state('input_boolean.enabled_frontdoor_2', 'on') %} {% set is_current_day_enabled = is_state('input_boolean.' + current_day + '_frontdoor_2', 'on') %} {## Check if access limit is enabled and if there are access counts left. ##} {% set is_access_limit_enabled = is_state('input_boolean.accesslimit_frontdoor_2', 'on') %} {% set is_access_count_valid = states('input_number.accesscount_frontdoor_2') | int > 0 %} {## Code slot is active if slot is enabled + current day is enabled + date range is not enabled or current date is within date range ##} {## + time range is not enabled or current time is within time range (based on include/exclude) + access limit is not enabled or there are more access counts left ##} {{ is_slot_enabled and is_current_day_enabled and (not is_date_range_enabled or is_in_date_range) and (not is_time_range_enabled or is_in_time_range) and (not is_access_limit_enabled or is_access_count_valid) }}' but no default was specified') while processing template 'Template("{## This template checks whether the PIN should be considered active based on ##} {## all of the different ways the PIN can be conditionally enabled/disabled ##} {## Get current date and time ##} {% set now = now() %} {## Get current day of week, date (integer yyyymmdd), and time (integer hhmm) ##} {% set current_day = now.strftime('%a')[0:3] | lower %} {% set current_date = now.strftime('%Y%m%d') | int %} {% set current_time = now.strftime('%H%M') | int %} {% set current_timestamp = as_timestamp(now) | int %} {## Get whether date range toggle is enabled as well as start and end date (integer yyyymmdd) ##} {## Determine whether current date is within date range using integer (yyyymmdd) comparison ##} {% set is_date_range_enabled = is_state('input_boolean.daterange_frontdoor_2', 'on') %} {% set start_date = state_attr('input_datetime.start_date_frontdoor_2', 'timestamp') | int %} {% set end_date = state_attr('input_datetime.end_date_frontdoor_2', 'timestamp') | int %} {## Only active if within the full datetime range. To get a single day both start and stop times must be set ##} {% set is_in_date_range = (start_date < end_date and current_timestamp >= start_date and current_timestamp <= end_date) %} {## Get current days start and end time (integer hhmm). Assume time range is considered enabled if start time != end time. ##} {## If time range is inclusive, check if current time is between start and end times. If exclusive, check if current time is before start time or after end time. ##} {% set current_day_start_time = (states('input_datetime.' + current_day + '_start_date_frontdoor_2')[0:5]).replace(':', '') | int %} {% set current_day_end_time = (states('input_datetime.' + current_day + '_end_date_frontdoor_2')[0:5]).replace(':', '') | int %} {% set is_time_range_enabled = (current_day_start_time != current_day_end_time) %} {% set is_time_range_inclusive = is_state('input_boolean.' + current_day + '_inc_frontdoor_2', 'on') %} {% set is_in_time_range = ( (is_time_range_inclusive and (current_time >= current_day_start_time and current_time <= current_day_end_time)) or (not is_time_range_inclusive and (current_time < current_day_start_time or current_time > current_day_end_time)) ) %} {## Get whether code slot is active and current day is enabled ##} {% set is_slot_enabled = is_state('input_boolean.enabled_frontdoor_2', 'on') %} {% set is_current_day_enabled = is_state('input_boolean.' + current_day + '_frontdoor_2', 'on') %} {## Check if access limit is enabled and if there are access counts left. ##} {% set is_access_limit_enabled = is_state('input_boolean.accesslimit_frontdoor_2', 'on') %} {% set is_access_count_valid = states('input_number.accesscount_frontdoor_2') | int > 0 %} {## Code slot is active if slot is enabled + current day is enabled + date range is not enabled or current date is within date range ##} {## + time range is not enabled or current time is within time range (based on include/exclude) + access limit is not enabled or there are more access counts left ##} {{ is_slot_enabled and is_current_day_enabled and (not is_date_range_enabled or is_in_date_range) and (not is_time_range_enabled or is_in_time_range) and (not is_access_limit_enabled or is_access_count_valid) }}")' for attribute '_state' in entity 'binary_sensor.active_frontdoor_2' 2022-11-26 13:50:56.909 ERROR (MainThread) [frontend.js.latest.202211080] :0:0 ResizeObserver loop completed with undelivered notifications. 2022-11-26 13:51:16.436 ERROR (MainThread) [frontend.js.latest.202211080] :0:0 ResizeObserver loop completed with undelivered notifications. 2022-11-26 13:51:17.081 ERROR (MainThread) [frontend.js.latest.202211080] :0:0 ResizeObserver loop completed with undelivered notifications. 2022-11-26 13:51:18.414 ERROR (MainThread) [frontend.js.latest.202211080] :0:0 ResizeObserver loop completed with undelivered notifications. 2022-11-26 13:55:15.354 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities timer.keymaster_frontdoor_autolock or it is/they are currently not available 2022-11-26 13:55:15.371 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities script.keymaster_frontdoor_start_timer or it is/they are currently not available 2022-11-26 13:55:17.057 WARNING (MainThread) [homeassistant.components.cloud.google_config] Error reporting state - 5: Requested entity was not found. 2022-11-26 13:55:24.810 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform keymaster is taking over 10 seconds. 2022-11-26 13:55:33.735 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:55:34.880 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED, TypeError: 'NoneType' object is not subscriptable 2022-11-26 13:55:39.738 ERROR (MainThread) [homeassistant.components.hassio.handler] Client error on /homeassistant/restart request Server disconnected

Screenshots

https://imgur.com/a/LAkBWCp

Additional context I am still fairly new to all of this but I thought I had followed the installation steps properly. If theres any other information I can provide please let me know.

bergerz commented 1 year ago

Trying to run service for "Refresh Codes from a lock" for my front door lock and getting:

Failed to call service keymaster.refresh_codes. Unknown error

firstof9 commented 1 year ago

2022-11-26 13:49:01.742 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547452085408] Z-Wave error 202: Failed to send the command after 3 attempts (Status Fail) (ZW0202)

You're having zwave connectivity issues.

bergerz commented 1 year ago

It is working fine if I manually issue the pin via calling the service though.

It seems like something is wrong specifically with syncing and refreshing with keymaster.

bergerz commented 1 year ago

This NONE type error keeps popping up but I don't understand it.

Any idea what this means?

2022-11-26 15:15:39.295 ERROR (MainThread) [custom_components.keymaster] Unexpected error fetching keymaster data: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/keymaster/init.py", line 569, in async_update_usercodes return await self._async_update() File "/config/custom_components/keymaster/init.py", line 606, in _async_update usercode_resp = await get_usercode_from_node(node, code_slot) File "/usr/local/lib/python3.10/site-packages/zwave_js_server/util/lock.py", line 105, in get_usercode_from_node ATTR_IN_USE: resp["userIdStatus"] == CodeSlotStatus.ENABLED,

firstof9 commented 1 year ago

It's saying your CodeSlotStatus is missing in zwavejs.

bergerz commented 1 year ago

Sorry for my ignorance but unsure what exactly that means or how to solve it.

firstof9 commented 1 year ago

In zwavejs-ui do you see the UserCodes command class?

bergerz commented 1 year ago

Unless I am misunderstanding, I don't have zwavejs-ui I am using the official zwave-js addon.

firstof9 commented 1 year ago

You can try the Download Diagnostics option from the over flow menu for the lock and see if the UserCodes command class stuff shows up.

bergerz commented 1 year ago

Yeah there does appear to be. File too long to post everything but will post a snippet of some of them. Does seem to be plenty of usercodes.

Here is a snippet from the file:

     {
      "endpoint": 0,
      "commandClass": 99,
      "commandClassName": "User Code",
      "property": "userIdStatus",
      "propertyKey": 1,
      "propertyName": "userIdStatus",
      "propertyKeyName": "1",
      "ccVersion": 2,
      "metadata": {
        "type": "number",
        "readable": true,
        "writeable": true,
        "label": "User ID status (1)",
        "states": {
          "0": "Available",
          "1": "Enabled",
          "2": "Disabled",
          "3": "Messaging",
          "4": "PassageMode"
        }
      }
    },
    {
      "endpoint": 0,
      "commandClass": 99,
      "commandClassName": "User Code",
      "property": "userCode",
      "propertyKey": 1,
      "propertyName": "userCode",
      "propertyKeyName": "1",
      "ccVersion": 2,
      "metadata": {
        "type": "string",
        "readable": true,
        "writeable": true,
        "label": "User Code (1)",
        "minLength": 4,
        "maxLength": 10
      }
    },
    {
      "endpoint": 0,
      "commandClass": 99,
      "commandClassName": "User Code",
      "property": "userIdStatus",
      "propertyKey": 2,
      "propertyName": "userIdStatus",
      "propertyKeyName": "2",
      "ccVersion": 2,
      "metadata": {
        "type": "number",
        "readable": true,
        "writeable": true,
        "label": "User ID status (2)",
        "states": {
          "0": "Available",
          "1": "Enabled",
          "2": "Disabled",
          "3": "Messaging",
          "4": "PassageMode"
        }
      }
    },
    {
      "endpoint": 0,
      "commandClass": 99,
      "commandClassName": "User Code",
      "property": "userCode",
      "propertyKey": 2,
      "propertyName": "userCode",
      "propertyKeyName": "2",
      "ccVersion": 2,
      "metadata": {
        "type": "string",
        "readable": true,
        "writeable": true,
        "label": "User Code (2)",
        "minLength": 4,
        "maxLength": 10
      }
    },
    {
      "endpoint": 0,
      "commandClass": 99,
      "commandClassName": "User Code",
      "property": "userIdStatus",
      "propertyKey": 3,
      "propertyName": "userIdStatus",
      "propertyKeyName": "3",
      "ccVersion": 2,
      "metadata": {
        "type": "number",
        "readable": true,
        "writeable": true,
        "label": "User ID status (3)",
        "states": {
          "0": "Available",
          "1": "Enabled",
          "2": "Disabled",
          "3": "Messaging",
          "4": "PassageMode"
        }
      }
    },
    {
      "endpoint": 0,
      "commandClass": 99,
      "commandClassName": "User Code",
      "property": "userCode",
      "propertyKey": 3,
      "propertyName": "userCode",
      "propertyKeyName": "3",
      "ccVersion": 2,
      "metadata": {
        "type": "string",
        "readable": true,
        "writeable": true,
        "label": "User Code (3)",
        "minLength": 4,
        "maxLength": 10
      }
    },
firstof9 commented 1 year ago

Based on this it should be working. I'm not sure what's going on there.

cmatte commented 1 year ago

I have a different lock, Yale's Keyless Connected with a Z-Wave module v2, and I have been running into the same issues: the sync automation runs and triggers no errors, however 90% of the times the lock is not responding with updated lock parameters, whereby the action was succesfully taken but KeyMaster can't tell us that it is and stays stuck in Adding/Deleting, or, rarely, it actually fails to set the requested add/delete, but silently. So, I've written an automation to react to those two issues and it's been working very well for me, with no major side effects aside obviously from a tiny increase of Z-Wave traffic and I assume battery use yet not noticeable...small price for the certainty automations run as they should :)

If it's helpful, it shall be applicable here too, change the sensors, automations, and lock IDs to match yours, and you shall be good to go. What is does is, it waits 5s, checks if all worked and do nothing, if not, it'll enter a while loop where it would first re-interrogate the CC values from the lock, wait 10s, see if it all worked to a Dis/Connected status and exit, if not, it'll re-trigger the native KeyMaster automation that writes/removes the code, wait 10s, and re-start the loop until it's reached a final Dis/Connected state. @firstof9 feel free to add your view here, I tried all sorts with the Z-Wave network and have deployed the closest powered router to the lock that I can possibly have, but traffic is not being routed through it for some reason, so the direct and far connection to the controller might be the source of these issues.

alias: Refreshing Yale Smart Lock upon changes
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.connected_yale_smart_lock_1
      - sensor.connected_yale_smart_lock_2
      - sensor.connected_yale_smart_lock_3
      - sensor.connected_yale_smart_lock_4
      - sensor.connected_yale_smart_lock_5
      - sensor.connected_yale_smart_lock_6
      - sensor.connected_yale_smart_lock_7
      - sensor.connected_yale_smart_lock_8
      - sensor.connected_yale_smart_lock_9
      - sensor.connected_yale_smart_lock_10
      - sensor.connected_yale_smart_lock_11
      - sensor.connected_yale_smart_lock_12
      - sensor.connected_yale_smart_lock_13
      - sensor.connected_yale_smart_lock_14
      - sensor.connected_yale_smart_lock_15
      - sensor.connected_yale_smart_lock_16
      - sensor.connected_yale_smart_lock_17
      - sensor.connected_yale_smart_lock_18
      - sensor.connected_yale_smart_lock_19
      - sensor.connected_yale_smart_lock_20
    alias: When any PIN Status changes
condition:
  - condition: not
    conditions:
      - condition: template
        value_template: "{{ trigger.to_state.state == \"Connected\" }}"
        alias: Test if becoming connected
      - condition: template
        value_template: "{{ trigger.to_state.state == \"Disconnected\" }}"
        alias: Test if becoming disconnected
    alias: Test if NOT becoming dis/connected
action:
  - repeat:
      while:
        - condition: not
          conditions:
            - condition: template
              value_template: >-
                {{ states[trigger.to_state.domain][trigger.to_state.object_id].state == "Connected" }}
              alias: Status is connected
            - condition: template
              value_template: >-
                {{ states[trigger.to_state.domain][trigger.to_state.object_id].state == "Disconnected" }}
              alias: Status is disconnected
          alias: Test if not already dis/connected
      sequence:
        - delay:
            hours: 0
            minutes: 0
            seconds: 5
            milliseconds: 0
        - service: zwave_js.invoke_cc_api
          continue_on_error: true
          data_template:
            command_class: "99"
            parameters:
              - "{{ trigger.entity_id.split('_')[-1] }}"
            method_name: get
          target:
            device_id: ***add your lock ID here***
          alias: Refresh Z-Wave code status
        - delay:
            hours: 0
            minutes: 0
            seconds: 10
            milliseconds: 0
        - condition: not
          conditions:
            - condition: template
              value_template: >-
                {{ states[trigger.to_state.domain][trigger.to_state.object_id].state == "Connected" }}
              alias: Status is connected
            - condition: template
              value_template: >-
                {{ states[trigger.to_state.domain][trigger.to_state.object_id].state == "Disconnected" }}
              alias: Status is disconnected
          alias: Test if not already dis/connected
        - service: automation.trigger
          continue_on_error: true
          data_template:
            skip_condition: false
            entity_id: >-
              automation.keymaster_synchronize_codeslot_yale_smart_lock_{{ trigger.entity_id.split('_')[-1] }}
          alias: KeyMaster re-sync the code slot
        - delay:
            hours: 0
            minutes: 0
            seconds: 10
            milliseconds: 0
mode: queued
max: 10
iscraigh commented 1 year ago

cmatte Trying to get your automation working and getting these errors

`repeat Executed: January 29, 2023 at 1:29:44 PM Result:

result: null

repeat/while/0 Executed: January 29, 2023 at 1:29:44 PM Error: In 'not' (item 1 of 2): In 'template' condition: UndefinedError: 'dict object' has no attribute 'to_state' In 'not' (item 2 of 2): In 'template' condition: UndefinedError: 'dict object' has no attribute 'to_state' repeat/while/0/conditions/0 Executed: January 29, 2023 at 1:29:44 PM Error: In 'template' condition: UndefinedError: 'dict object' has no attribute 'to_state' repeat/while/0/conditions/1 Executed: January 29, 2023 at 1:29:44 PM Error: In 'template' condition: UndefinedError: 'dict object' has no attribute 'to_state`

iscraigh commented 1 year ago

alias: Refreshing service hall Lock upon changes description: "" trigger:

WolfHunter1043 commented 1 year ago

I do not see a commandclass for user code in my diagnostics.... I also conveniently cannot get this to work with a different lock (BE469ZP). Looking for things to look into, any idea where to go with that? Lock appears to have paired correctly and when I enter a manually programed user code at the door I can see in the event log it shoes the code slot was entered.

firstof9 commented 1 year ago

Re-inverview your lock until the command class shows up.

WolfHunter1043 commented 1 year ago

Even though my lock was closed and appeared to pair correctly, when I took it off the door and held next to my USB stick it worked and keymaster worked without issue. Did have to clear all codes in the lock first.

bmbouter commented 1 year ago

I believe this is an issue with all kwikset locks. I have an 888 and I have the same problem. In my case I can see user codes, I have great connectivity so a lot of those issues are not the root cause here. It's the same issue as reported here: https://github.com/FutureTense/keymaster/issues/138#issuecomment-808649070

So basically, whenever you go to change a pin code you need that pin code again when deleting it. If you don't you have two problems:

1) that slot is basically unusable 2) you can't ever user that code again because kwikset won't accept the same code twice.

What could keymaster do to help here?

bmbouter commented 1 year ago

To fix this problem you go and manually set the code to what the lock thinks it already has in that slot and add it and then remove it. You can know what the lock thinks it has by looking in the entities list, e.g. at the value of sensor.frontdoor_code_slot_1. keymaster could do this too.

bmbouter commented 1 year ago

I believe this issue was closed with the understanding that it was either setup issues or connectivity issues. If you read carefully though you'll see there's a category of users who have neither of those problems but still have "stuck on adding/removing with kwitset locks specifically" problems.

If that's true, then I believe this issue should be reopened.