Help with lock codes per day

I am struggling with this concept. I would like to have rule machine create a code for housekeeper to come in my house on Tuesdays, but not be able to utilize the code on any other day of the week. Does someone have an example that I can look at to get me going in the right direction on this? Thanks in advance!

Sure... here's one that I use. The trigger is a periodic schedule that runs every 14 days (created on a Tuesday). I then use required expressions to make sure it really IS Tuesday since there's no periodic schedule function that says "every other Tuesday"). Mine sets a scene as well, so the cleaners don't fiddle with the lights. Your trigger could be much simpler since it runs EVERY Tuesday.

EDIT - after looking at this rule again I changed the trigger to every tuesday and then use a boolean variable that I flip on and off to determine whether THIS week is the cleaners week or not...

1 Like

You can use Lock Share for that. Install it from HPM

Thanks for the idea! I installed it but I think it requires a user to download an app in order to use the service. I would prefer to just have them enter their code on the lock and have it work for that day of the week only. Interesting app though.

I have a rule similar to brad5's but I threw in a virtual presence sensor that is used by various rules to turn on all the lights at 100% in whatever room they were working on.

arrived() on Housekeeper

after my timeout:

departed() on Housekeeper
Lock: Side Door

1 Like

How do you tell what room they're working on?

Motion sensors.

I have them everywhere. I recently upgraded them (the rules) to set the light level based on illuminance. I was surprised at how well it worked.

Oh ok. I do the same for our own use, but what I find is the cleaners LOVE to turn lights off when they leave the room. That works fine for all my Lutrons but in those instances where I have lamps with smart bulbs it's a mess. I finally just said to them "don't touch any lamp, switch, etc... I will turn them all on for you and then I will turn them all off for you."

1 Like

I'm working on capacitance sensors to activate my sirens to discourage this sort of misbehavior.

1 Like

OMG funny story about that. I use Aeotec sirens on each floor. With tamper enabled. They needed a free plug to plug in the vacuum cleaner. Only once.

And I have a button controller that sets "night mode," which also sets the alarm. They used to clean it. And then open the side door to take out the trash. (I have since removed it entirely... just too easy to press.)

LOL. Thanks for the ideas. I have Aeotec sirens as well, Now all I need are a few of those childproof plug covers to give them no options.

S/PAF took a hit that week...

finally had some time to work on this. utilizing the simple version of the above rule, here is what I was doing.

Trigger event : Tuesday's at 9:00AM

When 'run actions' is hit, I keep getting this message:

dev:1932022-02-09 02:55:22.676 pm errorgroovy.lang.MissingMethodException: No signature of method: schlageBE468andBE469.setCode() is applicable for argument types: (java.lang.String) values: [2421]
Possible solutions: setCode(java.lang.Object, java.lang.Object), getCodes(), setCode(java.lang.Object, java.lang.Object, java.lang.Object), hashCode(), secure(hubitat.zwave.Command), deleteCode(java.lang.Object) on line 5107 (method setCode)

Help appreciated.

1 Like

What kind of lock is this?

SCHLAGE BE469ZP CAM 716 SCHLAGE Connect Smart Deadbolt With Alarm Inbuilt Camelot Trim In Aged Bronze

This topic fits what I'm trying to do, so apologies if resurrecting it is the wrong thing to do...

I have the Schlage BE469 Z-Wave lock and I'm trying to do a "once a week" schedule for the maids who come on Mondays, but checking it today (Friday)...

I deleted all the codes with Lock Manager and then deleted Lock Manager to get things to a good place (I had entered the codes manually in the lock before getting HE set up). I can add the codes using Lock Manager and then go to the lock and use them to unlock it.

When the rule runs to set the code, it doesn't seem to work, but it doesn't return an error either.

And the logs show:

app:1032022-04-01 10:59:42.232 am infoAction: deleteCode(1) on Front door Schlage
app:832022-04-01 10:59:42.182 am info01-Apr-2022 10:59 AM: Front door Schlage Front door Schlage was locked [digital]
app:1032022-04-01 10:59:42.164 am infoWait over: Front door Schlage lock locked
app:1032022-04-01 10:59:42.149 am infoEvent: Front door Schlage lock locked
app:832022-04-01 10:59:32.397 am info01-Apr-2022 10:59 AM: Front door Schlage Front door Schlage was unlocked by Us
app:1032022-04-01 10:59:00.134 am infoAction: Wait for event: Front door Schlage locked
app:1032022-04-01 10:59:00.099 am infoAction: setCode(1, '135531', 'Maids') on Front door Schlage
app:1032022-04-01 10:59:00.055 am infoTriggered
app:1032022-04-01 10:59:00.046 am infoEvent: Triggered by Days of Week Schedule 
app:1032022-04-01 10:58:27.996 am infoInitialized

I go to the lock and try to unlock it with the maid's code and it fails. I can unlock it with my code, which was also set through Lock Manager.

My code shows and the add code shows like it's almost there in the State Variables...

Any ideas what's going wrong here? I tried a setCode with the code as an integer, instead of a string, and the lock rejected that, so it seems like the setCode syntax is not invalid. You can see that the delete happens after I use my code to unlock the door and then lock it, so it's not like it's adding and then immediately deleting the code because the door was already locked.

Any suggestions on what to try next?

The topic died without a resolution. I was never able to get it to work with this lock. I have just been doing the enable and disable each week which is a pain but safer than leaving the "always enable" flag on.

I've been running up and down the stairs playing with this and it looks like a configure(), setCode(1,'######','Maids'), refresh() is working for me.

The same goes for the delete, configure(), deleteCode(1), refresh()

Going to see if I can finish up the rule for the add-wait-delete operations and then I'll have to wait a week or two to see if it's really working. That will be the harrowing part!

Yes, the config() before the set/delete seems to be the key. It appears to be working well for me now.

if you get it working, please post what your rule looks like so I can do the same...

1 Like

Download the Hubitat app