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

Schlage lock always unavailable #103197

Closed
pm0u opened this issue Nov 1, 2023 · 9 comments
Closed

Schlage lock always unavailable #103197

pm0u opened this issue Nov 1, 2023 · 9 comments

Comments

@pm0u
Copy link

pm0u commented Nov 1, 2023

The problem

Followup to #103040

This resolved adding the lock to HA, however all sensors for the lock show as "Unavailable." Additionally, the firmware version reported in HA does not match what is shown in SchlageHome.

I am able to interact with the lock properly via the SchlageHome App on both local network and outside.

The lock is an Encode, WiFi.

What version of Home Assistant Core has the issue?

core-2023.11.0b5

What was the last working version of Home Assistant Core?

None

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Schlage

Link to integration documentation on our website

https://www.home-assistant.io/integrations/schlage/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

There seems to be continuous attempts to connect to the lock, which appear to succeed, these logs go on further - redacted for repeats:

2023-11-01 13:36:49.141 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.690 seconds (success: True)
2023-11-01 13:37:21.381 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.932 seconds (success: True)
2023-11-01 13:37:53.280 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.830 seconds (success: True)
2023-11-01 13:38:25.219 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.769 seconds (success: True)
2023-11-01 13:38:56.338 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 0.888 seconds (success: True)
2023-11-01 13:39:28.201 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.751 seconds (success: True)
2023-11-01 13:40:00.029 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.579 seconds (success: True)
2023-11-01 13:40:32.163 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.713 seconds (success: True)
2023-11-01 13:41:04.183 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.733 seconds (success: True)
2023-11-01 13:41:35.883 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.433 seconds (success: True)
2023-11-01 13:42:07.207 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.757 seconds (success: True)
2023-11-01 13:42:39.124 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.674 seconds (success: True)
2023-11-01 13:43:11.471 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 2.021 seconds (success: True)
2023-11-01 13:43:43.324 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.873 seconds (success: True)
2023-11-01 13:44:15.074 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.624 seconds (success: True)
2023-11-01 13:44:47.090 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.639 seconds (success: True)
2023-11-01 13:45:19.025 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.574 seconds (success: True)
2023-11-01 13:45:51.307 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.858 seconds (success: True)
2023-11-01 13:46:25.902 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 4.451 seconds (success: True)
2023-11-01 13:46:57.450 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 2.000 seconds (success: True)
2023-11-01 13:47:29.092 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.642 seconds (success: True)
2023-11-01 13:48:01.126 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.676 seconds (success: True)
2023-11-01 13:48:32.580 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.130 seconds (success: True)
2023-11-01 13:49:04.074 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.624 seconds (success: True)
2023-11-01 13:49:35.988 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.538 seconds (success: True)
2023-11-01 13:50:07.105 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.655 seconds (success: True)
2023-11-01 13:50:38.865 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.416 seconds (success: True)
2023-11-01 13:51:10.245 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.795 seconds (success: True)
2023-11-01 13:51:42.148 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.698 seconds (success: True)
2023-11-01 13:52:14.301 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.851 seconds (success: True)
2023-11-01 13:52:45.991 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.540 seconds (success: True)
2023-11-01 13:53:17.167 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.717 seconds (success: True)
2023-11-01 13:53:49.067 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.617 seconds (success: True)
2023-11-01 13:54:21.333 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.882 seconds (success: True)
2023-11-01 13:54:53.044 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.595 seconds (success: True)
2023-11-01 13:55:25.465 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 2.016 seconds (success: True)
2023-11-01 13:55:56.895 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.445 seconds (success: True)
2023-11-01 13:56:28.347 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.896 seconds (success: True)
2023-11-01 13:56:59.836 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.387 seconds (success: True)
2023-11-01 13:57:31.074 DEBUG (MainThread) [homeassistant.components.schlage] Finished fetching schlage (paul.mourer@gmail.com) data in 1.625 seconds (success: True)

Additional information

There is a little alert (!) on the wifi settings menu in the schlage home app, but it is connected according to the app and my router shows a DHCP entry for the lock. The lock is connected to a triple broadcast 6/5/2.4ghz network. I am able to control the lock and view all sensors in the schlage home app.

@home-assistant
Copy link

home-assistant bot commented Nov 1, 2023

Hey there @dknowles2, mind taking a look at this issue as it has been labeled with an integration (schlage) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of schlage can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign schlage Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


schlage documentation
schlage source
(message by IssueLinks)

@pm0u
Copy link
Author

pm0u commented Nov 2, 2023

image

@dknowles2
Copy link
Contributor

Let me add diagnostics support to the integration so you can safely provide debugging information.

I just pushed dknowles2/pyschlage#103 to add support to the underlying library. I need to wire it up to HA.

@pm0u
Copy link
Author

pm0u commented Nov 3, 2023

Ok, thanks! Happy to test when that's available

@morikplay
Copy link

I'm experiencing the same issue. Schlage encode integration does not seem to function. Rather than create a new ticket, i figured i'd add relevant information to this thread.

Core: 2023.11.1
Supervisor: 2023.10.1
OS: 11.1
Frontend: 20231030.1

Debug log for a previously working Schlage integration (retry=3) indicated the following:

2023-11-07 11:22:11.214 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry xyz@abc.com for schlage
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/schlage/__init__.py", line 27, in async_setup_entry
    auth = await hass.async_add_executor_job(pyschlage.Auth, username, password)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyschlage/auth.py", line 86, in __init__
    self.cognito = pycognito.Cognito(
                   ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pycognito/__init__.py", line 208, in __init__
    self.client = boto3.client("cognito-idp", **boto3_client_kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/boto3/__init__.py", line 92, in client
    """
        
  File "/usr/local/lib/python3.11/site-packages/boto3/session.py", line 299, in client
    :type use_ssl: boolean
           ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 971, in create_client
    self._session = session
                    ^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 1042, in _resolve_defaults_mode
    env_var_names = None
                         
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 818, in _get_internal_component
    'response_parser_factory')
       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 1140, in get_component
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 216, in create_default_config_resolver
    try:
         
  File "/usr/local/lib/python3.11/site-packages/botocore/loaders.py", line 471, in load_data
  File "/usr/local/lib/python3.11/site-packages/botocore/loaders.py", line 142, in _wrapper
  File "/usr/local/lib/python3.11/site-packages/botocore/loaders.py", line 453, in load_data_with_path
    :type extra_models: iterable of dict
botocore.exceptions.DataNotFoundError: Unable to load data for: sdk-default-configuration
2023-11-07 11:24:28.708 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry xyz@abc.com for schlage
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/schlage/__init__.py", line 27, in async_setup_entry
    auth = await hass.async_add_executor_job(pyschlage.Auth, username, password)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyschlage/auth.py", line 86, in __init__
    self.cognito = pycognito.Cognito(
                   ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pycognito/__init__.py", line 208, in __init__
    self.client = boto3.client("cognito-idp", **boto3_client_kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/boto3/__init__.py", line 92, in client
    """
        
  File "/usr/local/lib/python3.11/site-packages/boto3/session.py", line 299, in client
    :type use_ssl: boolean
           ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 971, in create_client
    self._session = session
                    ^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 1042, in _resolve_defaults_mode
    env_var_names = None
                         
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 818, in _get_internal_component
    'response_parser_factory')
       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 1140, in get_component
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 216, in create_default_config_resolver
    try:
         
  File "/usr/local/lib/python3.11/site-packages/botocore/loaders.py", line 471, in load_data
  File "/usr/local/lib/python3.11/site-packages/botocore/loaders.py", line 142, in _wrapper
  File "/usr/local/lib/python3.11/site-packages/botocore/loaders.py", line 453, in load_data_with_path
    :type extra_models: iterable of dict
botocore.exceptions.DataNotFoundError: Unable to load data for: sdk-default-configuration
2023-11-07 11:26:50.227 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry xyz@abc.com for schlage
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/schlage/__init__.py", line 27, in async_setup_entry
    auth = await hass.async_add_executor_job(pyschlage.Auth, username, password)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyschlage/auth.py", line 86, in __init__
    self.cognito = pycognito.Cognito(
                   ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pycognito/__init__.py", line 208, in __init__
    self.client = boto3.client("cognito-idp", **boto3_client_kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/boto3/__init__.py", line 92, in client
    """
        
  File "/usr/local/lib/python3.11/site-packages/boto3/session.py", line 299, in client
    :type use_ssl: boolean
           ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 971, in create_client
    self._session = session
                    ^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 1042, in _resolve_defaults_mode
    env_var_names = None
                         
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 818, in _get_internal_component
    'response_parser_factory')
       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 1140, in get_component
  File "/usr/local/lib/python3.11/site-packages/botocore/session.py", line 216, in create_default_config_resolver
    try:
         
  File "/usr/local/lib/python3.11/site-packages/botocore/loaders.py", line 471, in load_data
  File "/usr/local/lib/python3.11/site-packages/botocore/loaders.py", line 142, in _wrapper
  File "/usr/local/lib/python3.11/site-packages/botocore/loaders.py", line 453, in load_data_with_path
    :type extra_models: iterable of dict
botocore.exceptions.DataNotFoundError: Unable to load data for: sdk-default-configuration

@dknowles2
Copy link
Contributor

@morikplay that's a different problem. Please file a separate issue.

@morikplay
Copy link

@dknowles2 thank you for the guidance. I'll file a separate issue. Your Enable debug logging additions do work!

@pm0u
Copy link
Author

pm0u commented Nov 12, 2023

ok well, I think I've narrowed this down to a local network issue but I have no idea what that issue is.

I noticed that if I have Bluetooth off on my phone, the schlage app is unable to connect to my lock. Additionally, I recently tried to access my lock away from home for the first time, out of Bluetooth range, and the lock was unavailable in the app.

so, I think it appeared I was connecting to my lock fine but the app must default to a Bluetooth connection when it's in range.

I'm not sure where to begin on the network, I have a TP link ax73 with more or less out of the box settings. broadcasting one SSID 2.4/5 and a guest network on 2.4 only which the lock connects to. I have also tried connecting the lock to the dual band SSID with the same result.

I may make a hotspot with my phone tomorrow and see if setting up the lock on that allows HA to see it

@pm0u
Copy link
Author

pm0u commented Nov 12, 2023

Ok well, one more factory reset on the lock later and this is now working, I'm not sure what prevented it in the past.

Currently connected to the 5/2.4 dual broadcast SSID. I do now have wireless multicast enabled and IGMP snooping, although I am unsure if multicast was enabled in the past. I had toggled these before but the factory reset seems to have done the trick.

Things that would identify this issue:

  • A little (1) icon on your wifi settings in the schlage app (unfortunately, there's no more feedback than this provided). I believe this indicates it can't connect to cloud
  • Can connect to lock "within your home" - this is within bluetooth range of the lock
  • Lock becomes unavailable with bluetooth off or when far away from lock (outside of bluetooth range)

Appreciate the investigating and the addition of the diagnostics, I am sure they will be useful in the future!

@pm0u pm0u closed this as completed Nov 12, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants