State machine

A state machine is a device that can remain in one or more states. The change of state from one to another is technically known as a transition. The transition or state of change occurs in response to an external input.

State diagrams are used to represent a state machine's states and transitions. In IoT Cloud, the events that are emitted from the devices can be modeled into states and transitions.

Let's further understand states, transitions, and state machines with the help of an example. Let's assume we are monitoring events from the temperature sensors (assume the sensor is sending signals every second to the IoT Cloud along with data consisting of temperature readings). We are monitoring three primary states, as shown in the following table, and we want the system to automatically create a work order in Salesforce to send a field technician for room temperature maintenance when the temperature is above or below certain threshold levels:

Temperature measured State
Measured temperature < 20 degree Celcius Cold
20 degree C < Measured temperature < 35 degree Celcius Normal
Measured temperature > 35 degree Celcius Hot

The preceding data can be represented in terms of state diagrams, as shown here. Note that in the following diagram, the transitions are denoted by the arrow:

In your planning stage for IoT projects, the first step would be to determine events from your endpoints. Based on various data events, a rough sketch or a state diagram would help you create and determine various states.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset