80
www.spiria.com Smart Homes Made Smarter With Javascript Presented By JOEL LORD Ottawa Javascript November 9 th , 2016

Smart Homes Made Smarter With Javascript

Embed Size (px)

Citation preview

Page 1: Smart Homes Made Smarter With Javascript

www.spiria.com

Smart Homes Made Smarter With Javascript

Presented By

JOEL LORD

Ottawa JavascriptNovember 9th, 2016

Page 2: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

JOEL LORDAbout me

• Javascript Junkie• Tinkerer• Technology enthusiast

Page 3: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

AGENDA Wink EcosystemMacros (or Robots)IFTTTIntroducing WinkJSDemosQ&A

Page 4: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

I <3 GADGETSAbout me, eh?

Page 5: Smart Homes Made Smarter With Javascript

State of the MarketHOME AUTOMATION

Page 6: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The Home automation market

• There are many options out there !

@joel__lord

Page 7: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The Home automation market

• There are many options out there !• Nest

@joel__lord

Page 8: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The Home automation market

• There are many options out there !• Nest• GE

@joel__lord

Page 9: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The Home automation market

• There are many options out there !• Nest• GE• Philips

@joel__lord

Page 10: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The Home automation market

• There are many options out there !• Nest• GE• Philips• Insteon

@joel__lord

Page 11: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The Home automation market

• There are many options out there !• Nest• GE• Philips• Insteon• Samsung SmartThings

@joel__lord

Page 12: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The Home automation market

• There are many options out there !• Nest• GE• Philips• Insteon• Samsung SmartThings• Belkin Wemo

@joel__lord

Page 13: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The Home automation market

• There are many options out there !• Nest• GE• Philips• Insteon• Samsung SmartThings• Belkin Wemo• iRobot

@joel__lord

Page 14: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The Home automation market

• There are many options out there !• Nest• GE• Philips• Insteon• Samsung SmartThings• Belkin Wemo• iRobot• Schlage

@joel__lord

Page 15: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The Home automation market

• There are many options out there !• Nest• GE• Philips• Insteon• Samsung SmartThings• Belkin Wemo• iRobot• Schlage• Lutron

@joel__lord

Page 16: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The Home automation market

• There are many options out there !• Nest• GE• Philips• Insteon• Samsung SmartThings• Belkin Wemo• iRobot• Schlage• Lutron• Zigbee

@joel__lord

Page 17: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The Home automation market

• There are many options out there !• Nest• GE• Philips• Insteon• Samsung SmartThings• Belkin Wemo• iRobot• Schlage• Lutron• Zigbee• Z-wave

@joel__lord

Page 18: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The Home automation market

• There are many options out there !• Nest• GE• Philips• Insteon• Samsung SmartThings• Belkin Wemo• iRobot• Schlage• Lutron• Zigbee• Z-wave• X10

@joel__lord

Page 19: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The Home automation market

• There are many options out there !• Nest• GE• Philips• Insteon• Samsung SmartThings• Belking Wemo• iRobot• Schlage• Lutron• Zigbee• Z-wave• X10

@joel__lord

Page 20: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

The home automation market

• Each device has it’s own app• Soon, your phone is a mess and you can’t control your devices

@joel__lord

Page 21: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink ecosystem

• Connect various devices from various providers within a single application

11/10/16 21

@joel__lord

Page 22: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink ecosystem

• Connect various devices from various providers within a single application

• But even better…

11/10/16 22

@joel__lord

Page 23: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink ecosystem

• Connect various devices from various providers within a single application

• But even better… They have an API

11/10/16 23

@joel__lord

Page 24: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink ecosystem

• Connect various devices from various providers within a single application

• But even better… They have an API• It’s not what you do with it that counts, it’s what you can do

11/10/16 24

@joel__lord

Page 25: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink ecosystem

11/10/16

@joel__lord

25

Page 26: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink ecosystem

11/10/16

@joel__lord

26

Page 27: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink ecosystem

11/10/16

@joel__lord

27

Page 28: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink demo

11/10/16 28

@joel__lord

Page 29: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink demo

11/10/16

@joel__lord

29

• Pretty limited

Page 30: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink demo

11/10/16

@joel__lord

30

• Pretty limited• Robots are the Wink equivalent to macros

Page 31: Smart Homes Made Smarter With Javascript

Wink RobotsMAKE IT SMARTER

Page 32: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink demo

11/10/16

@joel__lord

32

Page 33: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink demo

11/10/16

@joel__lord

33

Page 34: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink demo

11/10/16

@joel__lord

34

Page 35: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink demo

11/10/16

@joel__lord

35

Page 36: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink demo

11/10/16

@joel__lord

36

Page 37: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink demo

11/10/16

@joel__lord

37

Page 38: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Wink demo

11/10/16

@joel__lord

38

Page 39: Smart Homes Made Smarter With Javascript

IFTTT IntegrationMAKE IT SMARTER

Page 40: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Let’s make it smarter

11/10/16

@joel__lord

40

• Integration with Amazon Echo• Integration with IFTTT

– Either using the Maker Channel– Or using a third party

Page 41: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing IFTTT

11/10/16

@joel__lord

41

• IFTTT is a free web-based service that allows users to create chains of simple conditional statements, called "recipes", which are triggered based on changes to other web services such as Gmail, Facebook, Instagram, and Pinterest. IFTTT is an abbreviation of "If This Then That"

•-Wikipedia

Page 42: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

IFTTT demo

11/10/16

@joel__lord

42

• http://cl.ly/300R1310191F

Page 43: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

And even more smart !

11/10/16

@joel__lord

43

• Let’s make it even smarter• We need more control over our things

Page 44: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

And even more smart !

11/10/16

@joel__lord

44

• We need :– Variables– Functions– More third party integrations

Page 45: Smart Homes Made Smarter With Javascript

Introducing WinkJsMAKE IT SMARTER

Page 46: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing Winkjs

11/10/16

@joel__lord

46

• REST API• Uses OAUTH• More or less standard API objects

Page 47: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

47

• Door Lock object

{last_reading: {locked: true }, desired_state: {}}

Page 48: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

48

• Thermostat object

{last_reading: {temperature: "18.5", units: "C"}, desired_state: {}}

Page 49: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

49

• Light Bulb object

{last_reading: {brightness: 0.5, powered: true}, desired_state: {}}

Page 50: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

50

Page 51: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

51

Page 52: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

52

• A simple Hello World

var Wink = require("wink");

Page 53: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

53

• A simple Hello World

var apiCredentials = require("./credentials");

Page 54: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

54

• A simple Hello World

var wink = new Wink(apiCredentials);

Page 55: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

55

• A simple Hello World

wink.on("ready", function() {

});

Page 56: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

56

• A simple Hello World

var light = wink.getDeviceByName("Light1");

Page 57: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

57

• A simple Hello World

light.on();

Page 58: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

58

• A simple Hello World

light.off();

Page 59: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

59

• A simple Hello World

light.toggle();

Page 60: Smart Homes Made Smarter With Javascript

IT’S CODING TIME!LET’S GET SERIOUS

Page 61: Smart Homes Made Smarter With Javascript

IT’S CODING TIME!LET’S GET SERIOUS

Page 62: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

62

• Integrating with other objects

var Wink = require("../lib");

Page 63: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

63

• Integrating with other objects

var apiCredentials = require("./credentials");

Page 64: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

64

• Integrating with other objects

var wink = new Wink(apiCredentials);

Page 65: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

65

• Integrating with other objects

wink.on("ready", function() {

});

Page 66: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

66

• Integrating with other objects

var thermostat = wink.getDevicesByType(wink.deviceTypes.THERMOSTAT)[0];

Page 67: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

67

• Integrating with other objects

console.log("Temp: " + thermostat.getTemperature(thermostat.units.CELSIUS) + " °C");console.log("Temp: " + thermostat.getTemperature(thermostat.units.FAHRENHEIT) + " F");

Page 68: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

68

• Here comes Johnny !

Page 69: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

69

• Integrating with Johnny-Five

var five = require("johnny-five"); var board = new five.Board();var button;

board.on("ready", function() { button = new five.Button(2); button.on("down", function() {

//Button was pressed, do something !});

});

Page 70: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

70

• Integrating with Johnny-Five

var five = require("johnny-five");

Page 71: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

71

• Integrating with Johnny-Five

var board = new five.Board();

Page 72: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

72

• Integrating with Johnny-Five

var button;

Page 73: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

73

• Integrating with Johnny-Five

board.on("ready", function() {

});

Page 74: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

74

• Integrating with Johnny-Five

button = new five.Button(2);

Page 75: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

Introducing winkjs

11/10/16

@joel__lord

75

• Integrating with Johnny-Five

button.on("down", function() {//Button was pressed, do something !

});

Page 76: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

How about Security?

11/10/16

@joel__lord

76

• You have to be intentional

Page 77: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

How about Security?

11/10/16

@joel__lord

77

• You have to be intentional• Keep in mind that you are exposing your home lights to hackers

Page 78: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

How about Security?

11/10/16

@joel__lord

78

• You have to be intentional• Keep in mind that you are exposing your home lights to hackers• Or worse… your front door lock.

Page 79: Smart Homes Made Smarter With Javascript

@ottawa_js@joel__lord

How about Security?

11/10/16

@joel__lord

79

• Killing a Jeep on the highway: https://www.wired.com/2015/07/hackers-remotely-kill-jeep-highway/

• Hacking smart door bells: http://thehackernews.com/2016/01/doorbell-hacking-wifi-pasword.html

Page 80: Smart Homes Made Smarter With Javascript

DOCUMENT CONFIDENTIEL, TOUT DROIT RÉSERVÉ

PRESENTED BY

The End !

Questions ?

JOEL LORDNovember 2016

TWITTER: @JOEL__LORDGITHUB: JOELLORD