Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration making zwave locks unavailable #139

Open
pdobrien3 opened this issue Apr 4, 2024 · 13 comments
Open

Integration making zwave locks unavailable #139

pdobrien3 opened this issue Apr 4, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@pdobrien3
Copy link

What happened?

I have been having issues with locks dropping off the zwave network using lock code manager. After playing a bit, I decided to start listening to zwave_js_notification lock events. What I am seeing is (event_label == 'New user code added') followed by (event.data.event_label == 'New user code not added due to duplicate code')

It is not happening on every code slot or every lock and seems to be pretty random.

I have noticed that if I go into the ZwaveJS UI and set a fake code on the slot I can get all the slots sync'ed, otherwise the integration continues until the lock goes unavailable or times out. Activating the lock usually brings it back

Steps to reproduce the issue

...

Home Assistant Version

2024.4.0

What version of Lock Code Manager are you running?

0.4.5

Lock make and model

Kwikset 916 Zwave

Relevant log output

No response

Screenshots

No response

Anything else?

No response

@pdobrien3 pdobrien3 added the bug Something isn't working label Apr 4, 2024
@raman325
Copy link
Owner

raman325 commented Apr 5, 2024

do you know if this happens on startup? at random times? When the code is supposed to go from inactive to active?

@pdobrien3
Copy link
Author

i think it is any time the lock is not sync'd. defiantly at startup. and it seems like it times out trying at startup. i have 6 different codes on 3 different locks. i have also noticed locks go unavailable when the locks should be going from inactive to acrive so i would suspect then also.

@flyize
Copy link

flyize commented May 7, 2024

I just started using this and I'm seeing my locks and code slots showing as unavailable in the Lock Code Manager dashboard randomly, and for sure at startup.

Not sure if that is related. No errors in the logs (just the depreciation warnings).

@raman325
Copy link
Owner

is this still an issue on the latest version? @pdobrien3 let me know if you see an improvement

@fxfitz
Copy link

fxfitz commented Jun 18, 2024

Well, I noticed this once. This is my first time trying to get Lock Code Manager up and running through (still overall unsuccessful).

Noticed this in the logs:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 809, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/lock_code_manager/__init__.py", line 298, in async_unload_entry
    await async_unload_lock(hass, config_entry)
  File "/config/custom_components/lock_code_manager/__init__.py", line 276, in async_unload_lock
    coordinator: LockUsercodeUpdateCoordinator = hass_data[COORDINATORS].pop(
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'lock.front_door_new_lock'






2024-06-18 06:21:25.967 INFO (MainThread) [custom_components.lock_code_manager] c1e144d3e2a8cb4c19ab7f4b2cbdbb1f (House Locks): Creating and/or updating entities
2024-06-18 06:21:25.968 DEBUG (MainThread) [custom_components.lock_code_manager] c1e144d3e2a8cb4c19ab7f4b2cbdbb1f (House Locks): Adding following locks: ['lock.front_door_new_lock']
2024-06-18 06:21:25.968 DEBUG (MainThread) [custom_components.lock_code_manager] c1e144d3e2a8cb4c19ab7f4b2cbdbb1f (House Locks): Reusing lock instance for lock ZWaveJSLock(domain=zwave_js, lock=lock.front_door_new_lock)
2024-06-18 06:21:25.968 DEBUG (MainThread) [custom_components.lock_code_manager] c1e144d3e2a8cb4c19ab7f4b2cbdbb1f (House Locks): Lock lock.front_door_new_lock is not connected to Home Assistant yet, waiting 1 seconds before retrying
2024-06-18 06:21:26.970 DEBUG (MainThread) [custom_components.lock_code_manager] c1e144d3e2a8cb4c19ab7f4b2cbdbb1f (House Locks): Lock lock.front_door_new_lock is not connected to Home Assistant yet, waiting 2 seconds before retrying
2024-06-18 06:21:28.971 DEBUG (MainThread) [custom_components.lock_code_manager] c1e144d3e2a8cb4c19ab7f4b2cbdbb1f (House Locks): Lock lock.front_door_new_lock is not connected to Home Assistant yet, waiting 4 seconds before retrying
2024-06-18 06:21:32.973 DEBUG (MainThread) [custom_components.lock_code_manager] c1e144d3e2a8cb4c19ab7f4b2cbdbb1f (House Locks): Lock lock.front_door_new_lock is not connected to Home Assistant yet, waiting 8 seconds before retrying
2024-06-18 06:21:39.569 DEBUG (MainThread) [custom_components.lock_code_manager] c1e144d3e2a8cb4c19ab7f4b2cbdbb1f (House Locks): Lock lock.front_door_new_lock is not connected to Home Assistant yet, waiting 64 seconds before retrying
2024-06-18 06:21:40.974 DEBUG (MainThread) [custom_components.lock_code_manager] c1e144d3e2a8cb4c19ab7f4b2cbdbb1f (House Locks): Lock lock.front_door_new_lock is not connected to Home Assistant yet, waiting 16 seconds before retrying
2024-06-18 06:21:56.977 DEBUG (MainThread) [custom_components.lock_code_manager] c1e144d3e2a8cb4c19ab7f4b2cbdbb1f (House Locks): Lock lock.front_door_new_lock is not connected to Home Assistant yet, waiting 32 seconds before retrying
2024-06-18 06:22:06.715 DEBUG (MainThread) [custom_components.lock_code_manager] aa6543708b411ce25f53919c4da15db7 (House Locks): Lock lock.front_door_new_lock is not connected to Home Assistant yet, waiting 180 seconds before retrying
2024-06-18 06:22:28.979 DEBUG (MainThread) [custom_components.lock_code_manager] c1e144d3e2a8cb4c19ab7f4b2cbdbb1f (House Locks): Lock lock.front_door_new_lock is not connected to Home Assistant yet, waiting 64 seconds before retrying
2024-06-18 06:22:43.570 DEBUG (MainThread) [custom_components.lock_code_manager] c1e144d3e2a8cb4c19ab7f4b2cbdbb1f (House Locks): Lock lock.front_door_new_lock is not connected to Home Assistant yet, waiting 128 seconds before retrying```

Note: lock.front_door_new_lock definitely is connected at this time.

@pdobrien3
Copy link
Author

nothing ever happened for me. i added the integration a couple days ago, several hass restarts, and nothing. i havent had any entities populate or anything.

@fxfitz
Copy link

fxfitz commented Jun 18, 2024

That's basically where I am too, @pdobrien3.

Curious if you were to enable debug logging, are you seeing a <lock entity> is not connected to Home Assistant yet, waiting XXX seconds before retrying message similar to mine? (note: my lock is definitely connected to HA, and I'm able to control it)

@pdobrien3
Copy link
Author

yesterday I started having connection problems with my locks so I deleted the integration.

@raman325
Copy link
Owner

yeah unfortunately something the integration is doing is knocking the locks offline. I suspect I'm queuing up a bunch of commands to the lock and at some point they get overwhelmed and go dead? idk, but until this is fixed this integration is not usable

@flyize
Copy link

flyize commented Jun 24, 2024

My locks show connected just fine, but all the slots are showing as unavailable. Not sure if that helps...

@uSlackr
Copy link

uSlackr commented Jun 24, 2024 via email

@bwarden
Copy link

bwarden commented Jun 27, 2024

Grasping at straws here, but tracing through the code leading up to the "...is not connected to Home Assistant..." message, I decided to dump the data used here;

async def async_is_connection_up(self) -> bool:
"""Return whether connection to lock is up."""
if (
client := (
self.lock_config_entry.runtime_data
if hasattr(self.lock_config_entry, "runtime_data")
and self.lock_config_entry.runtime_data
else self.hass.data.get(ZWAVE_JS_DOMAIN, {})
)
.get(self.lock_config_entry.entry_id, {})
.get(DATA_CLIENT)
) is None:
return False
return (
self.lock_config_entry.state == ConfigEntryState.LOADED
and client.connected
and client.driver is not None
)

My lock's runtime_data looks like this:

{
  'client': Client(ws_server_url='ws://localhost:3009', connected),
  'driver_events': <homeassistant.components.zwave_js.DriverEvents object at 0x7f7b2602d070>,
  'client_listen_task': <Task pending name='Task-342' coro=<client_listen() running at /srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/zwave_js/__init__.py:916> wait_for=<Future pending cb=[Task.task_wakeup()]>>,
  'start_client_task': <Task finished name='Task-341' coro=<start_client() done, defined at /srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/zwave_js/__init__.py:194> result=None>
}

client has no driver member; maybe because I'm running node-zwave-js in a snap and connecting Home Assistant to it via websocket?

ETA: I think the "...is not connected..." message and failure of this integration to configure the locks is a separate issue from the locks themselves becoming unavailable.

@broyuken
Copy link

I have a similar issue where my lock goes unavailable when my automation triggers it to lock. It comes back a few seconds later but the lock command fails. I think this MAY happen after I’ve added a new code that needs to get pushed to the lock or something but I haven’t been able to confirm that yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants