IoT: Revolutionizing your home

In the previous post I briefed about IoT and Eclipse IoT. In this post I will explain about home automation and Eclipse SmartHome which is a framework of Eclipse IoT.

Home automation:

Since the beginning of technology, people started automating things and we have come to a point where most of the work is being done with the help of automated machines. Now is an era of automating the automated machines so that they can behave according to external conditions and choice of a particular person. Home automation is part of this evolution. From Wikipedia:

Home automation is the residential extension of building automation and involves the control and automation of lighting, heating, ventilation, air conditioning (HVAC), appliances, and security. Modern systems generally consist of switches and sensors connected to a central hub sometimes called a "gateway" from which the system is controlled with a user interface that is interacted either with a wall mounted terminal, mobile phone software, tablet computer or a web interface.

Home automation: present scenario

Currently the market of home automation systems and IoT gadgets is heavily fragmented. Many big organizations are creating devices for home automation and using their proprietary protocols for connecting those devices to rest of the world. Let’s consider a few such devices:

  • iHome’s SmartPlug is a wifi-enabled SmartPlug. We can connect products such as lamps, fans, or humidifiers into its socket and control them remotely while we're home or even while we're not.
  • netatmo’s Weather Station provides weather information of home as well as outside. Its Indoor module measures indoor comfort and provides vital information, alerts us when we need to air out our home to bring down its pollution level. Its outdoor module gives us real-time weather information gathered right at our doorstep.
  • Sonos's Smart Speaker can stream all our favourite music to any room or every room.

All these devices come with companion apps for Android and iOS platforms and we can communicate with these devices using their respective apps. This way we can control these devices or devices can notify us on occurrence of various events.

Home automation: future

Do you really think the above mentioned system is automated?

Actually it’s not, let me tell you how. In the above scenario, there is no interaction between devices and we need to control all the devices ourselves. Wouldn’t it be nice for us if all of these devices could communicate with each other and react accordingly.
So, for example, if humidity in the room drops below a certain level, weather station could notify it to smart plug and the smart plug could automatically switch on the humidifier. Similarly if air quality is bad, weather station could tell this to Sonos speaker and speaker could actually tell us ‘Hey! better open the window now’.
This way we don't have to do that ourselves as it could all be automated. It is possible by one of the following two ways:

  •  We can define some universal standards that all devices should implement so that everything is compatible with each other. It's a nice idea but the problem about this idea is that too many people believe in it and are trying to implement it, which results in:
Standards Proliferate
  •  We need some framework which makes interaction possible across devices and protocol boundaries by creating an abstraction layer over the proprietary solutions. Eclipse SmartHome is one such project.

Eclipse SmartHome:

Eclipse Smart home is an open source project to build Smart Home Gateways. It accepts the fact that there is a vast variety of communication mechanisms for home automation devices, which all have their right to exist so it provides an abstraction and translation framework that makes interaction possible across system and protocol boundaries.Its aim is to provide a simple drop-in server where devices can be connected and driven from a user interface, whilst allowing a general mechanism to control all devices. Although many of these devices may have their own mobile applications but they cannot be integrated together. Using SmartHome as the main hub, the devices can all be controlled with one mobile application or website, and scripts can be set up to drive individual components. Following is the high level interaction model:


In this system, physical components like Philips Hue bulb, Sonos speaker etc are represented as OSGi bundles, they all communicate over an event bus, which means that anyone can plug in scripts or bundles that can listen to changes in the environment and modify its data. A persistent item state map builds up a view of the system which changes as the system evolves, which can be used to query the current state of the system instead of just dealing with event-based triggers.

Eclipse SmartHome is a framework(comprised of a set of OSGi bundles), not a ready-to-use solution. It offers a large set of features to choose from and leaves enough possibilities to design a smart home solution specific to our expectations. OpenHAB is one such ready-to-use implementation of Eclipse SmartHome.

OpenHAB (Open Home Automation Bus):

openHAB is an open source software for integrating different home automation systems and technologies into one single solution that allows comprehensive automation rules and offers uniform user interfaces. It is designed to be vendor-neutral as well as hardware/protocol-agnostic and can run on any device that is capable of running a JVM (Linux, Mac, Windows, Raspberry-pi). It comes with different web-based UIs as well as native UIs for iOS and Android.
It focuses on four different functional blocks:

  1. Discovery, setup and configuration: OpenHAB provides a feature to discover different home automation devices available nearby and connected on same LAN. For discovering and controlling these devices, it uses their respective OSGi bundles.
  2. Rule Engine automation: openHAB has a highly integrated, lightweight but yet powerful rule engine included. "Rules" are used for automating processes: Each rule can be triggered, which invokes a script that performs any kinds of tasks. We can define rules to control the devices so that they can react based on environmental conditions and/or our personal choice. An example of rule can be: Light is turned on when there is motion detected and brightness is below threshold. Every one minute, it is checked whether there was motion since the last check, if not then turn light back off.
  3. Data Handling, REST APIs and Persistence: OpenHAB provides mechanism to store data related to devices, expose information to a REST API and send it to a cloud database for further processing.
  4. Modes of interaction: It provides graphical user interfaces for web and mobile devices. It also enables user to interact with devices using voice commands so we can directly use our iOS devices and can use Siri to talk to our home and take control of the things.

To summarise, Eclipse SmartHome and OpenHAB are very modular and extensible home automation solutions which have already started revolutionizing our home although they still have a lot of potential to grow in the near future. You can further explore Eclipse SmartHome and OpenHAB.

IoT: An upcoming revolution

This is a series of two blog posts which briefs about IoT and Smart Home solutions. In this first post, I’m going to explain what IoT is and why one shall care. In the next post, I’m going to write about Eclipse SmartHome and its implementation OpenHAB.

Internet of Things (IoT)

IoT is one of the most popular jargons these days in tech industry. Different organizations and individuals provide distinct but somewhat similar definitions of IoT. For me Internet of Things is an extension of Internet as evident from the following definitions of Internet and IoT from Wikipedia:

"The Internet is the global system of interconnected computer networks that use the Internet protocol suite (TCP/IP) to link billions of devices worldwide."
"IoT is the network of physical devices, vehicles, buildings and other items—embedded with electronics, software, sensors, and network connectivity that enables these objects to collect and exchange data."

In a nutshell, IoT is a proposed development of the Internet in which everyday objects have network connectivity, which allows them to send and receive data, also these devices can react on this data intelligently.

Why one should care about IoT:

In today's Internet most of the information available has been generated by humans whether it is text documents, images or videos. With IoT, machine generated information is being made available on the cloud. This will increase the accuracy of available information and reduce the cost of generating it.

Internet revolutionized how people communicate and work together, information availability for everyone and everywhere. It transformed life in ways that were hard to imagine in its early stages. But the next wave of the Internet is not about people. It’s about intelligent, connected devices i.e. IoT devices.

IoT devices collect and analyse data as well as react on data by sending a notification to a human being, by taking certain action or by sending data to cloud for storage and further processing.

For example, a heart rate monitor is an IoT device which can monitor heart beat of a person (collect data), analyze it and notify the person of sudden changes in heart beat so that the person can take necessary actions. Also, the analyzed data can be sent to the cloud to be used by medical staff.

Communication in IoT:

IoT is the future in which all sorts of devices and sensors communicate with each other and with distant computers and other systems to operate in a seamless fashion and transform our world. Some devices might be hardwired into an existing network whereas others communicate wirelessly. Following three types of communications are required for IoT to function properly:

  • IoT devices should communicate with each other (Device to device communication)
  • Generated/collected device data must be sent to the cloud infrastructure (device to cloud communication)
  • Next, cloud infrastructure has to share data with each other and possibly providing it back to devices, to analysis programs, or to people. (cloud to cloud communication)

Many protocols have been developed by different organization to meet the above mentioned requirements. Following are example of few such protocols which are already popular or gaining popularity:

  • DDS (Data Distribution Service)
  • OneM2M (Machine to Machine)
  • MQTT (Message Queue Telemetry Transport)
  • CoAP (Constrained Application Protocol )
  • XMPP (Extensible Messaging and Presence Protocol)

Eclipse IoT:

The current state of the IoT industry is characterised by closed proprietary solutions that limit interoperability between solutions and lock customers into a particular technology.
In current state of the IoT industry above mentioned protocols (and other IoT protocols) have proprietary implementations that limit interoperability between solutions. For Internet of Things to be successful it needs to be built on the principles that made the Internet successful i.e. open standards and open source software. Here comes the Eclipse IoT, which is an ecosystem of companies and individuals that are working together to establish an Internet of Things based on open technologies. It provides open source implementation of protocols so that different vendors can utilize them in their products and solution vendors can write a single solution to control these products. Also, communication between these products is possible because they are following same standards. Eclipse IoT provides the following Implementations of IoT protocols:

  • Paho (client implementations of MQTT)
  • Mosquitto (server implementations of MQTT)
  • Californium (implementation of CoAP)
  • OM2M (implementation of One M2M)
  • Leshan (implementation of lightweight M2M)

Apart from protocol implementations, Eclipse IoT also provides a few services and frameworks based on these protocols. In my next post, I will write about one such framework for home automation i.e. Eclipse SmartHome.

Stay tuned!

Droidcon India 2014 Experience

Last week we attended Droidcon 2014, held in Bengaluru. First thing we noticed was that we had underestimated it a lot. The event was humongous. With around 250-300 attendees, most of which were either cream Android devs or entrepreneurs.

The content selection panel as well seemed to have done a great job. Topics ranged from core technical (hacking through Android source code) to all the way upto UI centric stuffs (delightful user experience). The speakers were highly experienced and most of them were either business owners or with hands-on experience in product development. Even the promotional interactions were highly informative and bent towards their technical details.

Following are some talks we would like to mention particulars about:

Read more

Tips for Designers: from a Developer

Android is a versatile OS with more than 1000 device manufacturers and more than 18000 distinct devices. Screen size of android phones vary from 2.6” - 6” and the resolution of screen ranges from 240 X 320 to 1440 X 2560 px with screen density from 120 to 640 dpi (ldpi to xxxhdpi). It is difficult for designers to create such designs which work well on all these devices irrespective of the size, density and aspect ratio of device and still stay developer friendly. In this blogpost I will discuss some useful techniques that ease out the painful design implementation in Android devices that I've learnt over a period of time.

Android's way of dealing with this diversity:

Android provides basic structure to support these devices by putting them in different density buckets i.e. ldpi, mdpi, hdpi, xhdpi, xxhdpi and xxxhdpi.

Read more