1) Give a description of the problem
Understanding how to incorporate ST’s new Smart Locks into WebCoRE
2) What is the expected behavior?
How to parse information that is reported, specifically which code opens the lock. Also, is there a way to pull the user name from lockCodes automatically?
3) What is happening/not happening?
If I unlock the door, codeReport seems to return a random number. In the log below, I used code 2, but the log reported code 3.
Here is what’s shown in the IDE:
Current States
battery: 80 %
lock: unlocked
codeChanged: 3 set
lockCodes: {“3”:“Aaron”,“2”:“Dan”,“1”:“Debbie”}
scanCodes: Complete
maxCodes: 30
codeReport:
checkInterval: 3600
4) Post a Green Snapshot of the piston
5) Attach any logs (From ST IDE and by turning logging level to Full)
11/14/2017, 11:25:15 AM +309ms +1ms ╔Received event [Front Door Lock].lock = unlocked with a delay of 949ms +134ms ║RunTime Analysis CS > 18ms > PS > 86ms > PE > 31ms > CE +144ms ║Runtime (42200 bytes) successfully initialized in 86ms (v0.2.0fe.20171109) (142ms) +145ms ║╔Execution stage started +166ms ║║Comparison (enum) unlocked gets (string) unlocked = true (10ms) +168ms ║║Cancelling condition #7's schedules... +168ms ║║Condition #7 evaluated true (16ms) +170ms ║║Cancelling condition #1's schedules... +170ms ║║Condition group #1 evaluated true (state changed) (19ms) +177ms ║║Comparison (string) :467745ba74b17d0ba382451b50109027: is_not (string) :467745ba74b17d0ba382451b50109027: = false (2ms) +178ms ║║Condition #10 evaluated false (5ms) +179ms ║║Condition group #8 evaluated false (state did not change) (7ms) +182ms ║║Evaluating switch with values [[i:11:null:0, v:[t:integer, v:3, vt:string]]] +186ms ║║Comparison (integer) 3 is (integer) 1 = false (2ms) +190ms ║║Comparison (integer) 3 is (integer) 2 = false (2ms) +194ms ║║Comparison (integer) 3 is (integer) 3 = true (1ms) +196ms ║║Cancelling statement #21's schedules... +203ms ║║Executed virtual command setVariable (4ms) +206ms ║║Cancelling statement #2's schedules... +214ms ║║Calculating (string) Front Door unlocked by + (string) Aaron >> (string) Front Door unlocked by Aaron +217ms ║║Calculating (string) Front Door unlocked by Aaron + (string) on >> (string) Front Door unlocked by Aaron on +220ms ║║Calculating (string) Front Door unlocked by Aaron on + (string) Tue, Nov 14 2017 @ 11:25:15 AM EST >> (string) Front Door unlocked by Aaron on Tue, Nov 14 2017 @ 11:25:15 AM EST +223ms ║║Executed virtual command setState (1ms) +231ms ║║Calculating (string) Front Door unlocked by + (string) Aaron >> (string) Front Door unlocked by Aaron +234ms ║║Calculating (string) Front Door unlocked by Aaron + (string) # >> (string) Front Door unlocked by Aaron # +236ms ║║Calculating (string) Front Door unlocked by Aaron # + (string) 3 >> (string) Front Door unlocked by Aaron #3 +241ms ║║Executed virtual command sendNotification (3ms) +244ms ║╚Execution stage complete. (100ms) +252ms ╚Event processed successfully (252ms) 11/14/2017, 11:25:06 AM +963ms +1ms ╔Received event [Front Door Lock].lock = locked with a delay of 916ms +138ms ║RunTime Analysis CS > 38ms > PS > 72ms > PE > 28ms > CE +147ms ║Runtime (42198 bytes) successfully initialized in 72ms (v0.2.0fe.20171109) (145ms) +148ms ║╔Execution stage started +161ms ║║Comparison (enum) locked gets (string) unlocked = false (1ms) +163ms ║║Condition #7 evaluated false (7ms) +164ms ║║Condition group #1 evaluated false (state did not change) (8ms) +166ms ║╚Execution stage complete. (18ms) +173ms ╚Event processed successfully (173ms)