Monsters, Mailboxes and other nonsense @ IndieWebCamp Düsseldorf

Monsters, Mailboxes and other nonsense @ IndieWebCamp Düsseldorf

Monsters, mailboxes and other non-sense. A talk about about combining sensors, switches and displays with different technologies to solve problems that don't really exist and more importantly just to have fun with IoT and make geeky stuff. This talk contains monsters, and lots of them.

De023a9aff4c7a5ede3a81e8c76f17b5?s=128

Niels Leenheer

May 13, 2017
Tweet

Transcript

  1. monsters, mailboxes and other non-sense

  2. a new home

  3. None
  4. None
  5. 10 meter

  6. the house 
 of the future

  7. None
  8. None
  9. 433MHz

  10. None
  11. None
  12. None
  13. None
  14. IoT is actually incredibly boring

  15. None
  16. raspberry pi with domoticz

  17. None
  18. None
  19. chicken thermostat

  20. brrrr!

  21. kippenwaterdrinkbak (chicken water trough)

  22. kippenwaterdrinkbakverwarmingselement (chicken water trough heater)

  23. kippenwaterdrinkbakverwarmingselementschakelaar (chicken water trough heater switch)

  24. kippenwaterdrinkbakverwarmingselementschakelaarthermometer (chicken water trough heater switch thermometer)

  25. None
  26. rfxcom

  27. every 30 seconds a “ping” with the temperature

  28. temperature below zero, turn on the heater

  29. turn klikaanklikuit switch on

  30. None
  31. The “S” in IoT stands for security

  32. None
  33. the fiery
 witches kettle

  34. Do-it-yourself IoT

  35. brains (or microcontrollers)

  36. Arduino Uno
 ATmega238
 16 Mhz
 2 KB RAM
 32 KB

    Flash
  37. ESP-01
 ESP 8266 
 80 Mhz
 128 KB RAM
 512

    KB Flash

  38. NodeMCU
 ESP 8266
 80 Mhz
 128 KB RAM
 4 MB

    Flash

  39. NodeMCU

  40. Neopixel
 24 serial 
 connected 
 WS2812 RGB 
 LEDs

  41. #include <Adafruit_NeoPixel.h> #define PIN D1 #define PIXELS 24 Adafruit_NeoPixel strip

    = Adafruit_NeoPixel(PIXELS, PIN, NEO_GRB + NEO_KHZ800); void setup(void) { strip.begin(); strip.setBrightness(255); strip.setPixelColor(0, strip.Color(0, 0, 255)); strip.show(); } void loop(void) { }
  42. int i = 0; void setup(void) { strip.begin(); strip.setBrightness(255); }

    void loop(void) { i = (i + 1) % PIXELS; strip.setPixelColor(i % PIXELS, strip.Color(0, 0, 0)); strip.setPixelColor((i + 1) % PIXELS, strip.Color(0, 0, 63)); strip.setPixelColor((i + 2) % PIXELS, strip.Color(0, 0, 127)); strip.setPixelColor((i + 3) % PIXELS, strip.Color(0, 0, 195)); strip.setPixelColor((i + 4) % PIXELS, strip.Color(0, 0, 255)); strip.show(); delay(8); }
  43. ?! JavaScript? And C?
 Kinda the same. Just about.
 Not

    quite. No.
  44. IKEA SOMMAR 2017 lantern

  45. None
  46. None
  47. None
  48. None
  49. WiFi must be very complicated…

  50. const char* ssid = "........"; const char* password = "........";

    ESP8266WebServer server(80); void setup(void) { WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) delay(500); server.on("/on", [](){ server.send(200, "text/plain", "on"); }); server.on("/off", [](){ server.send(200, "text/plain", "off"); }); server.begin(); } void loop(void) { server.handleClient(); }
  51. http:/ /sparkle.local/api?command=power&status
 command=power&on
 command=power&off command=brightness&status
 command=brightness&set=50 command=color&status
 command=color&set=f34d0d

  52. homebridge homebridge-better-http-rgb

  53. siri

  54. siri

  55. pixel monsters

  56. Prolight 12W ceiling lamp

  57. None
  58. Neopixel
 64 serial 
 connected 
 WS2812 RGB 
 LEDs

  59. None
  60. SD card Storage of monsters Buzzer Beeps for notifications Lightsensitive

    resistor Night-mode
  61. None
  62. None
  63. None
  64. None
  65. progressive
 web app

  66. http:/ /pixel.local

  67. http:/ /pixel.local

  68. None
  69. editor.addEventListener('touchstart', handleTouch); editor.addEventListener('touchmove', handleTouch); function handleTouch(e) { for (var i

    = 0; i < e.changedTouches.length; i++) { let elem = document.elementFromPoint( e.changedTouches[i].pageX, e.changedTouches[i].pageY ); if (elem.tagName && elem.tagName == 'TD' && 
 editor.contains(elem)) 
 { drawPixel(elem); } } e.preventDefault(); }
  70. editor.addEventListener('touchstart', handleTouch); editor.addEventListener('touchmove', handleTouch); function handleTouch(e) { for (var i

    = 0; i < e.changedTouches.length; i++) { let elem = document.elementFromPoint( e.changedTouches[i].pageX, e.changedTouches[i].pageY ); if (elem.tagName && elem.tagName == 'TD' && 
 editor.contains(elem)) 
 { drawPixel(elem); } } e.preventDefault(); }
  71. let socket = new WebSocket( "ws://" + window.location.host + "/ws"

    ); function drawPixel(elem) { if (elem.dataset.color != currentColor) { elem.dataset.color = currentColor; elem.style.backgroundColor = '#' + currentColor; socket.send(JSON.stringify({ command: "draw", x: elem.dataset.x, y: elem.dataset.y, color: currentColor })); } }
  72. let socket = new WebSocket( "ws://" + window.location.host + "/ws"

    ); function drawPixel(elem) { if (elem.dataset.color != currentColor) { elem.dataset.color = currentColor; elem.style.backgroundColor = '#' + currentColor; socket.send(JSON.stringify({ command: "draw", x: elem.dataset.x, y: elem.dataset.y, color: currentColor })); } }
  73. {
 "command": "draw",
 "x": 5,
 "y": 5,
 "color": "ffffff"
 }

  74. {
 "command": "draw",
 "x": 5,
 "y": 5,
 "color": "ffffff"
 }

  75. None
  76. None
  77. None
  78. socket.onmessage = function(msg) { let data = JSON.parse(msg.data); if (data.command

    == "draw") { let elem = document.querySelector( 'td[data-x=' + data.x + ']' + 
 '[data-y=' + data.y + ']' ); elem.dataset.color = data.color; elem.style.backgroundColor = '#' + data.color }; } }
  79. socket.onmessage = function(msg) { let data = JSON.parse(msg.data); if (data.command

    == "draw") { let elem = document.querySelector( 'td[data-x=' + data.x + ']' + 
 '[data-y=' + data.y + ']' ); elem.dataset.color = data.color; elem.style.backgroundColor = '#' + data.color }; } }
  80. demo

  81. the mystery
 of the 
 haunted mailbox

  82. mail box

  83. magnetic contact

  84. when the mailbox opens it sends a signal

  85. http:/ /pixel.local/api?command=notify&icon=mailbox

  86. None
  87. None
  88. None
  89. solution #1 combine the 
 magnetic contact 
 with a

    motion sensor?
  90. solution #2 turn off the
 magnetic contact with
 strong westerly

    winds?
  91. solution #3

  92. the fickle
 washing machine

  93. None
  94. None
  95. Standby usage
 4,6 watt Washing machine off
 0,3 watt Start

    program
 24,9 watt
  96. None
  97. Laundry is done

  98. Laundry is done Laundry is done Laundry is done Laundry

    is done
  99. None
  100. 2000 watt

  101. 20 - 200 watt

  102. 2 - 5 watt

  103. Laundry is done Laundry is done Laundry is done Laundry

    is done
  104. None
  105. commandArray = {} if (uservariables['WasmachineBezig'] == 2) then s =

    uservariables_lastupdate['WasmachineBezig'] lastUpdate = os.time{ year=string.sub(s, 1, 4), month=string.sub(s, 6, 7), day=string.sub(s, 9, 10), hour=string.sub(s, 12, 13), min=string.sub(s, 15, 16), sec=string.sub(s, 18, 19) } difference = os.difftime (os.time(), lastUpdate) if (difference > 300) then commandArray['Variable:WasmachineBezig'] = '0' commandArray['OpenURL'] = 'pixel.local/api?command=notify&icon=shirt' end end return commandArray
  106. Laundry is done

  107. None
  108. None
  109. questions?