Device Trait Overview
What is Trait
Traits, in the context of the Yonomi Platform (YP), refer to the data schema that describes specific device functionality within the platform. They are designed to capture the core functionality of devices in a standardized manner, making integration more accessible and reducing the effort required to integrate multiple devices. Traits ensure that the functionality of devices within YP can be composed together seamlessly while still allowing for flexibility.
Types of Traits
There are 2 different types of traits as defined below. These types influence the required flows for interactions defined in a given trait. To determine which type a specific trait is, see the documentation for that specific trait.
- Standard Trait: All data required for the interaction is fully contained within the interaction payload.
- Bulk Data Trait: Trait interactions deal with potentially large data sets that can exceed transaction data limits. As such, data is required to be stored in JSON data files and the interaction payload containing the relevant upload/download URL. These traits therefore require additional processes to generate/upload or download/parse data files in addition to the standard interaction processes.
Types of Trait Interactions
Actions
A trait action is a cloud interaction that initiates an update or command at the device. Examples include updating device settings, writing authorized credential data to the device, issuing a remote unlock command, or initiating device firmware update.
Actions have a complete lifecycle that is initiated through a synchronous GraphQL Mutation request to YP APIs and completes with asynchronous events published from the device upon completion of the requested action. For information on the Action Lifecycle flow, see the Trait Overview: Device Action Lifecycle documentation.
Reported States
A trait state is a data field representing a specific property or setting on the device. There are 2 primary interactions that users may have with trait states:
- Trait State Query: Users may submit synchronous GraphQL Query requests to YP APIs in order to receive information on the current state values that were last reported by the device.
- State Updated Events: Users may subscribe to receive events webhooks or may query history of the events that are published whenever the device reported states change.
For information on each of these trait state interactions, see the Trait Overview: Device Reported State documentation.
Notifications
A trait notification is an event published by the device to communicate transient information to the user (e.g. low battery, device locked/unlocked audits, etc.). For information on notification events, see the Trait Overview: Device Notifications documentation.
What made this section unhelpful for you?
On this page
- Device Trait Overview