janpascal / ha_lock_history

Home Assistant custom component and Lovelace UI that keeps history of the tags that are used to lock and unlock a Z-Wave lock
GNU General Public License v3.0
1 stars 1 forks source link

Initial Setup Issue #1

Open tslpre opened 4 years ago

tslpre commented 4 years ago

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:

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

tslpre commented 4 years ago

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 commented 4 years ago

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

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

Hope this helps you a bit further!

Jan-Pascal

tslpre commented 4 years ago

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 commented 4 years ago

That's what I was thinking too, I'll have to look into it when I have some time

tslpre notifications@github.com schreef op 27 juli 2020 22:23:25 CEST:

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.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/janpascal/ha_lock_history/issues/1#issuecomment-664618635

-- Verstuurd vanaf mijn Android apparaat met K-9 Mail. Excuseer mijn beknoptheid.

tslpre commented 3 years ago

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 commented 3 years ago

@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 👍