Device Driver Diagram / state diagram / flow diagram

Hi,

I trying to understand how drivers work. I've downloaded the ST dimmer switch driver and am going through the code. It would be really helpful if there was some document I could read that gave an overview of the various functions in the driver. And more importantly how events get triggered (if coming from the device or perhaps the rules engine.

Thanks
John

The raw data produced by the device is sent to the parse method, the result of parsing device data is generally creating an event, via create event or send event.
An event it nothing more than a attribute name value pair. Events are what applications can subscribe to and take action on.
Applications can also issue commands to device drivers.
The available commands for a device driver are in the top section of the driver.
When an application executes a device driver command this generally results in a device specific command being sent to the actual device.
The device driver functions as an abstraction layer between the device specific protocol commands and well known capabilities and attributes.

@mike.maxwell,

Thank you for the concise explanation. Now I need to study the code with the explanation you provided.
Your post will definitely help with that.

John

John,

In addition to Mike’s explanation, I think you should also be made aware that device Capalities determine what intrinsic Attributes and Commands a device will have. See the SmartThings Device Capabilities Documentation (classic) for an overview of device capabilities. When you build a driver, you need to update the Attributes (via events) and implement the commands.

You can also create custom attributes and commands. However, these are not readily understood by standard Apps. Apps assume a device will implement the Attributes and Commands based on the standard list of Capabilities. You can write custom Apps that can make use of a device’s custom attributes and commands if desired.

Hopefully this helps and doesn’t cause more confusion.

Dan

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.