Getting errors with lock codes and rule machine

This is related to my last post. There is either a bug of some sort, or I am doing something wrong.

Pertinent info: Hubitat C-5, 2.3.5.152, Rule Machine 5.1 used to control Generic Z-Wave Lock device.

When I try to run custom action:

setCode (99, '112233', 'TestName')

the code IS properly added to the lock, but this prompts a lock code report to be started which takes a VERY long time, slows down the responsiveness of the lock, and has a massive impact on the battery level of the lock.

Then, when I try to remove the code with the following

deleteCode (99, '112233', 'TestName')

the code fails to remove from the lock and generates the following error in the log:

  • deleteCode(codeposition)
    • codeposition required (NUMBER) - Code position number to delete

It is set like this:

codeposition is type "number", 99 in this case
other values are string.

deleteCode() takes a single argument, which is the code position (a number). The extraneous things you are passing to deleteCode() are causing the error.

1 Like

OH!! Dang! Well that was a simple fix.

Is there anyting I am doing wrong which is causing that code audit to start every time I use the setCode command?

1 Like

What happens if you use the very next available slot position, while creating the code, instead of 99?

I will try this asap and report back.

I picked 99 because it's easy to remember and I was hoping I could just use that for any temporary codes. That way I can avoid having to go back and modify the rules in the future should I add more permanent codes to the lock which may take the location of the current "next empty" slot, if that makes any sense...

So, even after letting things sit overnight, the getCodes function was stopped at code 218 of 250. Took trying to force some codes to get it to start the process again and once it finally scanned thru all 250 code slots, I removed code 99 and tried putting it in slot 7 which was the next open one. It seems to have worked properly.

Fingers crossed, I think it may be working properly.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.