IoT Quick Demo for Heroku & Salesforce

53
IOT QUICK DEMO SALESFORCE YOU HAVE TO INSTALL HEROKU APPLICATION AT FIRST!!!!!! The following site has the latest information so please check this out at first. http://itodemo-developer-edition.ap0.force.com

Transcript of IoT Quick Demo for Heroku & Salesforce

Page 1: IoT Quick Demo for Heroku & Salesforce

IOT QUICK DEMO SALESFORCE

YOU HAVE TO INSTALL HEROKU APPLICATION AT FIRST!!!!!!

The following site has the latest information so please

check this out at first.

http://itodemo-developer-edition.ap0.force.com

Page 2: IoT Quick Demo for Heroku & Salesforce

Agenda

1. Installation

2. Temperature demo

• Setup

• Scenario

3. Location demo

• Setup

• Scenario

4. Optional Features

• Twilio integration

• Android device

Page 3: IoT Quick Demo for Heroku & Salesforce

System Overview

Heroku

App

Send value, lat, lon,

and timestamp to

heroku app every 3

secs

Pusher

Add-on

Forward values to

SFDC

Streaming API

websocket

SFDC

Page 4: IoT Quick Demo for Heroku & Salesforce

1. INSTARALLTION

Page 5: IoT Quick Demo for Heroku & Salesforce

http://itodemo-developer-edition.ap0.force.com/

2

1

Before you click this Heroku button, you must have your

developer account on Salesforce for free. If not, go to

https://developer.salesforce.com/signup to sign-in

Copy this url and paste it at your browser to install

salesforce application.

Ener your Salesforce userid and password

3

Page 6: IoT Quick Demo for Heroku & Salesforce

2

1

3 4

Page 7: IoT Quick Demo for Heroku & Salesforce

1

Page 8: IoT Quick Demo for Heroku & Salesforce

1

3

This is your own application url. Please make

sure that it looks like

https://<yourapp>.herokuapp.com

This is your application url you should copy

2

Page 9: IoT Quick Demo for Heroku & Salesforce

2

1

3

4

5

Page 10: IoT Quick Demo for Heroku & Salesforce

2

1

3

Enter your office location for now.

Check http://mygeoposition.com/ to get

value

4

Page 11: IoT Quick Demo for Heroku & Salesforce

2

1

3

Add two columns to User layout

4

Page 12: IoT Quick Demo for Heroku & Salesforce

2

1

3

Enter your own heroku application url

Page 13: IoT Quick Demo for Heroku & Salesforce

2

1

3

Add FindSupportPerson VF to case layout

Page 14: IoT Quick Demo for Heroku & Salesforce

2

1 3

5

4

Page 15: IoT Quick Demo for Heroku & Salesforce

1

Your Salesforce username and password

Page 16: IoT Quick Demo for Heroku & Salesforce

2. TEMPERATURE DEMO

Page 17: IoT Quick Demo for Heroku & Salesforce

SET UP

Page 18: IoT Quick Demo for Heroku & Salesforce

1

2

3

Page 19: IoT Quick Demo for Heroku & Salesforce

1

This page is device detail page showing

sensor value, location, and so on

Page 20: IoT Quick Demo for Heroku & Salesforce

2

1

In case value from device is over this

threshold, then the app automatically create

a case and post content based on this

setting values.

Page 21: IoT Quick Demo for Heroku & Salesforce

2

1

3

Enter your any location near the place

where you are for demo

Check http://mygeoposition.com/ to get

value

4

Page 22: IoT Quick Demo for Heroku & Salesforce

2

1

3

Enter you email address which your mobile

can receive.

4

Web based device UI app is on

iphone/android

Page 23: IoT Quick Demo for Heroku & Salesforce

SCENARIO

Page 24: IoT Quick Demo for Heroku & Salesforce

Steps1. Map showing where you are for demo because device

sends geo-location, temperature data to SFDC every

3secs

2. Gauge showing current temperature at device. It has

time difference because of device -> Heroku -> SFDC -

> Gauge UI. You may change temperature value on

device ( not exceed threshold value you set )

3. Send signal to device by switching button via Web-

socket.

4. Show historical data

5. Change temperature value over threshold so that

Chatter post and case are automatically created.

6. Show the case and the Chatter post

Page 25: IoT Quick Demo for Heroku & Salesforce
Page 26: IoT Quick Demo for Heroku & Salesforce

This geo-location comes form web based

device UI app gets value from

iphone/andorid.

Page 27: IoT Quick Demo for Heroku & Salesforce

2

1

You can see when the data got arrived from

device. Streaming API is implemented here.

You can change temp value here but not

one over 40 degree which is threshold.

Page 28: IoT Quick Demo for Heroku & Salesforce

2

1

You can switch on / off at Salesforce UI and

sends a signal to device via Websocket

Page 29: IoT Quick Demo for Heroku & Salesforce

It shows historical data but you need to

refresh page if you show new data set.

Page 30: IoT Quick Demo for Heroku & Salesforce

All data from device are stored at

SensorData custom object

There is no case here.

Page 31: IoT Quick Demo for Heroku & Salesforce

2

1

3

Change value so that it is over threshold

Refresh the page

You can change subject of content. Please

see demo setting section.

Page 32: IoT Quick Demo for Heroku & Salesforce

'SELECT Id,Department,Division,Email,Name,Phone,Location_Map__c FROM User WHERE DISTANCE(User_Location__c, GEOL

OCATION('+record.Location__Latitude__s+','+record.Location__Longitude__s+'), \'mi\') < 50';

This shows users who are within 50 mills

against device location.

Page 33: IoT Quick Demo for Heroku & Salesforce

2

1

Chatter post is created.

Page 34: IoT Quick Demo for Heroku & Salesforce

3. LOCATION DEMO

Page 35: IoT Quick Demo for Heroku & Salesforce

Use caseWhen our device (car, sensor, and so on) is stolen, then

case and chatter post is created to notify employee.

The demo shows you if the difference between the place

where device was located at previous time and one where

it is located now is over 10 mils, then case and chatter are

created.

Page 36: IoT Quick Demo for Heroku & Salesforce

SETTING

Page 37: IoT Quick Demo for Heroku & Salesforce

1

Change lat and long values indicating any place from

where you are for demo to 10mil away.

Page 38: IoT Quick Demo for Heroku & Salesforce

SCENARIO

Page 39: IoT Quick Demo for Heroku & Salesforce

All data from device are stored at

SensorData custom object

There is no case here.

Page 40: IoT Quick Demo for Heroku & Salesforce
Page 41: IoT Quick Demo for Heroku & Salesforce

2

1

3

Opening Web-based device UI sends geo-

location to SFDC

Refresh the page

You can change subject of content. Please

see demo setting section.

Page 42: IoT Quick Demo for Heroku & Salesforce

'SELECT Id,Department,Division,Email,Name,Phone,Location_Map__c FROM User WHERE DISTANCE(User_Location__c, GEOL

OCATION('+record.Location__Latitude__s+','+record.Location__Longitude__s+'), \'mi\') < 50';

This shows users who are within 50 mills

against device location.

Page 43: IoT Quick Demo for Heroku & Salesforce

2

1

Chatter post is created.

Page 44: IoT Quick Demo for Heroku & Salesforce

4. OPTIONAL FEATURES

Page 45: IoT Quick Demo for Heroku & Salesforce

TWILIO INTEGRATION

Page 46: IoT Quick Demo for Heroku & Salesforce

1

4

3

2

Page 47: IoT Quick Demo for Heroku & Salesforce

https://github.com/twilio/twilio-salesforce

tells you how to get account, token, to, and

from values.

1

2

Uncomment out this line for calling

Page 48: IoT Quick Demo for Heroku & Salesforce

3

2

1

Page 49: IoT Quick Demo for Heroku & Salesforce

1

Edit twilio content field for call. In case

temperature value goes up the threshold,

then case and chatter post are created and

you will get a call with this content.

Page 50: IoT Quick Demo for Heroku & Salesforce

ANDROID DEVICE

Page 51: IoT Quick Demo for Heroku & Salesforce

Use caseIf you have Android smart phone by yourself, you can give

more features using js device api.

(http://blog.teamtreehouse.com/exploring-javascript-device-

apis)

• SFDC UI can make Web-based device UI vibrated

• SFDC UI can get battery level from Android smart phone

• Web-based device UI gives real ambient light level to SFDC

• YOU NEED Firefox on Android Smart Phone

Page 52: IoT Quick Demo for Heroku & Salesforce

2

1

3

Enter you email address which your mobile

can receive.

4

Web based device UI app is on android

Thing’s record type must be Android

Page 53: IoT Quick Demo for Heroku & Salesforce

1

3

2

Throw light on android smart phone to

change this value