FutureTense / keymaster

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

ISSUE: Unexpected error fetching keymaster data: 'response' #225

Closed copart closed 3 years ago

copart commented 3 years ago

1) HA takes a very long to start with keymaster installed. 2) PIN Status remains on "Adding" after setting a pin in UI and flipping it the Enabled, the pin is NOT added to the lock

A clear and concise description of what the bug is.

Environment (please complete the following information):

Logs Unexpected error fetching keymaster data: 'response' 9:34:50 AM – (ERROR) keymaster (custom integration) - message first occurred at 9:19:39 AM and shows up 82 times Setup of sensor platform keymaster is taking over 10 seconds. 9:19:37 AM – (WARNING) Sensor

detail of the warning Logger: homeassistant.components.sensor Source: /usr/local/lib/python3.9/asyncio/events.py:80 Integration: Sensor (documentation, issues) First occurred: 9:19:37 AM (1 occurrences) Last logged: 9:19:37 AM

Setup of sensor platform keymaster is taking over 10 seconds.

detail of the error Logger: custom_components.keymaster Source: custom_components/keymaster/init.py:623 Integration: keymaster (documentation, issues) First occurred: 9:19:39 AM (82 occurrences) Last logged: 9:34:50 AM

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 586, in async_update_usercodes
    return await self._async_update()
  File "/config/custom_components/keymaster/__init__.py", line 623, 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(CommandClass.USER_CODE, "get", code_slot)
  File "/usr/local/lib/python3.9/site-packages/zwave_js_server/model/endpoint.py", line 126, in async_invoke_cc_api
    return result["response"]
KeyError: 'response'

additional Not sure if this is related, however, when I start HA, I also have the following error in the logs: Logger: homeassistant Source: runner.py:87 First occurred: 9:19:35 AM (1 occurrences) Last logged: 9:19:35 AM

Error doing job: Task was destroyed but it is pending!

firstof9 commented 3 years ago

This looks like your USER CODEs are potentially not populated.

copart commented 3 years ago

This looks like your USER CODEs are potentially not populated.

something I can try?

raman325 commented 3 years ago

can you enable debug logs for the zwave_js_server library? Then share those debug logs, we should be able to see what the response is and why it is not expected

copart commented 3 years ago

I just did this: Z-Wave JS Logs

Log Level Debug

btw, I am using ZWaveJS2MQTT

copart commented 3 years ago

I have a feeling this may not be keymaster issue:

2021-09-10T20:45:40.408Z CNTRLR [Node 008] Timed out while waiting for a response from the node 2021-09-10T20:45:56.373Z CNTRLR [Node 008] Timed out while waiting for a response from the node 2021-09-10T20:46:12.399Z CNTRLR [Node 008] Timed out while waiting for a response from the node 2021-09-10T20:46:28.371Z CNTRLR [Node 008] Timed out while waiting for a response from the node

Node 008 is my kwikset

firstof9 commented 3 years ago

Those would be Zwave RF issues

Snuffy2 commented 3 years ago

Having the same issue and errors as above. Also using zwavejs2mqtt. Code slots are not writing and just sit at Adding or Deleting.

Also seeing the same [Node 072] Timed out while waiting for a response from the node (Node 072 is the lock)

2021-10-10 21:27:49 ERROR (MainThread) [custom_components.keymaster] 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 605, in async_update_usercodes
return await self._async_update()
File "/config/custom_components/keymaster/__init__.py", line 642, 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/endpoint.py", line 126, in async_invoke_cc_api
return result["response"]
KeyError: 'response'

zwave_js.log

firstof9 commented 3 years ago

That looks like a library issue, make sure you're up to date on HA and zwavejs2mqtt.