FutureTense / keymaster

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

ISSUE: PIN Status stays on "Adding" & Lock and lock, but sees error "Entity not found" #252

Closed nicocoetzee closed 1 year ago

nicocoetzee commented 2 years ago

Describe the bug I installed this via HACS and cannot get it to work properly. The PIN Status stays on "Adding" & Lock and lock, but sees error "Entity not found" and this means non of the user pins are getting registered. I can lock and unlock the lock from Lovelace.

Logs General Server Controls Logs Info Failed connecting to recently alive device at http://192.168.1.4:8091/XD/BO5EBO5E-F00D-F00D-FEED-08DF1F07DE60.xml: UpnpError('Could not find service state table element') 6:48:59 PM – (WARNING) DLNA Digital Media Renderer - message first occurred at 6:19:57 PM and shows up 57 times boltchecked_yeal_deadbolt: Already running 6:42:09 PM – (WARNING) helpers/script.py - message first occurred at 6:42:04 PM and shows up 3 times Unable to find referenced entities timer.keymaster_yeal_deadbolt_autolock 6:27:43 PM – (WARNING) helpers/service.py Template warning: 'int' got invalid input 'unkno' when rendering template '{## This template checks whether the PIN should be considered active based on ##} {## all of the different ways the PIN can be conditionally enabled/disabled ##} {## Get current date and time ##} {% set now = now() %} {## Get current day of week, date (integer yyyymmdd), and time (integer hhmm) ##} {% set current_day = now.strftime('%a')[0:3] | lower %} {% set current_date = now.strftime('%Y%m%d') | int %} {% set current_time = now.strftime('%H%M') | int %} {% set current_timestamp = as_timestamp(now) | int %} {## Get whether date range toggle is enabled as well as start and end date (integer yyyymmdd) ##} {## Determine whether current date is within date range using integer (yyyymmdd) comparison ##} {% set is_date_range_enabled = is_state('input_boolean.daterange_yeal_deadbolt_4', 'on') %} {% set start_date = state_attr('input_datetime.start_date_yeal_deadbolt_4', 'timestamp') | int %} {% set end_date = state_attr('input_datetime.end_date_yeal_deadbolt_4', 'timestamp') | int %} {## Only active if within the full datetime range. To get a single day both start and stop times must be set ##} {% set is_in_date_range = (start_date < end_date and current_timestamp >= start_date and current_timestamp <= end_date) %} {## Get current days start and end time (integer hhmm). Assume time range is considered enabled if start time != end time. ##} {## If time range is inclusive, check if current time is between start and end times. If exclusive, check if current time is before start time or after end time. ##} {% set current_day_start_time = (states('input_datetime.' + current_day + '_start_date_yeal_deadbolt_4')[0:5]).replace(':', '') | int %} {% set current_day_end_time = (states('input_datetime.' + current_day + '_end_date_yeal_deadbolt_4')[0:5]).replace(':', '') | int %} {% set is_time_range_enabled = (current_day_start_time != current_day_end_time) %} {% set is_time_range_inclusive = is_state('input_boolean.' + current_day + '_inc_yeal_deadbolt_4', 'on') %} {% set is_in_time_range = ( (is_time_range_inclusive and (current_time >= current_day_start_time and current_time <= current_day_end_time)) or (not is_time_range_inclusive and (current_time < current_day_start_time or current_time > current_day_end_time)) ) %} {## Get whether code slot is active and current day is enabled ##} {% set is_slot_enabled = is_state('input_boolean.enabled_yeal_deadbolt_4', 'on') %} {% set is_current_day_enabled = is_state('input_boolean.' + current_day + '_yeal_deadbolt_4', 'on') %} {## Check if access limit is enabled and if there are access counts left. ##} {% set is_access_limit_enabled = is_state('input_boolean.accesslimit_yeal_deadbolt_4', 'on') %} {% set is_access_count_valid = states('input_number.accesscount_yeal_deadbolt_4') | int > 0 %} {## Code slot is active if slot is enabled + current day is enabled + date range is not enabled or current date is within date range ##} {## + time range is not enabled or current time is within time range (based on include/exclude) + access limit is not enabled or there are more access counts left ##} {{ is_slot_enabled and is_current_day_enabled and (not is_date_range_enabled or is_in_date_range) and (not is_time_range_enabled or is_in_time_range) and (not is_access_limit_enabled or is_access_count_valid) }}' but no default was specified. Currently 'int' will return '0', however this template will fail to render in Home Assistant core 2022.1 6:27:13 PM – (WARNING) helpers/template.py - message first occurred at 6:27:13 PM and shows up 105 times Cannot add automation.keymaster_front_door_lock_unlocked_start_autolock as this would exceed the 150 device limit. Consider using the filter option 6:20:00 PM – (WARNING) HomeKit - message first occurred at 6:20:00 PM and shows up 190 times Discovery for value Value(value_id='14-49-0-UNKNOWN (0x00)') on device 'Motion - Office' (Node(node_id=14)) will be skipped: Value Value(value_id='14-49-0-UNKNOWN (0x00)') has unknown data in the following location: metadata.cc_specific.sensorType. A reinterview of node Node(node_id=14) may correct this issue, but if it doesn't, please report this issue as it may be caused by either an upstream issue with the driver or missing support for this data in the library 6:19:56 PM – (ERROR) Z-Wave JS

Much appreciated.

Vartkat commented 2 years ago

Quite the same here, Pin Status get stuck (either on Adding or Deleting) :
image

Looking at the ZWaveJS debug log, this seems to be synced with timeouts, even if after several retry it succeeds.

I'm surely missing something here, does Desired Pin State and Pin Status has to be Active and Connected to be sure the code has been memorized by the lock ?

A suggestion, perhaps "connected" is not the right word, wouldn't it be better to use "Acknowledged" (by the lock) or "received" ? Perhaps a extra step to verify if the code is really in the lock is necessary. I'm completly new to this kind of things so these are just suggestions (or I don't get the meaning of Pin Status and Desired Pin State).

Version | core-2021.11.2 Home Assistant Supervised Supervisor | true Docker | true Utilisateur | root virtual | false Python | 3.9.7 Linux 5.10.0-9-arm64 aarch64

And the lock is a BE469ZP from Schlage with Z-Wave chip firmware versions ["3.3","11.0"]

Vart

kaechele commented 2 years ago

I am seeing this (or a similar) issue with my Schlage BE469ZP as well. I cannot change the PIN on Slot 1 & 2 (which happen to be the factory pre-programmed slots that I reprogrammed using the keypad) through keymaster. I can successfully re-program these slots by manually calling the zwave_js.set_lock_usercode service. After doing this and setting the PIN in Keymaster and hitting the Enable toggle, the PIN Status will show up as "Connected" and PIN State as "Active".

nicocoetzee commented 2 years ago

Hi - thanks for the advice. Unfortunately, mine just stays at "adding" even if I use 3 - 5 user codes.

nicocoetzee commented 2 years ago

For some reason on the 5th Code is "connected." I have uninstalled and reinstalled the integration with no luck. Any advice Screen Shot 2021-11-12 at 12 35 11 PM ?

short4bmoney commented 2 years ago

I noticed this same behavior on my end too. Maybe the first 4 slots were occupied with an older Zwave integration or manually by programming on the keypad directly? I don't know if there's a way to view ALL code slots, but that may provide a clue.

Although I don't know if there's a table on Zwave JS to see all existing paramater values, you can call the service zwave_js.clear_lock_usercode and specify a slot number that was not saving a pin via Keymaster. Once successfully executed, try this again for the given slot. On my tries, it worked.

Just be careful you as you may remove a programmed pin. Not sure if the factory pins are stored in slots 1-2.

firstof9 commented 2 years ago

If you enable debugging, and are not seeing the messages: "Attempting to call clear_usercode..." or "Attempting to call set_usercode..." the integration isn't attempting to call the services.

darrylb83 commented 2 years ago

Hello Everyone, I am having this same issue. Stuck on "Adding". This worked a while back (3+ months ago, after Raman helped me). HA Core: 2021.11.4 Things I have checked.

Lots when changing PIN or setting code: 2021-11-29 12:45:35 DEBUG (MainThread) [custom_components.keymaster] DEBUG: Code slot 1 value: 7030 2021-11-29 12:45:35 DEBUG (MainThread) [custom_components.keymaster] Finished fetching keymaster data in 0.000 seconds (success: True)

I enable/disale Code 2 and 3, the debug never changes.

I am open to providing any and all information I can to further diagnose.

Thanks!

darrylb83 commented 2 years ago

If there is anything I can do to help with this, please let me know. More than happy to share anything I can.

firstof9 commented 2 years ago

Go to the info panel and copy/paste what it says for the keymaster entry under system health.

Example: image

nicocoetzee commented 2 years ago

Hi - I dont think anybody on this thread knows how to fix this problem.

nicocoetzee commented 2 years ago

Screen Shot 2021-12-17 at 10 31 42 AM

nicocoetzee commented 2 years ago

Screen Shot 2021-12-17 at 10 36 37 AM

nicocoetzee commented 2 years ago

Screen Shot 2021-12-17 at 10 43 12 AM

firstof9 commented 2 years ago
  • I do not see anything like "Attempting to call.."

If debug is on, this would mean that the automation isn't making the keymaster.add_code service call for some reason.

If you navigate to the automations section and hit the middle icon on the far right column, you can see why the calls are not happening.

Example: image

nicocoetzee commented 2 years ago

This here? Screen Shot 2021-12-17 at 10 51 46 AM

nicocoetzee commented 2 years ago

Screen Shot 2021-12-17 at 10 53 54 AM

nicocoetzee commented 2 years ago

Screen Shot 2021-12-17 at 10 54 12 AM

firstof9 commented 2 years ago

Is your binary_sensor.pin_synched_front_door_1 sensor "on" or "off" ?

nicocoetzee commented 2 years ago

Where do I check that, please?

firstof9 commented 2 years ago

You check that in developer tools - states

nicocoetzee commented 2 years ago

Yep, thank you. I found it. Screen Shot 2021-12-17 at 11 15 24 AM

firstof9 commented 2 years ago

well problem 1) you have no pins assigned to the slots according to your image.

EDIT: and you should be getting error messages in your home-assitant.log stating it cannot add a blank PIN

nicocoetzee commented 2 years ago

If I assign pins the Pin Status stays on "Adding". Screen Shot 2021-12-17 at 11 21 00 AM

nicocoetzee commented 2 years ago

And only "Code 1" is working on the physical lock. "Code 2" pin does not.

firstof9 commented 2 years ago

See if the binary sensors states are all "off"

nicocoetzee commented 2 years ago

The code slots that are enabled have a "on" for "binary_sensor.active_front_door_lock_1" but all binary_sensor.pin_synched_front_door_lock_1 are "off"

firstof9 commented 2 years ago

Ok, and does the automation section say the automation is triggering?

nicocoetzee commented 2 years ago

Only Code 1. Screen Shot 2021-12-17 at 11 21 00 AM

firstof9 commented 2 years ago

Does the trace have any info inside it?

Also check the state of sensor.front_door_code_slot_2 and sensor.front_door_code_slot_1

nicocoetzee commented 2 years ago

Where do I check that please? Also, I keep on getting a notification to enable it to make it active while it is enabled. Not sure if they help in any way Screen Shot 2021-12-17 at 11 41 27 AM .

firstof9 commented 2 years ago

Trace instructions here: https://github.com/FutureTense/keymaster/issues/252#issuecomment-996942655 Sensor states here: https://github.com/FutureTense/keymaster/issues/252#issuecomment-996973903

nicocoetzee commented 2 years ago

Screen Shot 2021-12-17 at 11 44 29 AM Screen Shot 2021-12-17 at 11 44 45 AM

firstof9 commented 2 years ago

That means it fired off the service call, that's good.

nicocoetzee commented 2 years ago

This is interesting. The existing lock codes are displayed here. All but Code 1. But it doesn't show/sync up with Lovelace.

nicocoetzee commented 2 years ago

Screen Shot 2021-12-17 at 11 47 27 AM

firstof9 commented 2 years ago

The sensors are used for code verification of what's in the UI. The UI doesn't update based on what the sensors state.

firstof9 commented 2 years ago

The integration should keep trying to call the add_code service call until the slot reports the PIN you entered.

nicocoetzee commented 2 years ago

It's doesn't. What else can I try?

On Fri, Dec 17, 2021, 11:59 Chris @.***> wrote:

The integration should keep trying to call the add_code service call until the slot reports the PIN you entered.

— Reply to this email directly, view it on GitHub https://github.com/FutureTense/keymaster/issues/252#issuecomment-996998007, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBGIYY2CTATU6OBKTM5DJTUROJCNANCNFSM5HWZQGJA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

firstof9 commented 2 years ago

Well I assume since you entered the code 1111 that the lock is rejecting it. Try entering a valid code.

nicocoetzee commented 2 years ago

Only Code 1 works. It doesn't matter what I enter in the other code slots. It doesn't sync with the lock. I have tried 2021, 1217, etc.

firstof9 commented 2 years ago

If you disable the code slot does the sensor for that slot go blank?

nicocoetzee commented 2 years ago

No, if I disable all the codes slots the sensor still shows the existing codes on the lock. And not the new ones I enter with Keymaster/Home Assistant. Only the first slot is blank Screen Shot 2021-12-17 at 1 06 20 PM .

firstof9 commented 2 years ago

If you enable debugging, do you see any messages in the log saying Attempting to call clear_usercode... or Attempting to call set_usercode... ?

nicocoetzee commented 2 years ago

I dont see anything.

firstof9 commented 2 years ago

Do you at least see the code slots being populated?

darrylb83 commented 2 years ago

Hello,

I've been following this thread, trying to figure out the same issue. In looking at my synchronize_codeslot_front_Door_2, I looked at the trace and got a "userCode for code slot 2 not found". But, when I go to the code slot, I do have a code in there.

WHen I change the PIN this synchronize doesnt execute, so I manually executed it, and it claims there is no code. So there is some form of automation possibly failing?

firstof9 commented 2 years ago

So there is some form of automation possibly failing?

Re-interview your lock.

darrylb83 commented 2 years ago

Reinterviewed. Didn't seem to help/change anything.

On Mon, Jan 17, 2022 at 3:55 PM Chris @.***> wrote:

So there is some form of automation possibly failing?

Re-interview your lock.

— Reply to this email directly, view it on GitHub https://github.com/FutureTense/keymaster/issues/252#issuecomment-1014879723, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKNZ4BN4GPUPAI5ZIEFY33UWR64PANCNFSM5HWZQGJA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

-- Darryl K Barney Jr 407-421-8495

firstof9 commented 2 years ago

I'd need to see the full error message to accurately tell you what the problem is.

darrylb83 commented 2 years ago

Understood, I'll gather any and all info I can. But I dont have any errors showing in the log.

On Mon, Jan 17, 2022 at 6:53 PM Chris @.***> wrote:

I'd need to see the full error message to accurately tell you what the problem is.

— Reply to this email directly, view it on GitHub https://github.com/FutureTense/keymaster/issues/252#issuecomment-1014960266, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKNZ4FGJ5HVIZ5ZLHIR3BTUWSTZBANCNFSM5HWZQGJA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>

-- Darryl K Barney Jr 407-421-8495