Rule to add or delete a lock code

I know Schlege BE469 locks are not approved devices, but it's what I have.

I'm trying to use Rule Machine to add and delete codes.

But the only options I see only lets me add the code...not a user or position and it doesn't seem to work when I run it.

Is there a way to do this?

Try the built-in Lock Code Manager app. I do not know if it works with your particular lock but it is designed to manage locks and codes.

You can; I have done this routinely.

Unfortunately, I don't have my hubs running right now, or I would cut and paste a couple rules for you.

The thing you have to know is that setCode() and deleteCode() take arguments (parameters in RM). From the documentation:

deleteCode(codeposition) takes a single parameter, codeposition, which has to be a NUMBER.

setCode(codeposition, pincode, name) takes three parameters.
codeposition must be a NUMBER
pincode and name must be STRINGS

Yes, but there's a built-in driver for them, which supports setCode() and deleteCode() just fine.

Edit: Here's an example from @bravenel

1 Like

THANKS! It would be nice if it was clear in rule machine what the right syntax for the fields are.

I know...that's a newbie thing :slight_smile:

1 Like

I understand where you're coming from. But believe me, it is all in the documentation. So in RM, when you use a custom action, there are two ways to know what parameters can be used, and their type (String, Number etc).

  1. You can look up the command on the device page for the device in question (in this case your lock).
  2. You can look up the Hubitat driver capability list. I have tended to go here - because I find it easier to understand. This is the link that I use:
1 Like

That is EXACTLY what I need THANKS!!!!

1 Like