Upload
joel-lord
View
186
Download
0
Embed Size (px)
Citation preview
www.spiria.com
Smart Homes Made Smarter With Javascript
Presented By
JOEL LORD
Ottawa JavascriptNovember 9th, 2016
@ottawa_js@joel__lord
JOEL LORDAbout me
• Javascript Junkie• Tinkerer• Technology enthusiast
@ottawa_js@joel__lord
AGENDA Wink EcosystemMacros (or Robots)IFTTTIntroducing WinkJSDemosQ&A
@ottawa_js@joel__lord
I <3 GADGETSAbout me, eh?
State of the MarketHOME AUTOMATION
@ottawa_js@joel__lord
The Home automation market
• There are many options out there !
@joel__lord
@ottawa_js@joel__lord
The Home automation market
• There are many options out there !• Nest
@joel__lord
@ottawa_js@joel__lord
The Home automation market
• There are many options out there !• Nest• GE
@joel__lord
@ottawa_js@joel__lord
The Home automation market
• There are many options out there !• Nest• GE• Philips
@joel__lord
@ottawa_js@joel__lord
The Home automation market
• There are many options out there !• Nest• GE• Philips• Insteon
@joel__lord
@ottawa_js@joel__lord
The Home automation market
• There are many options out there !• Nest• GE• Philips• Insteon• Samsung SmartThings
@joel__lord
@ottawa_js@joel__lord
The Home automation market
• There are many options out there !• Nest• GE• Philips• Insteon• Samsung SmartThings• Belkin Wemo
@joel__lord
@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
@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
@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
@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
@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
@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
@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
@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
@ottawa_js@joel__lord
Wink ecosystem
• Connect various devices from various providers within a single application
11/10/16 21
@joel__lord
@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
@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
@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
@ottawa_js@joel__lord
Wink ecosystem
11/10/16
@joel__lord
25
@ottawa_js@joel__lord
Wink ecosystem
11/10/16
@joel__lord
26
@ottawa_js@joel__lord
Wink ecosystem
11/10/16
@joel__lord
27
@ottawa_js@joel__lord
Wink demo
11/10/16 28
@joel__lord
@ottawa_js@joel__lord
Wink demo
11/10/16
@joel__lord
29
• Pretty limited
@ottawa_js@joel__lord
Wink demo
11/10/16
@joel__lord
30
• Pretty limited• Robots are the Wink equivalent to macros
Wink RobotsMAKE IT SMARTER
@ottawa_js@joel__lord
Wink demo
11/10/16
@joel__lord
32
@ottawa_js@joel__lord
Wink demo
11/10/16
@joel__lord
33
@ottawa_js@joel__lord
Wink demo
11/10/16
@joel__lord
34
@ottawa_js@joel__lord
Wink demo
11/10/16
@joel__lord
35
@ottawa_js@joel__lord
Wink demo
11/10/16
@joel__lord
36
@ottawa_js@joel__lord
Wink demo
11/10/16
@joel__lord
37
@ottawa_js@joel__lord
Wink demo
11/10/16
@joel__lord
38
IFTTT IntegrationMAKE IT SMARTER
@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
@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
@ottawa_js@joel__lord
IFTTT demo
11/10/16
@joel__lord
42
• http://cl.ly/300R1310191F
@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
@ottawa_js@joel__lord
And even more smart !
11/10/16
@joel__lord
44
• We need :– Variables– Functions– More third party integrations
Introducing WinkJsMAKE IT SMARTER
@ottawa_js@joel__lord
Introducing Winkjs
11/10/16
@joel__lord
46
• REST API• Uses OAUTH• More or less standard API objects
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
47
• Door Lock object
{last_reading: {locked: true }, desired_state: {}}
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
48
• Thermostat object
{last_reading: {temperature: "18.5", units: "C"}, desired_state: {}}
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
49
• Light Bulb object
{last_reading: {brightness: 0.5, powered: true}, desired_state: {}}
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
50
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
51
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
52
• A simple Hello World
var Wink = require("wink");
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
53
• A simple Hello World
var apiCredentials = require("./credentials");
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
54
• A simple Hello World
var wink = new Wink(apiCredentials);
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
55
• A simple Hello World
wink.on("ready", function() {
});
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
56
• A simple Hello World
var light = wink.getDeviceByName("Light1");
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
57
• A simple Hello World
light.on();
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
58
• A simple Hello World
light.off();
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
59
• A simple Hello World
light.toggle();
IT’S CODING TIME!LET’S GET SERIOUS
IT’S CODING TIME!LET’S GET SERIOUS
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
62
• Integrating with other objects
var Wink = require("../lib");
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
63
• Integrating with other objects
var apiCredentials = require("./credentials");
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
64
• Integrating with other objects
var wink = new Wink(apiCredentials);
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
65
• Integrating with other objects
wink.on("ready", function() {
});
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
66
• Integrating with other objects
var thermostat = wink.getDevicesByType(wink.deviceTypes.THERMOSTAT)[0];
@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");
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
68
• Here comes Johnny !
@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 !});
});
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
70
• Integrating with Johnny-Five
var five = require("johnny-five");
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
71
• Integrating with Johnny-Five
var board = new five.Board();
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
72
• Integrating with Johnny-Five
var button;
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
73
• Integrating with Johnny-Five
board.on("ready", function() {
});
@ottawa_js@joel__lord
Introducing winkjs
11/10/16
@joel__lord
74
• Integrating with Johnny-Five
button = new five.Button(2);
@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 !
});
@ottawa_js@joel__lord
How about Security?
11/10/16
@joel__lord
76
• You have to be intentional
@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
@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.
@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
DOCUMENT CONFIDENTIEL, TOUT DROIT RÉSERVÉ
PRESENTED BY
The End !
Questions ?
JOEL LORDNovember 2016
TWITTER: @JOEL__LORDGITHUB: JOELLORD