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

Initial Setup Issue #1

Open
tslpre opened this issue Jul 15, 2020 · 6 comments
Open

Initial Setup Issue #1

tslpre opened this issue Jul 15, 2020 · 6 comments

Comments

@tslpre
Copy link

tslpre commented Jul 15, 2020

Hello! This module is a good idea, definitely useful to cover something that it's missing!

However I've tried to set this up and failed:

  1. the configuration example talks about using "lock_manager:" while I believe it's "lock_history:"
  2. If I configure it as "lock_history" and then restart Hassio, I always get this error:

ERROR (MainThread) [homeassistant.setup] Error during setup of component lock_history Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 193, in _async_setup_component result = await asyncio.wait_for(task, SLOW_SETUP_MAX_WAIT) File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for return fut.result() File "/config/custom_components/lock_history/__init__.py", line 278, in async_setup await manager.async_initialize() File "/config/custom_components/lock_history/__init__.py", line 173, in async_initialize self._history = raw_storage["history"] TypeError: 'NoneType' object is not subscriptable

I have a Zipato RFID Keypad

Environment information:

  1. I am on Homeassistant 0.112.4 on a Raspberry Pi 3B+
  2. Supervisor: 228
  3. HassOS: 4.11 production
  4. Relevant configuration snippet (real username changed to "User" and real code changed to xx xx etc.):

lock_history: zwave_node_id: 2 ozw_log: /config/OZW_Log.txt tags: - name: User user_code: xx xx xx xx xx xx xx xx xx xx

Is there anything I'm doing wrong? Happy to support with testing...

@tslpre
Copy link
Author

tslpre commented Jul 16, 2020

Great! Some progress made - I can now load the component without any error and add the lovelace card. However, it is completely empty (a part from the title). I've triggered the keypad twice, and verified the node id and tag code. I can find the tag in the OZW_Log.txt file as well.

Following the example config, I've just added it next to other existing ones with a custom card:

type: 'custom:user-code'

Looks like I might be missing something? As far I can see, no entities are created, so I guess that the custom card would be the only way to get the history (but please correct me if I'm wrong).
If helps, I can increase the log level as well, just let me know the exact name of the component and I'll test. :)

@janpascal
Copy link
Owner

There's a few things you could have a look at:

  • In het browser, check the Javascript console logging in the developer tools. Maybe there is an error there
  • Same for home-assistant.log in het Home Assistant directory. Check for "log_manager".

The beginning it should show something like:

2020-07-22 22:02:37 INFO (MainThread) [custom_components.lock_manager] lock_node_id: 3
2020-07-22 22:02:37 INFO (MainThread) [custom_components.lock_manager] Using default OpenZWave log location: /var/lib/homeassistant/OZW_Log.txt
2020-07-22 22:02:37 INFO (MainThread) [custom_components.lock_manager] async_initialize finished
2020-07-22 22:02:37 INFO (MainThread) [homeassistant.setup] Setup of domain lock_manager took 0.0 seconds

Check if the log file location and the node id of the lock. It should be the z-wave node id of the 'access_control' node. Check in the Home Assistant web frontend, under Settings/Integrations/Z-Wave/Entities. Look for 'Schlage Link Mini Keypad RFID Access Control'. Click on it, and then on the 'settings' icon in the top right corner. Check the node id, and compare it with the lock_node_id from above.

When you use an RFID tag to enable/disable the alarm system, the log file should contain line like these:


2020-07-22 22:05:44 INFO (MainThread) [custom_components.lock_manager] Access control changed
2020-07-22 22:05:44 INFO (MainThread) [custom_components.lock_manager] New state is 5 (AWAY)
2020-07-22 22:05:45 INFO (MainThread) [custom_components.lock_manager] Adding to history: used tag 2 (Jan-Pascal) for new state Away
  • Check the .storage/lock_manager file under the Home Assistant directory. Is should contain a JSON file with the data about which tag was used when to change the alarm state (Home/Away).

Hope this helps you a bit further!

Jan-Pascal

@tslpre
Copy link
Author

tslpre commented Jul 27, 2020

Thank you very much for your support!

I've been looking at the console, but couldn't find anything related. The homeassistant log is quite different instead. The relevant lines are:

2020-07-27 22:02:04 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for lock_history 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.
2020-07-27 22:04:49 INFO (MainThread) [custom_components.lock_history] async_initialize finished
2020-07-27 22:05:10 DEBUG (MainThread) [custom_components.lock_history] Ignoring user code #0
2020-07-27 22:05:10 DEBUG (MainThread) [custom_components.lock_history] Adding usercode at slot 1: xx xx xx xx xx xx xx xx xx xx
2020-07-27 22:05:10 DEBUG (MainThread) [custom_components.lock_history] Adding usercode at slot 2: xx xx xx xx xx xx xx xx xx xx
2020-07-27 22:05:10 DEBUG (MainThread) [custom_components.lock_history] Adding usercode at slot 3: xx xx xx xx xx xx xx xx xx xx
2020-07-27 22:05:10 DEBUG (MainThread) [custom_components.lock_history] Adding usercode at slot 4: xx xx xx xx xx xx xx xx xx xx

When I scan a RFID, no entries are recorded in the log.
Obviously, the key difference is that I had to rename "lock_manager:" in the configuration file to "lock_history:" otherwise HA was complaining that the component lock_manager did not exist... And this is clearly consistent with your configuration example, but not working at all if implemented... It's almost like we were not using the exact same version of the component.

@janpascal
Copy link
Owner

janpascal commented Jul 27, 2020 via email

@tslpre
Copy link
Author

tslpre commented Nov 18, 2020

Hello @janpascal - did you had by any chance some time to check if the version here on Github is the same you are using on your system?

I can help doing some testing, if needed 😃

@tslpre
Copy link
Author

tslpre commented Nov 20, 2020

@janpascal - I found the issue - took some time but I realized that the sensor's name is stored in the code and my zipato lock has a different one: sensor.schlage_link_wintop_mini_keypad_rfid_access_control

Changing the sensor name, made the addon work flawlessly... I guess that we can consider this issue good to be closed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants