Top Banner
Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB
49

Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Jul 15, 2015

Download

Internet

Christian Götz
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Page 2: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Support their clients to successfully transform their

business in a digitized and connected world

expertise in MQTT the protocol that drives the internet of things

Consulting for insurance companies and other industries

Consulting and Creating of Building Block for the Internet of Things

About us

Page 3: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

SMART HOME LIVE

"

MOTIVATION

1

•  Showcase objectives •  Fire dangers

"

OVERVIEW

2

•  1st live demo - maintenance features •  Basic architecture

"

SETUP

3

•  Architectural details •  2nd live demo – break-in

detection

"

CONCLUSION

4

•  Lessons learned •  Outlook

Page 4: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Evaluate available technologies like MQTT, Eclipse SmartHome

We are not building a product!

Iterate and explore key features for an intelligent smart home

Showcase objectives

Page 5: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Fires are life threatening dangerous

"400 deaths

!

"4000 injured !

"200.000

!

€ 1 billion

!

Page 6: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

3 breaths can be sufficient to die

1 breath can have lifelong consequences

“Where there's fire there's smoke”

Page 7: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

of fires start at night where

human‘s sense of smell is asleep

70 %

Page 8: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB
Page 9: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Fire! Time to leave!

4 min 2 min

Page 10: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

SMOKE DETECTORS are mandatory

In Germany 2018

In France 2015

In USA 2010

h#p://www.fusac.fr/countdown3smoke3detectors/!h#p://www.rauchmelderpflicht.eu/download/Uebersicht_Rauchmelderpflicht.pdf!

Page 11: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Simple solution Advanced solution

vs.

Page 12: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Some ideas for improvements

01 Maintenance 02 03 Connectivity Improved security

Page 13: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Showtime !

Page 14: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Inside of the House Outside of the House

Basic Architecture

Page 15: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Architectural Details - Outside of the house

Page 16: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB
Page 17: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB
Page 18: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Subscribe

Page 19: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Publish

Page 20: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

temperature sensor

MQTT-Broker

laptop

mobile device

publish: “21°C“publish: “21°C“

publish: “21°C“

subscribe

subscribe

1 subscribe totopic: “temperature“ 2 publish to

topic: “temperature“

Page 21: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Why MQTT ?

Bandwidth Efficient

Push Capability Works great behind a Firewall

Quality of Service Levels

Page 22: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Quality of Service

Page 23: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Topics – Topic Tree

myhome!

livingroom!

bedroom!

smoke3detector!

temperature!

smoke3detector!

temperature!

/! /!

otherhome!

Page 24: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Topics

myhome!

livingroom!

bedroom!

smoke3detector!

temperature!

smoke3detector!

temperature!

/! /!

otherhome!

Page 25: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Topics

myhome!

livingroom!

bedroom!

smoke3detector!

temperature!

smoke3detector!

temperature!

/! /!

otherhome!

Page 26: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Topics

myhome!

livingroom!

bedroom!

smoke3detector!

temperature!

smoke3detector!

temperature!

/! /!

otherhome!

Page 27: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Topics

myhome!

livingroom!

bedroom!

smoke3detector!

temperature!

smoke3detector!

temperature!

/! /!

otherhome!

Page 28: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Topics

myhome!

livingroom!

bedroom!

smoke3detector!

temperature!

smoke3detector!

temperature!

/! /!

otherhome!

Page 29: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

• Open!Source!•  “Reference!ImplementaEon”!• Many!languages:!Java,!Javascript,!Lua,!C,!C++,!Go,!Python!!• AcEve!Community!

Eclipse Paho

Page 30: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Now some code!!

Page 31: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

MQTT Publish

MqttClient mqttClient = new MqttClient

("tcp://localhost:1883", “publisher");

mqttClient.connect();

mqttClient.publish(“test","test123".getBytes(),0, true);

Page 32: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

MQTT Subscribe

MqttCallback mqttCallback = new MqttCallback() { @Override

public void messageArrived(String topic, MqttMessage mqttMessage) {

System.out.println(topic +" "+ new String(mqttMessage.getPayload())); }

}; MqttClient mqttClient = new MqttClient("tcp://localhost:1883", “subscriber"); mqttClient.setCallback(mqttCallback); mqttClient.connect(); mqttClient.subscribe(“test",2);

Page 33: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

MQTT broker

Page 34: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

HiveMQ – at a glance

High Performance MQTT Broker ! ! Open Plugin System

Highly Scalable ! ! Supports Bridge Protocol

Clustering ! ! Native Websockets Support

Page 35: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

MQTT Architecture

Publish •  Testalarm

Subscribe •  Alarm •  Status •  Battery Status

Publish •  Alarm •  Status •  Battery Status

Subscribe •  Testalarm

Page 36: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Webdashboard

Emergency Service

any API

SMS (Twilio)

Integration of other Services

SQL/NOSQL!

Mobile!Devices!

MQTT!

P!L!U!G!I!N!

JDBC/other

HTTP

MQTT!over!Websockets!

MQTT!

Page 37: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Architectural Details - Inside the house

Page 38: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Smart Home Devices

Communication •  868 MHz •  BidCoS®-Protocol

(„Bidirectional Communication Standard“)

•  Supports „AES signed commands“

Devices •  Brand: HomeMatic •  Sold by eq-3 (ELV) •  Readily available •  Many different devices

Page 39: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Hardware

Software

Inside the House

Homegear

(v1.6.0)!

(v0.5.732)!

Raspberry Pi (Modell B) CPU: ARM1176JZF-S (700 MHz) RAM: 512 MB Power: 5 V, 700 mA (3,5 W)

Busware CCD •  CC1101 transceiver •  ILI9341 based 2.8" TFT

Touch Display •  culfw firmware

Extras •  Transparent case

(busware) •  WiFi-Stick •  Antenna

Page 40: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Hardware

Software

Inside the House

Homegear

(v1.6.0)!

(v0.5.2436)!

Raspberry Pi 2 (Modell B) CPU: ARM Cortex-A7

(4 x 900 MHz) RAM: 1024 MB Power: 5 V, 800 mA (4 W)

Busware CCD •  CC1101 transceiver •  ILI9341 based 2.8" TFT

Touch Display •  culfw firmware

Extras •  Transparent case

(busware) •  WiFi-Stick •  Antenna

Page 41: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

OpenHAB by Example

“openHAB is a software for integrating different home automation systems and technologies into one single

solution”

Core%Components%

Items% Protocol%Bindings% Automa6on%Logic%

Core Components were moved to eclipse:

Page 42: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

OpenHAB by Example

Core%Components%

Items% Protocol%Bindings% Automa6on%Logic%

Alert!

Ba#e

ry!Status!

Homem

aEc!

MQTT!

Raise

!Alarm

!

Prop

agate!

Alarm!

Page 43: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Again some code!!

Page 44: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Item definitions

/* Item format

TYPE ITEMNAME LABEL ICON (GROUPS) {BINDINGS}

*/

/* Group definitions */

Group:Switch:OR(ON,OFF) FireAlertDevices "Brandmelder"

/* Example item with binding */

Switch SmokeDetector1_Fire "Feueralarm Schlafzimmer" <fire> \ (FireAlertDevices,Schlafzimmer) \ {homematic="id=JEQ0736552, channel=1, parameter=STATE"}

Page 45: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Rule definitions

rule "Send MQTT messages on alerts" when

Item FireAlertDevices changed then

if (FireAlertDevices.state == ON) { // we find the alerting sd and only send an alert for the "first responder" var alertingSd = FireAlertDevices?.members.findFirst(sd|sd.state == ON) var String mqttItemName = "MQTT_" + alertingSd.name logDebug("MQTT", "Notifying mqtt item '{}'", mqttItemName)

postUpdate(mqttItemName, "ON") } else { logWarn("FireAlertDevices", "Ignored state change to " + FireAlertDevices.state) }

end

Page 46: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Integration with other components

It!might!get!loud!!

Page 47: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

STEPS TO PRODUCTION

Hardening / Security Cloud TLS, Authentication, Authorization, High Availability

01

Encrypt Inhouse Communication 02

Sophisticated Hardware 03

Platform Improvements 04

Page 48: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

Lessons Learned

! POSSIBLE TO BUILD A SOLUTION WITHOUT MUCH CODING

! THE SMART HOME WORLD IS CHANGING RAPIDLY

!INTERESTING OPEN SOURCE SMART HOME TECHNOLOGIES OUT THERE

!FOCUS ON ADDED VALUE AND INTEGRATE CERTIFIED SECURITY SOLUTIONS

Page 49: Smart Home Live: Intelligent Detection of Fire or a Break-In with MQTT and OpenHAB

THANK YOU

!