 Thank you, thank you for waiting there. Good afternoon ladies and gentlemen, welcome to my lightning talk on reaching out to the physical. My name is Mark Corbyn, I'm a senior engineer at Acquia, based in Brisbane, Australia. Oh, and we'll click it. Yes, beautiful. My role as a senior sport engineer is helping to keep websites up for customers as well as helping out when there's any difficulties to get their sites back up and running. The areas that I cover in my job can range from a whole different areas of technology. Very similar to what Enzo was talking about this morning, I need to be across quite a number of different areas to help people with their websites. In my role I can be helping customers to get their site back up by flushing memcache, by using a system with SSL certificates, or I can be helping them to debug Drupal modules to get the site working in the way that they want it. What led me to OpenHAB and Drupal, which is what I want to talk about today, was a journey started when my mother, who lives an hour away from me, I wanted to find a way to help her with security. What I wanted to do was have an open source solution as well as a cheap solution. In looking at this, we had a new addition to the family. We had a new little dog, two months old. Because we were working, I basically developed a way that we could set up security cameras on our balcony using Raspberry Pi and we could watch our puppy from when we were at work. This led me to produce a module in Drupal 7, which was essentially a alcohol sensor. You could breathe into it, it would detect a number of alcohol and display that value in Drupal 7. This led me to discover this thing called OpenHAB and I've gone ahead and developed a module for that. As I've looked more into this, I've discovered the joy of the web of things and the power that that can provide to us. The web of things is getting more attention these days. We've got a whole lot of companies like Ellips, Samsung, Belkin and even obviously Google, Google Home and Amazon Echo are all producing devices with network settings. What this gives is each of these devices will essentially have their own application that needs to be run. For a person that wants to run this in a smart home on their own there's no central way to do this. So one project that has brought a solution to this is called OpenHAB. OpenHAB stands for Open Home Automation Bus. It's an open source home automation platform which runs at the centre of a smart home. It is built on the Eclipse smart home framework, the same Eclipse that you may have come across in doing development, the Eclipse IDE. It controls all your devices set up on the web of things from one place, that place being in your browser or as a smart phone application. You can download OpenHAB version 2 at the moment to run on Windows, Linux, Mac OS and Raspberry Pi. Can I get a show of hands of those that have not heard of Raspberry Pi? You're familiar? Excellent. So you know that this little device can be used for a host of things. What this is used for OpenHAB is this will run an OpenHAB server called Openhabian so you can install that on the Raspberry Pi and run that to be essentially your smart home centre. Today I have a demonstration of OpenHAB running on Raspberry Pi known as Openhabian. In preparing for this talk I realised that I couldn't show you a whole host of devices connected to it. I was a little bit worried about having to bring those from Brisbane through Singapore. So I had to think of what would be the best device that I could use to demonstrate OpenHAB working in front of you guys. I've chosen one thing and I think it was the only thing that I could choose. I'm very excited and I think you'll be very impressed ladies and gentlemen because the object device that I want to show you today ladies and gentlemen is the internet. A few who may be familiar with this device or may have seen the documentary the IT crowd may observe that this version of the internet is an upgrade. You can see that on the side we've got cables coming out for optic fibre and the light has been upgraded to a blue light. So what I wanted to do now is show you OpenHAB and so what I've got there is in the front you can see there's a little blue case that is actually a very cheap Kodak camera case that I've managed to squeeze a Raspberry Pi into and we've got the Raspberry Pi connecting to the light flashing on our internet. So what I wanted to do is just give you an example of OpenHAB itself running on the server. So when you first go to OpenHAB you're presented with this page which has eight different areas where you can figure OpenHAB. You can use it to set up what they call items which are essentially devices that you want to connect to and site maps. So a site map will be a collection of devices that you wish to control. You can also configure OpenHAB settings and different views that you want the users to use. Today I'm only going to focus on the first two here, the REST API and the basic UI. If we click through to the basic UI you can see that this is presenting with the available site maps that we can connect to. And you can imagine that like a room full of devices that you want to control the air conditioning, lights, turning on the TV, etc. That can be all part of a site map. If we click through to that site map you're presented with a number of different devices that you can control through the site map. In this case this is just a dummy for the demonstration. We've got the light which is essentially on the internet. We've got a TV channel. We've got a kitchen light that can be dimmed or brightened. A LED light colour. Some of you may be familiar with the Philips Huey lights. You can change the colour on those and vary the intensity. And a simple switch. None of those are connected except for the light. So what I'd like to do now is you can see there's a toggle button here. I'd just like to toggle that off and you can see that I can move the Raspberry Pi to the light. Now just bear with me because it is the internet there will be a brief stoppage in transmission. So just bear with me. So if I click on that our light's gone off. And if we click on it again we've got back our light. So that's essentially controlling the light through open hat. What I want to show you now is the REST API that's associated with open hat. So if we click through the REST API what I really like about open hat they've done a lot of work on this page in particular and a lot of work on the API. All this is the different endpoints that you can use for the API. I just want to show you one here today which is items. So if we click through that you're presented with a number of different methods that we can use for items. And if we go down here to the post you can see there's an items and the item name. What we do now is you saw before that it was the name the light. So if I enter that same name and what I need to do is give it the status that I want to change the light to if I give it off click on try out and again we've got our light off. We can see the curl command that we sent and the response code. And we can do the same again and turn it back on. And there we go it's back on. So that's essentially open hab what there we go. So basically from that I was playing with this open hab and turning things off and on and I went well how can I use Drupal? So what I've done is produce a module that talks to the open hab server. The module consists of a core module the top one is open hab it basically talks to the API connection. A tester so I can put in the name of an item and test that. And a site map which is as I said before a collection of items that I can control. You can see here that all those three modules basically connect to through the REST API. The only the site map module is also and it's very experimental at this stage but I've used a JavaScript library called 3js which is used to render as a 3D representation of the site map. So if we have a look at that module there we go. So I've got this installed on a Drupal 8 setup. There's three modules here open hab module which is a core module open hab site map 3D experimental and open hab test module. If I click through to the config on open hab module you can see there's an open hab configuration basically the settings for setting up the server. We've got the protocol we want to use the IP address of the server name and the port that we want to connect on. Down below I've got a test connection. We click on that we should get crossing fingers a 200 response back so that tells me that I'm talking from Drupal through to the open hab server. We can also go to the open hab test items and if I enter the same name that I used for the open hab server click on turn off we've turned off and we click on turn on it's back on again. And the last module that I've got is the site map I'll just do a quick refresh. Very simple the site map at the moment. I've got a cube and a sphere in 3D and the cube represents the connection to the open hab server. So if I click on that the cube changes color and you can see the status here will change if we click on that click through you can see the time stamp changing all it does is retrieve a UUID from the server if we look at the sphere if I click on that it'll change the status so we got off and again if I click on it again it changes back to on. So that's essentially where I'm at with the module development there. There we go, cool. Excellent. So that's essentially what I've got in terms of module development and connection to open hab. Where I'm looking to go in next steps is I'm looking to add functionality of can I add an item? Can I configure an item? Can I add a site map? Can I configure a site map? In similar vein I want to add the ability to view site maps so you can see there I started with the 3D representation and Drupal being Drupal, it doesn't have to be that way, there's a whole lot of different ways and you can start to see that there could be a setup for that using tweak theming, using CSS 3 theming, things like that could really move that forward and obviously the ability to control items so at the moment I've just got the simple off and on but to use slide bars to change up and down the volume, the intensity of lights, things like that, there's a whole lot of different things that can be added to control the items there. And that ladies and gentlemen is my demonstration. I'll be available for questions at the end.