Schlage connect lock manually used?


#1

I am using the Schlage door lock. I can figure out how to see which code was used to lock or unlock the device.

However, the lock also reports back in the recently tab, if the lock was lock/unlocked manually

Has anyone been able to figure out a way to capture that info and use it as a condition or trigger for an if statement?

Btw I’m usin Rboy luniversal lock manager for this lock

Thanks

Also, webcore does not offer the option to check if it was locked physically or programicaly. Where as it does for switches?


Schlage Lock Not returning Code number - in Canada
#2

I saw a thread a while back that said it was in the $args value (had to be found in the string). I don’t have a lock to verify this (or be any more help), sorry.


#3

I have been trying to figure this out also. I want to delineate between manual deadbolt/key, keypad, and remotely. I have the keypad down.


#5

So would unknow be a jammed condition?


#6

I have a Schlage lock also and these are the output of $args.

Unlocked via automation
+97ms ║Debug: [microDeviceTile:[icon:st.locks.lock.unlocked, backgroundColor: #ffffff, type:standard]]

Locked manually from inside
+116ms ║Debug: [usedCode:manual, microDeviceTile:[icon:st.locks.lock.locked, backgroundColor: #79b821, type:standard]]

Unlocked manually from inside
+168ms ║Debug: [usedCode:manual, microDeviceTile:[icon:st.locks.lock.unlocked, backgroundColor: #ffffff, type:standard]]

Locked manually from outside
+108ms ║Debug: [usedCode:0, microDeviceTile:[icon:st.locks.lock.locked, backgroundColor: #79b821, type:standard]]


#7

Sorry for not knowing this. How do I get the $args to use in a piston?


#8

Hmm, let’s say… if you’re interested in unlocked via automation…

contains($args,'usedCode') – if false, then it was unlocked via automation.

And others…

contains($args,'usedCode:manual, microDeviceTile:[icon:st.locks.lock.locked') – if true, locked Manually

contains($args,'usedCode:manual, microDeviceTile:[icon:st.locks.lock.unlocked') – if true, unlocked Manually

There are probably other ways to skin this but this is first thing I can think of.

Edit: I think I’m confusing my functions lol, let me verify :slight_smile:
Edit2: Ok, contains() is a valid function.


#9

Could someone show me how this looks in a piston? I am confused how to program this aspect. It seemed that whenever I unlock it manually or via ST, it gives me a 0 for used Code. Is this because I am not using Rboy?


#10

It would look something like this… I’m not using Rboy’s handler so outputs might be different based on what dh is used.

image


#11

Thanks @eibyer. I will give it a shot and see what my results are.


#12

I am not using it either. It seems I always have $args.usedCode even with automation.


#14

Not sure what I am doing wrong. I started hacking up my code to uses this feature and it is not working. Only look at the unlock portion. It is the only part I have modified.


#15

Make sure you log your $args first to see if your output looks like mine, if not then then expression might need to be adjusted.


#16

Here is what I came up with and I cannot distinguish between manual and smart things which were done in that order.

7/12/2018, 6:24:34 AM +171ms
+252ms ║lock commanded, [lockName:Mudroom Door], null
7/12/2018, 6:24:21 AM +161ms
+391ms ║unlocked commanded, [lockName:Mudroom Door], null
7/12/2018, 6:24:06 AM +312ms
+243ms ║lock commanded, [lockName:Mudroom Door], null
7/12/2018, 6:23:57 AM +934ms
+255ms ║unlocked commanded, [lockName:Mudroom Door], null

And it appears that it accepts the null as zero?


#17

Ok I have most of this , thanks

However I am having difficulty in evaluating a null value.

If {usedCode} is null
Then do stuff

However it always evaluates as false. What am I missing?

7/13/2018, 8:08:39 AM +831ms
+1ms ╔Received event [Front Door Lock].lock = locked with a delay of 136ms
+73ms ║RunTime Analysis CS > 19ms > PS > 38ms > PE > 16ms > CE
+75ms ║Runtime (41293 bytes) successfully initialized in 38ms (v0.3.105.20180628) (73ms)
+76ms ║╔Execution stage started
+84ms ║║Cancelling statement #2’s schedules…
+89ms ║║Executed virtual command setVariable (3ms)
+96ms ║║[lockName:Front Door Lock]
+97ms ║║Executed virtual command log (1ms)
+104ms ║║Comparison (string) null is (string) = false (2ms)
+105ms ║║Condition #9 evaluated false (5ms)
+106ms ║║Condition group #6 evaluated false (state did not change) (6ms)
+108ms ║╚Execution stage complete. (32ms)
+110ms ╚Event processed successfully (109ms)


#18

Try If isEmpty(Usedcode) is true


#19

I think this will work. Not home fo a couple days to test. But should

  1. Type code at keypad- register done at keypad and register user that was used
  2. Turn knob manually registers as manually
  3. Press the Schlege button on keypad registers as used schlage button
  4. Lock/unlock with smartthings or webcore registers as programmically

Import code jyyt


#20

Ok, I understand the $args data info… is there a way to get the info from an event, for example description, and capture the value. See pic.

@eibyer


#21

I don’t think we have access to that, only the data part comes in.


#22

Do you have this working? Mind sharing your final code? Thank you.