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

all smart life really big and 15 years okay talk to later okay my name is Marcus man I’m senior consultant at solutions a relatively small company my job there is normally I consult or help our customers with j2ee or java enterprise architectures and we besides of this traditional definition of this business as I would call it we have our customers in the insurance and energy industry we also provide something we call innovation consulting where we try to help them move their business into the digital world where many things are happening as Christian said before and that’s also the main reason why we are interested in showcases and live demos because we really have in the insurance industry is not known as the innovative of industries and we need to have solutions or need to have showcases where we can just show them and make them feel how this topic works and that’s how we get in contact with Christians company this yeah and I get myself wired ok ok so basically we in our main and our topic title we have the topic fire detection and break-in detection that’s basically how we came into this whole topic and fires are really life threatening the interest of fires are one of the dangerous at home and there are two thousand fires every year in Germany taking more than four hundred deaths four thousand have it partly heavily insured people and also 1 billion-euro of damages in prop in private property so it’s really a big danger in home and also where there’s fire there’s smoke so not only the saying goes with a smoke test fire the real danger in this case is in fact the smoke so most people are not insured by the fire themselves itself but are injured by smoke so actually if you I did some research and and there are people saying that three

breaths can be sufficient to die so it’s a very toxic cocktail of gases and even the read about one story where even one breath had lifelong consequences so smoke is is really the danger here normally you would say if there’s smoke then you can smell the fire the problem is seventy percent of fires start at night where the human sense of smell is inactive or switched off so you don’t really notice that there’s a fire that’s that’s a great danger and that’s where also those little friends are quite handy coming in quite handy and signal if there’s smoke signal that there’s a fire and you can can effectively save lives by helping you to get out in time so how much time is there so I also did some research and people say that you got four minutes to leave to leave the house when the counting when the fire started so after the first spark four minutes the problem with that is our two to four minutes in fact so the problem with this that is the smoke detector will non-normal smoke detectors should signal after about two minutes because there’s sufficient amount of smoke then and this leaves you with two minutes to get all so if you ever hear a smoke detector at night and and smell smoke then just get out as quickly as you can so and that’s also a main reason why those things starting to get mandatory so you as a they are mandatory all right right now in France and in Germany they will get mandatory in terminates 2018 there are some states in Germany whether in fact already mandatory and also for not only for new buildings but also for yet property you you have so if you own a flat or small house or house then you will have to think about smoke detectors at latest 2018 and most people when they think about smoke detector so I don’t know can you raise your hand if you have a smoke detector installed Wow very cool in the year 2000 i think in germany that was 2 percent of the population who had a smoke detector and now it’s around 40 so i think should be more than 40 years so in the states where there are more laws in effect or the laws are in effect those numbers rise up to 80 85 and so in 2018 in germany people will start to have really by smoke detectors i could also ask who has a smoke detector at home but not installed or battery is low but I leave this so actually in 2018 everyone will choose between the simple solution available cheap go to the market and just buy one and there is also room for advanced solutions and especially in a smart home context we try to explore and try to find out because our customers endings in the insurance industry are actively searching or interested in solutions for home security normally the insurance business is they pay if there’s on damage on the house and what the opportunity for them would be is to actively get you a secure solution with which has some extra features and we were starting to think in the smart home context but what could those features be so we came up with some ideas for improvements maintenance battery status connectivity just to find out the state of the solution and also improved security so that the solution itself can come to a point where it actively costs the fire department if there’s a fire and what we did I I usually call it so a showcase so it’s not a product so I really will show you afterwards what we’ve done here we are not building a product we are building our demonstration so our objective wasn’t really to get this edgy and and yeah completely hi usability solution but just to show the the field to our customers and also to evaluate available technologies that you can just go and buy and go and download open source technologies what just what’s the state of the of the market what can be

done easily and then also to iterate and get out or find out about the features so Showtime I hope everything works we have this Beamer here AB which you can see after I explained to the basic architecture of our solution so basically what we have is we have components inside of the house we choose romatic as just openly available standard you could choose another standard then we have this home server which we explore and detail later on then we have MQTT broker outside of the house we heard about this today in the morning about MQTT and then we have this app which just connects to the to the amputee broker and when we look have a look quick look on our maintenance features it’s all in German web I translate it to you I hope everything can see a little the camera can’t but what we have is we have this fire yeah perfect fire Security section here we can have a feeling about the status we can see that everything is a screen we can go into details and see that we have in fact to smoke two decks to see one for a living room from one for the sleeping room and we can it’s just raise the test alarm and then we see what would be shown on the on the telephone when there’s a test and then actually those things should start to pee what they don’t do which is a little bit of a concern at the moment okay that didn’t work normally those should start to beat now and find out that the code configuration as is okay they don’t do this yet I will found I find out why when you talk and hopefully we get to a point where it works again so and what you can also do in the app is you can quickly call an ambulance or fire fighters if you see a fire and the smoke detectors haven’t yeah signaled yet and for the smoke a use case for the smoke detector use case those are normal licensed smoke detectors so if they signal every other if the communication is working every other smoke detector will signal to and then but also will happen is that the home server the signal why are the MQTT broker will signal the alarm and you can also have adapters for emergency services on this hyphen q platform and come to a point where the body ambulance or fire department will come I think I underwire myself I think we really have to restart yet that’s the only thing we had okay so so well my Marcus is trying to to reset our demo and to show you the the final demonstration which is pretty much the most impressive one because this was only a test alarm later on we showing the real fire alarm but but first first of all before that I will just talk quickly about what what’s outside of the house so basically we heard it today from from any Sanford Clark MQTT is a protocol which is very lightweight and ideally use for the Internet of Things so in this case we use MQTT here and qet spaced on publish-subscribe so if we for example have 111 temperature sensor that sends its data regularly on a topic called temperature for example and then the MPD broker which is in the middle of the whole communication like the dispatcher of all the messages will send this to all subscribers a subscriber is basically any device that has been subscribed to game duty broker beforehand and yeah that’s basically come with how the communication works so so the in our case the one of the app is

like this episode subscriber and the publisher is the home center and then it will get over over the internet and to our high simply broker in the cloud which actually in the showcases locally on this raspberry pi Marcus is showing later but in the real showcase it’s on the internet and then goes to the airport or any other device so maybe the question is i will just elaborate a little bit more why we chose m qu t forget to use case so basically the most important thing is it’s very lightweight so it’s painless efficient if you want to have you have more and more devices and it should be at most very compact and not very verbose so this is why we didn’t choose HTTP for yet another another yeah well point is it has this push capability so publish-subscribe always means that you will get the values in real time so if M cutie devices have open tcp connections and with his open TTP connections they can they can get get the messages as they are triggered so there’s no delay in while like why like normally you would pull some device or some server to get this data and also you have this great thing which is called quality of service that automatically is built into the protocol and allows you to handle different guarantees of messages of the message is arriving or not so you can just say okay I want to just in the message and they don’t care about arriving so I say okay just try to send it in if there is or some package loss or something and it is yeah it will not arrive but you can also say I want to arrive I want to make sure this basic message arrives and then you set this quality of service level one step high and then the message arrives yeah another point is it works great behind the firewall so why why most of devices like when you use HTTP this is problem with nothing in you’re on your own in your home so that’s when your external device cannot just ask devices inside your home but in the case of em QUT the connection is yeah it’s just maybe a trousseau to next next slide and I can tell you a little bit more so we have to fire wall here and so this this is more like home your home central Central Station trust connects two hyphens i reviewed mqz broken of choice and that’s this connection from within the house so there is no issue with connecting connect or using the device from from outside the household in this case is also possible to the app from outside can publish for example the test along we just have seen and without without having to call this this device directly but which is already connected to the broker and then therefore receives this this message so basically what the MPD architecture is here so we have it’s pretty simple for for the showcase so we have to home home Central Station which publishes an alarm if there is one publishes a regular status of the smoke detectors and a regular battery status and also it subscribes the test alarm so when we click the button as Marcus just did then we will get the test alarm signal into the home sent and then it will trigger all the smoke detectors the same is also the app shows the shows all the statuses which is the which the home home server is publishing and shows that in the app okay so let’s just let’s just talk about high from Q why we use the hyphen kunda that specific specific case so first time cues and QT broker for its yet built for high performance use cases it’s highly scalable you can cluster it and it also has this open plugin system an open-plan system is an hour now a few a key point because you can easily plug in other stuff like my colleague Dominic show yesterday it’s also possible to let em qet call your cell phone for example or send text messages to this stuff if you’re integrated with for example it will you api it also supports the british protocol so we can talk to other brokers for example and with native WebSocket support we also have built a mobile web app for web browser to also use this live data to show the statuses so that’s that’s pretty much why why we watch the what I’ve mq at a glance and why we used it example for this project and you can see here the overall architecture a little bit so we have 5 mq in the middle in the fourth for the

cloud for a cloud deployment we have the mobile device connected via m qg t we have a lot of web dashboard that’s connected over increase your web sockets and then we have other services or other plugins that are pluggable which you actually are not in the showcase yet but would be easily possible so that’s actually actually possible so we can send the SMS and there is a smoke alarm we can it’s possible to call any other API with having to plug in if there is a message on that topic and also we can process the data for future use or for historical data to see the whole overview of maybe the whole whole year in the smartphone what what alarms happened what was the status when was the battery empty to to see some kind of patterns and to show this to the user so that was basically from from outside the house now i will get give back the microphone to marcos and he will tell us a little bit what’s inside the house yeah the Select is remarkably interesting I think the problem is in yep so let’s see you could if it will work but I’m not quite sure i can tell you why then i’m only when we come to the architecture so basically let’s take a moment to explain you what what’s exactly what we did in there also we have this smart home server which is this little box which from my perspective i think is is working quite fine at the moment which is in fact the Raspberry Pi I think you all know what while the Raspberry Pi is what’s interesting is this password ccd which is a component you can just get inside on the internet which is basically something like a shield for a Raspberry Pi which enables you to have radio on 846 I think megahertz and there are many smart home protocols which which are using this frequency and you can actually connect 20 to a lots of them we have used home attic here which is why we have this o matic smoke detectors and there’s also Max and some German German providers and also some international loans which which you can basically connect to wire this proverb by this frequency so and what we also have is this Wi-Fi stick which is barely visible those get smaller and smaller every time which just gives us connectivity to the internet from this from this box and on the softer side what we use is open hop as integration platform we will hear a little bit about this later on and home gear which is actually something like a driver it’s also open source it’s quite cool it’s like a driver for this home attic automatic system and Omaha I have taken this from their home page because it’s I think it’s perfectly accurate Omaha is a software for integrating different home automation systems and technologies into one single solution so we’ve open app you you kind of have the possibility to to have a load of different plugins for different protocols and get everything in place in one in one integrated solution and actually can can play with a lot of technologies in this in this context which is quite cool and also from the basic architecture is really simplified diagram that I put up here the core components of OPA hub are currently moving to eclipse which is a clip smart home so they are actively developed and are changing very rapidly as so I think we’ve started the showcase thing about half a year ago and it’s really moving moving really fast they get in many features and there will be coming very interesting eclipse eclipse matam will be coming very interesting and for the other things that are built on this core components the main easiest components are items protocol bindings and automation logic and I like to go a little into detail what these are so items I think the main at the real time is item providers are basically representatives of the physical world around you so if you in this platform you can define items which are mapping

to yeah real devices and also numbers or switches on these devices or in the yeah energy world you would have a temperature sensor for your heating and number of the current the current value in the room will be one of these items currently the temperature of the living room for example one will be one item so you define those things and define a model of your world and then have those protocol bindings there are many we mainly use home attic and MQTT bindings where you can use the binding technology to bind those virtual representatives now to the real device so you can actually configure the item to map to a channel on this on this device and then actually if you do this it’s it’s no coding involved it’s just configuration after you’ve done this you can actually have Eclipse dashboard where you can just switch on and off things which is not that useful with smoke detectors but you can map switches and sensors and just actively change the values and what then makes the home really smart is this automation automation automation logic module making actually with with some language specific language for open up can define rules what to do if something happens so it’s basically if them rules where then is just a function you type good so it might get loud I doubt so because I think the main problem at the moment is that I can’t connect to the Raspberry Pi from the app what haunts us with these things it is that it’s kind of a side project of us and and the app for example was done by a student of ours and the the Raspberry Pi thing was was done by some as somebody else and they are also sometimes subtle problems with that at the moment the problem is a little more yeah shows shows a little more I can only tell you what should happen at the moment so it probably won’t god it won’t get loud yeah for any case yeah for fun the first rule for any case so let me just tell you what what we did because basically it’s it’s something we heard today in the keynote the main thing with the smart home platforms us that once you have ruled out the infrastructure or install the infrastructure you can have more use cases implemented quite easily and most of the time you can combine things that don’t really belong together to do something working really cool and what we what should happen or what we have is we have this home attic switch which is not really sexy but you can also have this these installed in the light switches so you can control the light in the room switch it on and off and normally in your short case we use this switch just to symbolize every light in every room in the house and with that first thing what we did is in the in the smoke detection use case is just if the smoke detectors get go off all the lights will go on so if it’s at night and you you want to go to get out then this is quite handy and then the next thing this one in German says breaking detection with this component which you normally also use for for heating that’s a door sensor so actually it’s it’s a magnet magnet contact which is mounted on the door and the other one is mounted on the frame the other part and if it’s opened in signals that that yet the door is open or windows open normally for heating you would have to hit him to go to go down until the windows closed again and in our case but we did this if the door is opened the lights will start to flash and the whole house everything is starting to flash and all the smoke detectors will go off so everything will be really loud so and those are really loud and this is something normally we

just show our customers to get the feeling of how how this integration works with with just creating new new use cases and as you’ve seen it didn’t get loud so I broke in and it didn’t get loud the ear plugs are not needed but for the ending part I will leave this to Christian if you smoke yeah yes oh sorry that the the cool demonstration did work because we try it this weekend and also we tried many times it always worked worked fine so I’m really sorry that this is but this is I think this is this is the thing with live demos and yeah so sorry for you guys we will maybe we will also do this again and a conference and I repost a video online so that you can all see what should have been happen so it’s only the favorite for them so to wrap to wrap this session up I want to go to some few steps what we could improve to bring this showcase into a production kind of scenario so first of all at the moment everything is wide open so we don’t use any security on the on the communication outside of the house is pretty pretty open and also a communication inside of the house so there would have need to embrace more authentication and authorization logic in order to see which devices are there and how they are into a interacting with amputee broker for example and I’ll devices into it too just a little bit limited to that for each device to say okay this device can only publish for example on that topic and this device can only do that in this device can only for example subscribe to that topic so there’s no attacker can just reduce your sensible data out of your home or just use the system and to let go of the alarm every three o’clock o’clock in the morning to wake you up and who maybe disturb you so this is a big big big steps and also pertinent number three I think we just experienced that so we should have used sophisticated hardware to make to make this more sophisticated more approval against Arizona against some also some as we heard today morning from from ND debt there’s the stuff has been waterproof if it’s outside the house for example and other things you know hardware is sophisticated and also yeah capable for today’s day life and also some some platform improvements meaning that some additional services should be attached to this maybe we showed it in the in the overview emergency services could be triggered automatically as services maybe your neighbors could be included in the whole system that the neighbor will also get a kind of fire alarm or any notification of this this house is very near to your house or you flat this up off somebody else’s fled to integrate this also together that you have a very integrated solution and I’ll only help you but also help your community or your immediate neighborhood and these are basically the points we see here I think there are also many many other things which are with this one hour before for a big stuff to be identified and also we also have some lessons learned so it’s definitely possible with current technology to build such a smart home solution so technology is there it has to be maybe refined than someone to edges but in general it’s possible to build such a solution also as we we have seen the smart home ages really transforming rapidly so we are going from almost no such interest about 10 or 20 years ago into now monitoring everything from from our energy level energy consumption out and any other stuff which is mostly also like also like to do it because it’s cool or it’s fun so that is rapidly

changed and will also change change more and also it’s of course it’s cool to see that some things like open hub involve which is an open source technology and now one of the Eclipse Foundation which is there it’s possible to to use for for this for this stuff and to just take it and just build something without coding too much so we can just easily like you can see you open up open up interface and is it working now okay okay good news so I will just end with the slide and then we will try again with the demo so and another thing is of course we we always need certificate of certified components for a smoke detector which we have here is its certified so it has to be always have this integration from the certified components from manufacturer that it has that has like a mess and mass production and to use these devices intelligently and integrated with other stuff because I think there is no it’s very difficult to use devices that are not officially approved by government or other other institutions but that’s the four biggest lessons learned we had two in the project and if now we’ll give it over to Marcus again and we hope that the demonstration is ready now and you all guys you all hear some real fire alarm action there’s some out-of-the-box dashboard any tips that you can use and they’re all everything works fine now so what we did is then you activate the alarm just the lights in the house will go on and off again so you can and also it comes in handy because otherwise I like taking up energy and actually if someone wants what size it’s really doubt I would encourage you so anybody okay everybody is so perfectly so now just thank you for coming to our session and i hope you have learned something new and we we also here for for today and if you have any questions just ask them now or come to us afterwards and we will answer them thanks