FutureTense/keymaster

ISSUE: auto re-lock no longer working as of 0.0.86

Closed this issue ยท 16 comments

  • OS: HAOS 11.1
  • Core: 2023.11.2
  • Supervisor: 2023.11.3
  • Frontend: 20231030.2
  • Component version: 0.0.86
  • Z-Wave integration name: zwave_js
  • Lock make and model: Yale NF-YRD622-ZW2

Logs
Logger: homeassistant.components.automation.keymaster_frontdoor_lock_notifications
Source: helpers/script.py:1783
Integration: Automation (documentation, issues)
First occurred: 9:02:18 AM (3 occurrences)
Last logged: 9:03:04 AM

keymaster_frontdoor_start_timer: Error executing script. Error for call_service at pos 4: Timer timer.keymaster_frontdoor_autolock is not running, only active timers can be changed
9:02:58 AM โ€“ (ERROR) Script

Click on SUBMIT below to confirm you have fixed this automation.

I recently re-installed keymaster as I was unable to add/remove lock codes. That issue is fixed, however now auto lock functionality will work.

I have re-generated packages multiple times along with looking at my automation scripts, which all seem to be in order.

keymaster_frontdoor Lock Notifications: Error executing script. Service not found for call_service at pos 1: Unable to find service script.keymaster_frontdoor_manual_notify

This error is because you haven't created a notify script.
See the wiki.

Ahh, I re-named my device when setting back up. Thanks for the catch on that. Fixed!

I'll go ahead and edit my issue description.

If you changed the name, use the keymaster.generate_package service call to regenerate the template scripts.
Let me know if that helps.

If you changed the name, use the keymaster.generate_package service call to regenerate the template scripts. Let me know if that helps.

I did regenerate after every change here. No changes to the autolock, no counting when the door is closed and unlocked.

I'm not entirely sure as I never used the autolock or door counting stuff.
What do the script/automation traces say?

Having same issue as @mattriney. Looking through the Home Assistant timer documents, service: timer.change can only be used on an active timer. The autolock script is applying that service call to an idle timer which is giving the error (line 111 of keymaster_common.yaml).

@roblamoreaux, thoughts?

@firstof9 I did some more research and found this thread on the issue. The workaround seemed to be to start the timer and then call the timer.change service. At the end of the thread there was mention that the timer start parameter was not being deprecated (See here) I have no idea if it will be removed in the future.

So maybe the order of operations is wrong? the timer.start needs to come before the timer.change

I just did a test and if you use timer.start without setting a duration it defaults to a duration of 0. I tried running a script with timer.start and then timer.change to add time to the timer entity but I received the error about only active timers can be changed. I think the changes in release 0.086 need to be reverted back to 0.085 where timer.start was used instead of timer.change.

@roblamoreaux, thoughts?

I am not sure. my instance auto-relocks with the changes I pushed. if the change to HA was reverted and it won't break keymaster I see no reason not to revert back.

I'm just confused why it would break for others when I've had it running without issue for a week.

If you unlock one of your doors that auto-relic is you arenโ€™t seeing the timer error in your logs? My locks still auto-relock but that is probably because I had set them to auto-relock via the lock interface before I had keymaster installed.

I just did some checking and the change should be rolled back. I Missed that changing the code in the custom directory didn't change the existing scripts it created. After manually changing the created script, it broke.

So please roll back the change

Reverted in 0.0.87

Resolved in 0.0.87.

Thanks!