Schlage connect lock manually used?


#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.


#23

This seems to work as I intended. It only sets the variables and distinguishes how lock was interacted with. It doesn’t do any notifications or automations. That you can add as needed.


#24

Yeah, for some reason, my locks only return manual unless I explicitly lock or unlock with a code.


#25

I’m using rboy dth and smart app


#26

Hello

When I lock my Schlage from the outside, I have those arguments
+140ms ║║[lockName:Porte Avant, method:manual]

When I unlock from the keypad, I have:
+139ms ║║[codeId:3, lockName:Porte Avant, method:keypad, usedCode:3]

When I lock manually from the inside I also have
+140ms ║║[lockName:Porte Avant, method:manual]

Is there a way to know if the door was lock manually from the inside or the outside?

I would like to set my alarm correctly If we are in the house (at night) or leaving the house

Thanks!


#27

not that i am aware of… its manual, keycode number , or via app that i am aware of.


#28

for your information this is what I did

If my door is locked AND if my door sensor was open in the last 30 seconds, I set to away, otherwise I set it to night mode

working great so far
thanks