I would like the rule engine to have access to Locks (like Schlage) event data. This is possible with the sharptools android app. This allows you to get method of unlock, codeId, and or usedCode.
This would allow you to make rules based on who unlocked the door.
In the SmartThings ecosystem, devices report events whenever things happen to them. For example, when a switch is turned on, that event is reported. Similarly, when a lock is unlocked that event is reported.
Events in the SmartThings Groovy ecosystem also have the ability to attach arbitrary data to an attribute’s event. So when a lock is unlocked, the device handler might also include a codeId and method value along with the fact that the door was unlocked.
While the capability and event model in the new SmartThings API still have references to attaching data to an event, the documentation on the new SmartThings API doesn’t have references as to how (or if) the data on an event can be consumed.
Here is an example of how I use the event data in tasker.
Profile: Thing (81)
Restore: no
Event: Thing State [ Configuration:Location: Home
Thing: Front Door
Attribute: ALL
Triggered when an attribute matching the filters changes.
IMPORTANT: Be sure to manually subscribe to the desired attribute in the main SharpTools app by long-pressing on the desired thing. ]
Enter: Anon (130)
A1: Notify [ Title:Sharptools Text:%st_attr_name
%st_attr_value
%st_event_data
%st_location_id
%st_location_name
%st_thing_id
%st_thing_name Icon:null Number:0 Permanent:Off Priority:3 Repeat Alert:Off LED Colour:Red LED Rate:0 Sound File: Vibration Pattern: Category: ]
A2: AutoTools Json Read [ Configuration:Input Format: Json
Simple Mode: true
Json: %st_event_data
Fields: method,codeId,usedCode
Separator: , Timeout (Seconds):60 ]
A3: Flash [ Text:%method
%codeid
%usedcode Long:Off ]
Adding my voice to the request for this feature and hoping that others will as well! It would be incredibly helpful to access more data about an event and act upon it within the Rules Engine.