Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Making Smart Homes Smarter With Javascript

296 views

Published on

Presented at NorthEast PHP 2016
Nowadays, more and more things are getting connected on the Internet. It is now easier than it has ever been to automate some stuff around your house. It’s nice to have a button to control lights from your phone but what if you wanted to add some more advanced interactions with your other connected devices. Using WinkJS, a wrapper around the Wink ecosystem APIs, the attendees will learn how to make their smart home smarter.

Published in: Engineering
  • Be the first to comment

Making Smart Homes Smarter With Javascript

  1. 1. Smart Homes Made Smarter With JS Joel Lord Guidebook app: NEPHP2016
  2. 2. www.spiria.com Smart Homes MadeSmarter With Javascript PresentedBy JOEL LORD North EastPHP 2016,Charlottetown,PE August 5th,2016
  3. 3. #NEPHP @joel__lord JOEL LORD About me,eh? • Javascript Junkie • Tinkerer • Technology enthusiast
  4. 4. #NEPHP @joel__lord
  5. 5. #NEPHP @joel__lord JOEL LORD About me,eh? • Javascript Junkie • Tinkerer • Technology enthusiast
  6. 6. #NEPHP @joel__lord AGENDA Wink Ecosystem Macros (or Robots) IFTTT Introducing WinkJS Demos Q&A
  7. 7. #NEPHP @joel__lord I <3 GADGETS About me,eh?
  8. 8. State of the Market HOME AUTOMATION
  9. 9. #NEPHP @joel__lord TheHome automation market • There are many options out there ! @joel__lord
  10. 10. #NEPHP @joel__lord TheHome automation market • There are many options out there ! • Nest @joel__lord
  11. 11. #NEPHP @joel__lord TheHome automation market • There are many options out there ! • Nest • GE @joel__lord
  12. 12. #NEPHP @joel__lord TheHome automation market • There are many options out there ! • Nest • GE • Philips @joel__lord
  13. 13. #NEPHP @joel__lord TheHome automation market • There are many options out there ! • Nest • GE • Philips • Insteon @joel__lord
  14. 14. #NEPHP @joel__lord TheHome automation market • There are many options out there ! • Nest • GE • Philips • Insteon • Samsung SmartThings @joel__lord
  15. 15. #NEPHP @joel__lord TheHome automation market • There are many options out there ! • Nest • GE • Philips • Insteon • Samsung SmartThings • Belkin Wemo @joel__lord
  16. 16. #NEPHP @joel__lord TheHome automation market • There are many options out there ! • Nest • GE • Philips • Insteon • Samsung SmartThings • Belkin Wemo • iRobot @joel__lord
  17. 17. #NEPHP @joel__lord TheHome automation market • There are many options out there ! • Nest • GE • Philips • Insteon • Samsung SmartThings • Belkin Wemo • iRobot • Schlage @joel__lord
  18. 18. #NEPHP @joel__lord TheHome automation market • There are many options out there ! • Nest • GE • Philips • Insteon • Samsung SmartThings • Belkin Wemo • iRobot • Schlage • Lutron @joel__lord
  19. 19. #NEPHP @joel__lord TheHome automation market • There are many options out there ! • Nest • GE • Philips • Insteon • Samsung SmartThings • Belkin Wemo • iRobot • Schlage • Lutron • Zigbee @joel__lord
  20. 20. #NEPHP @joel__lord TheHome automation market • There are many options out there ! • Nest • GE • Philips • Insteon • Samsung SmartThings • Belkin Wemo • iRobot • Schlage • Lutron • Zigbee • Z-wave @joel__lord
  21. 21. #NEPHP @joel__lord TheHome 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
  22. 22. #NEPHP @joel__lord TheHome 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
  23. 23. #NEPHP @joel__lord Thehome automation market • Each device has it’s own app • Soon, your phone is a mess and you can’t control your devices @joel__lord
  24. 24. #NEPHP @joel__lord Wink ecosystem • Connect various devices from various providers within a single application 8/4/2016 24 @joel__lord
  25. 25. #NEPHP @joel__lord Wink ecosystem • Connect various devices from various providers within a single application • But even better… 8/4/2016 25 @joel__lord
  26. 26. #NEPHP @joel__lord Wink ecosystem • Connect various devices from various providers within a single application • But even better… They have an API 8/4/2016 26 @joel__lord
  27. 27. #NEPHP @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 8/4/2016 27 @joel__lord
  28. 28. #NEPHP @joel__lord Wink ecosystem 8/4/2016 @joel__lord 28
  29. 29. #NEPHP @joel__lord Wink ecosystem 8/4/2016 @joel__lord 29
  30. 30. #NEPHP @joel__lord Wink ecosystem 8/4/2016 @joel__lord 30
  31. 31. #NEPHP @joel__lord Wink demo 8/4/2016 31 @joel__lord
  32. 32. #NEPHP @joel__lord Wink demo 8/4/2016 @joel__lord 32 • Pretty limited
  33. 33. #NEPHP @joel__lord Wink demo 8/4/2016 @joel__lord 33 • Pretty limited • Robots are the Wink equivalent to macros
  34. 34. Wink Robots MAKE IT SMARTER
  35. 35. #NEPHP @joel__lord Wink demo 8/4/2016 @joel__lord 35
  36. 36. #NEPHP @joel__lord Wink demo 8/4/2016 @joel__lord 36
  37. 37. #NEPHP @joel__lord Wink demo 8/4/2016 @joel__lord 37
  38. 38. #NEPHP @joel__lord Wink demo 8/4/2016 @joel__lord 38
  39. 39. #NEPHP @joel__lord Wink demo 8/4/2016 @joel__lord 39
  40. 40. #NEPHP @joel__lord Wink demo 8/4/2016 @joel__lord 40
  41. 41. #NEPHP @joel__lord Wink demo 8/4/2016 @joel__lord 41
  42. 42. IFTTT Integration MAKE IT SMARTER
  43. 43. #NEPHP @joel__lord Let’s makeit smarter 8/4/2016 @joel__lord 43 • Integration with Amazon Echo • Integration with IFTTT – Either using the Maker Channel – Or using a third party
  44. 44. #NEPHP @joel__lord Introducing IFTTT 8/4/2016 @joel__lord 44 • 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
  45. 45. #NEPHP @joel__lord IFTTT demo 8/4/2016 @joel__lord 45 • http://cl.ly/300R1310191F
  46. 46. #NEPHP @joel__lord And evenmore smart ! 8/4/2016 @joel__lord 46 • Let’s make it even smarter • We need more control over our things
  47. 47. #NEPHP @joel__lord And evenmore smart ! 8/4/2016 @joel__lord 47 • We need : – Variables – Functions – More third party integrations
  48. 48. Introducing WinkJs MAKE IT SMARTER
  49. 49. #NEPHP @joel__lord Introducing Winkjs 8/4/2016 @joel__lord 49 • REST API • Uses OAUTH • More or less standard API objects
  50. 50. #NEPHP @joel__lord Introducing winkjs 8/4/2016 @joel__lord 50 • Door Lock object { last_reading: { locked: true }, desired_state: { } }
  51. 51. #NEPHP @joel__lord Introducing winkjs 8/4/2016 @joel__lord 51 • Thermostat object { last_reading: { temperature: "18.5", units: "C" }, desired_state: { } }
  52. 52. #NEPHP @joel__lord Introducing winkjs 8/4/2016 @joel__lord 52 • Light Bulb object { last_reading: { brightness: 0.5, powered: true }, desired_state: { } }
  53. 53. #NEPHP @joel__lord Introducing winkjs 8/4/2016 @joel__lord 53
  54. 54. #NEPHP @joel__lord Introducing winkjs 8/4/2016 @joel__lord 54
  55. 55. #NEPHP @joel__lord Introducing winkjs 8/4/2016 @joel__lord 55 • A simple Hello World var Wink = require("wink"); var apiCredentials = require("./credentials"); var wink = new Wink(apiCredentials); wink.on("ready", function() { var light = wink.getDeviceByName("Light1"); light.off(); });
  56. 56. #NEPHP @joel__lord Introducing winkjs 8/4/2016 @joel__lord 56 • A Twitter integration //Web server var express = require("express"); var app = express(); var server = require("http").createServer(app); var twit = require("twit"); var keyword = "#devteach"; var Wink = require("../lib"); var apiCredentials = require("./credentials"); var twitterCredentials = require("./twitterCredentials"); var wink = new Wink(apiCredentials); //Web socket var port = 3333; //Start server server.listen(port, function () { console.log("Server started on port " + port); }); //Twitter Stream listener var t = new twit(twitterCredentials); var stream = t.stream("statuses/filter", {track: keyword}); var lights = []; var winkReady = false; wink.on("ready", function(devices) { console.log("ready"); winkReady = true;
  57. 57. IT’S CODING TIME! LET’S GET SERIOUS
  58. 58. IT’S CODING TIME! LET’S GET SERIOUS
  59. 59. #NEPHP @joel__lord Howabout Security? 8/4/2016 @joel__lord 59 • You have to be intentional
  60. 60. #NEPHP @joel__lord Howabout Security? 8/4/2016 @joel__lord 60 • You have to be intentional • Keep in mind that you are exposing your home lights to hackers
  61. 61. #NEPHP @joel__lord Howabout Security? 8/4/2016 @joel__lord 61 • You have to be intentional • Keep in mind that you are exposing your home lights to hackers • Or worse… your front door lock.
  62. 62. #NEPHP @joel__lord Howabout Security? 8/4/2016 @joel__lord 62 • 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
  63. 63. DOCUMENT CONFIDENTIEL, TOUT DROIT RÉSERVÉ PRESENTED BY TheEnd ! Questions ? JOEL LORD August2016 TWITTER: @JOEL__LORD GITHUB: HTTP://GITHUB.COM/JOELLORD http://bit.ly/2au33dH

×