Spread the love

 
Have you ever heard of IoT before? I strongly believe so, it is one of the most trending topics everywhere.

It’s all about things (i.e. devices) that are connected through the Internet and can become smart by sharing their data.

Devices are only the first part of the IoT world: we cannot think of IoT without the “T” of things and we cannot think of IoT without the “I” of internet.

That said, the involved actors behind the “I” of Internet are not sentient machines that are ready to use devices data to rule humans (actually not yet) but actually platforms that can collect, elaborate and route this tiny pieces of data to make the devices actually smart!

What I want to say is that your toothbrush is not smart until you connect it on the Internet and make it talk with the “Toothbrush Factory Inc.” platform, which will hestimate your toothbrush consumption and alert you on your smartwatch or make an automatic order to Amazon.com, so you’ll receive the day after your new toothbrush head without even knowing you needed a new one!

What about Salesforce?

Salesforce is your toothbursh factory platform for Sales!

I guess the guys at Salesforce won’t like so much this similitude, and they may be right, because there is an actual distinction: Salesforce IoT is not an IoT framework that talks with the devices directly, but it is an application that works on the data produced by those devices, whose bits of data is transformed by proper IoT platforms (Google, Amazon, Microsoft, …) and consumed by Salesforce (who correlate that info with actual Salesforce objects).

This picture sums up the concept:

The Salesforce IoT product is meant to enhance your business by:

  • Combining devices data with Salesforce data to better understand devices usage
  • Orchestrating with code-less tools your business process around IoT data (you can still use “low level” Apex code to increase the complexity and customization level of your Org)
  • Increasing user engagement and customer perception (the customer knows he needs something only when the company tells him)

An example? Have a read at the dedicated Trailhead modules to better understand this concept.

An example please!

You own a company that provides rechargable Nutella stands: they are much like a coffee machine, the only difference is that the machine drops Nutella instead of coffee.

Author’s note: this is something that doesn’t exist, and it makes me really sad 🙁

You sell tens of machines all over you country and provide the “recharge” service as well, for an additional price.

Every Nutella device, which is connected via WiFi to the Internet, sends a data packet to your Google Cloud IoT instance telling the device ID and the amount of Nutella level (from now on called Nutel-level).

The platform takes those inputs and format them correctly so that Salesforce IoT platform can “eat” them (packaging them inside the so called Platform Events).

Whenever the nutel-level drops under a certain level, Salesforce IoT automatically activates its business process logic magic and a new Case is automatically opened and sent to the technicians along with a Work Order to start a field service operation.

Ready, get set, go!

Before activating the Salesforce IoT Explorer Edition let’s create the necessary metadata on our DE Org.

First we create a Nutellator__c custom object that represents the Nutella device with the following fields:

  • Device_ID__c: Text(255), unique, required, identifies a specific device by its unique id
  • Nut_level__c: Percent(3,2), % level of Nutella on the device (last measure)
  • Last_Measure_Date__c: Date/Time, date of last measure
  • Account__c: Lookup(Account), your customer
  • Location__c: Text(255), where the device is located

We could have used the standard Asset object, but I loved the idea of creating an object called Nutellator.

Second task is to create a Platform Event called Nutellevent__e: if you don’t know what a platform event is click here to learn more, but you can think of it as an ephemeral object that is not stored on the database but that can be used to trigger business logic.
The Nutellevent__e platform event is used to start the IoT flow on Salesforce: this object conveys the id of the device and the nutellevel percentage.

All is set up to start playing with Salesforce IoT Explorer Edition…but we’ll see it in the next post!