Professional Documents
Culture Documents
A Unified Web Interface For The Internet of Things: Kapil Kumar, Joy Bose, Samarth Tripathi
A Unified Web Interface For The Internet of Things: Kapil Kumar, Joy Bose, Samarth Tripathi
A Unified Web Interface For The Internet of Things: Kapil Kumar, Joy Bose, Samarth Tripathi
Authorized licensed use limited to: VIT University. Downloaded on October 24,2020 at 08:28:27 UTC from IEEE Xplore. Restrictions apply.
control hub for IoT using APIs, while others have a custom devices directly, since the web browser cannot handle the web
physical device used exclusively as the hub. content offline. In this aspect our approach is useful.
In the following section we introduce our proposed
architecture that is integrated with the web browser.
Authorized licensed use limited to: VIT University. Downloaded on October 24,2020 at 08:28:27 UTC from IEEE Xplore. Restrictions apply.
more intuitive and easier to remember. Other files in that
directory will be accessed under that URL.
Fig. 4. Flowchart representing the state handling and fetching the device
state for a particular location of a user
F. Offline Handler
This component allows the browser can get the status of
devices directly from the centralized hub (referred here as
Fig. 3. Flowchart representing the handling of the authentication process Smart Hub) through a Wi-Fi connection, as long as the
connected devices are using the same Wi-Fi. It does not need
to connect to the cloud server for this purpose, as in the
D. REST Interface Module existing WoT architecture. Whenever the user clicks on any
REST APIs are implemented in the JavaScript (JS) button or icon in the web content, the JavaScript function in
backend to allow communication (using a suitable existing the “onclick” callback will check if the device is connected to
protocol such as ZigBee or Z-Wave) between the client and the internet or not using the Device APIs.
the cloud server. The main APIs implemented in JS backend
are as follows: Fetch the authentication token using the If the device is connected to the local WiFi without any
username/password, fetch the list of locations for a user, fetch internet service, then the offline handler will try to search the
the list of devices in a location, fetch the current state of a Smart Hub in the same WiFi network using APIs provided by
device type, fetch the commands supported by the device, etc. SmartHub [18]. If the Smart Hub is available, all commands
will be redirected to the Smart Hub without the active internet
connection, allowing the user to control connected devices
E. Device APIs
without any internet. This was not possible in previous WOT
This component in the web browser application allows architecture. In this case, the Smart Hub will try to
JavaScript binding, which provides a mechanism to call synchronize the state of all devices when internet becomes
exposed Java APIs directly from JavaScript. The device API active.
has been exposed by JSInterface [17], which is an interface
for callback from JavaScript to a Java application. Using this, The implementation of the offline mode requires
any custom interface, such as ours, can be exposed to additional effort to implement the offline support handling on
JavaScript for callback to Java. Puder et al [25] among others the smart hub side. One issue with the offline mode is that it
have studied approaches for using native device APIs in web cannot support the devices from an external network or
based apps. location.
Authorized licensed use limited to: VIT University. Downloaded on October 24,2020 at 08:28:27 UTC from IEEE Xplore. Restrictions apply.
IV. INTEGRATED WEB OF THINGS (WOT) SESSION IN THE B. Device state and details
WEB BROWSER As shown in fig. 5, the user can navigate to a particular
In this section we describe the integrated interface for the connected device (such as a thermostat) and see all the details
web of things, using the web browser architecture described and properties for that device. Also, the user can select and
in the previous section. modify the properties, as per supported commands in the
device.
A. Integrated WoT access
The user can access details of the connected devices C. Services and interfaces of the unified web browser
within the web browser. The user may have multiple Smart interface for IoT
Hubs to control devices at different locations such as home, With the proposed unified web browser interface for IoT,
office, garage, etc. Using the WoT interface, the user can we can provide a number of additional services and interfaces
fetch all the devices connected to a Smart Hub. The user can such as the following:
also see all details about a device in a detailed screen,
x Bookmarking a device: Once this is done, the user
whenever they tap on any particular device icon.
can access the device features, properties and control
The user needs to enter their credentials to fetch the interface simply by clicking on the bookmarked
authentication token governed by the OAuth standard. Once device in the web browser. The quick access icon can
received, the token is saved in local cache. The token can be show the updated device status in the browser home
used to fetch different locations registered in the user’s screen for every new tab.
account. Upon a successful request, the response is received
in JSON format and parsed to save all location related x Device APIs Access: As HTML/JS code is bound to a
information. Fig. 3 illustrates the authentication process. particular device, so it can access the Device APIs
through the browser interface. So JavaScript can
To fetch all devices in any particular location, once the directly call exposed APIs of the Android framework.
user has entered their credentials, the process is explained
through the flowcharts in fig. 4. The authentication token will x History of commands previously given for a device.
be used to fetch different locations registered in the user’s This can be accessed just like browser history
account. Upon a successful request, the response will be x Single authentication for all connected devices
received in JSON format and will be parsed to save all through the web browser. In this way, the user would
location related information. have to enter their credentials just once, in order to
Once the location id is received, other requests will be access multiple connected devices.
used to fetch all the applications installed for a particular
location. This uses server side logic, where all the connected D. Brain controlled unified web interface
devices are controlled through a Smart Hub based on the An additional enhancement for our proposed web
request parameter. The user can fetch all devices and related interface can be in the form of a brain controlled interface
information using a location id and an authentication token. A (BCI). With the popularity of commercial brain controlled
JSON response will be received on a successful call and interfaces for a variety of functions today, and the advent of
parsed to display all the devices in HTML resources. cheap commercial grade dry BCI kits, one can visualize a
The user can also see all the details about a device in a future when the connected devices, such as home appliances,
detailed screen, when they tap on any particular device icon. are controlled through the brainwaves generated by the user,
or what can be termed as the “Brain of Things”.
(a) (b)
Fig. 5. (a) Illustration of the login screen (b) The main dashboard user
interface after a succesful login.
Fig. 6. Architecture of the brain controlled interface for the web browser
Authorized licensed use limited to: VIT University. Downloaded on October 24,2020 at 08:28:27 UTC from IEEE Xplore. Restrictions apply.
A popular kind of BCI is Electroencephalography (EEG). V. IMPLEMENTATION AND PROTOTYPING
A number of wearable EEG sensor kits are available today We have implemented the basic working prototype on the
developed by manufacturers such as NeuroSky, Emotiv, and Chromium based browser on the Samsung Galaxy S6 device.
MUSE [21-23]. Liu et al [24] have shown that the attention For our implementation, we used SmartThing’s Smart Hub
value can be extracted from the EEG sensors. The Neurosky and developer account for the simulation of a few virtual
EEG kit uses eSense meters to measure the attention level as a devices.
scale of 1 to 100. Our unified web interface can be further
enhanced by adding EEG based control, where the attention As shown in Fig. 7, the first time the uses accesses the
level of the user is used to navigate through the web menu. hub, the login screen is presented to the user for their
credentials. Once the credentials are provided and
A high level overview of the system is shown in Fig. 6. authenticated, the system displays the main dashboard with
The general steps for processing the EEG inputs by the the status of all connected devices. The user can view details
unified web interface are as follows: for any particular device by tapping on it, as shown in fig. 8.
The interface also allows the user to view their profile, along
x The EEG Sensor output is captured through a with an option to choose their location and an option to
wearable EEG kit, such as NeuroSky’s MindWave, logout.
and sent to the mobile device, which is paired using
Bluetooth.
x The output is then preprocessed on an application
running on the mobile computing device. Feature
detection is done on the EEG output in the mobile
device to identify the user’s mental state, which can
be used to perform actions as per the preset user
settings. In case of the NeuroSky EEG kit, the
attention and blink level of the user is detected using
given APIs.
x The User Interface component of the unified web
interface for IoT is then updated in response to the (a) (b)
received attention and blink level.
Fig. 7. (a) Illustration of the detailed screen for a device status (b)
An activity on the Android mobile device listens for inputs Illustration for a user profile with slide bar navigation panel.
from the EEG sensor. Once the EEG input is detected, it
classifies the input as belonging to one of the pre-determined As we have implemented this system on a Chromium
categories (attention, blink, relaxation, etc.) and finally based browser, it is very easy to port this implementation on
invokes the specific web interface function as required. Using any similar browser. As all the data is handled and displayed
the attention level, the user navigates to items in the device with HTML pages, there is a very minimal dependency on the
home screen and selects a particular item to see the contents. user interface as long as it is capable of displaying HTML
For visualization for items under navigation a user friendly pages.
interface is provided.
mappings {
In our implementation, we use deliberate blinks, also path("/switches") {
detected by the EEG sensor to open a currently selected item
in the web browser, and the attention level to navigate across action: [
a list of items. While navigating a list in the web browser, if GET: "listSwitches"
the attention level stayed over the threshold for 1 second, the ]
system navigates to the next item in the list. If the level
dropped below the threshold, the system would not navigate }
further but stay at the currently selected item. If the user
makes a deliberate double blink, the system opens the selected path("/switches/:id/:command") {
link in a new browser tab. action: [GET: "updateSwitch" ]
Having an EEG controlled interface for IoT can be utilized }
in a number of use cases and productivity enhancement }
features. For example, in case the user’s attention level is
above a threshold, the actions can include turning the phone to Fig. 8. Illustration of the mapping of the APIs with the switch device type
silent mode or block calls so as to not to disturb the user.
Other use cases include controlling the AC temperature if the To test the device status update for the virtual devices, we
relaxation level is high, playing a relaxing song when the user have written a small wrapper on the server side. We have used
is stressed, and so on. Groovy language [19] as required from SmartThing’s IDE
and implemented a groovy application to handle requests for a
different device type. Using the application id for this
Authorized licensed use limited to: VIT University. Downloaded on October 24,2020 at 08:28:27 UTC from IEEE Xplore. Restrictions apply.
interface, the browser can fetch or update the state of the any triangulation and measuring the Bluetooth signal strength to
particular device. This interface will have mapping of the API calculate the approximate distance of connected devices from
with the corresponding device type, as shown in fig. 8. On the the mobile device. This can further be used to implement a
client side, the web browser can consume this API with help drag and drop interface for moveable devices.
of utility functions, as shown in fig. 9.
function updatedevice(appid,access_token,type,id,command,value) { REFERENCES
var url = [1] Internet of Things: IEEE Standards Association [Online]. Available:
"https://graph.api.smartthings.com/api/smartapps/installations/" + standards.ieee.org/innovate/iot/stds.html
appid + "/" + "update" + type; [2] Saroj Kar. Intel, Samsung & Cisco Launches IoTivity Open Source
Standard for the Internet of Things. CloudTimes, Jan 21, 2015.
var request = { type: type, id: id, command: command, value: value}; [Online]. Available: cloudtimes.org/2015/01/21/intel-samsung-cisco-
if (access_token) request["access_token"] = access_token; launches-iotivity-open-source-standard-for-the-internet-of-things
[3] Internet of Things Council. [Online]. Available: theinternetofthings.eu
$.get(url, request).done(function( data ) {
[4] WebIOPI Internet of Things Framework. [Online]. Available:
if (data.status == "ok") { code.google.com/p/webiopi/
console.log("request success:"); [5] HomeKit: Apple Developer [Online]. Available:
developer.apple.com/homekit/
} [6] S. Mayer, A. Tschofen, A. K. Dey, F. Mattern. User interfaces for
}).fail(function() { smart things: A generative approach with semantic interaction
descriptions. In ACM Transactions on Computer-Human Interaction
alert( "updatedevice Failed:"); (TOCHI) Volume 21 Issue 2, February 2014
}); [7] Jodyalbritton. ThingLayer: An open source real-time web interface for
IoT. Mar 6, 2015. [Online]. Available:
} community.smartthings.com/t/thinglayer-an-open-source-real-time-
web-interface-for-iot/12295
Fig. 9. Illustration of the client side function to conssume the API to update [8] D. Guinard. Towards the web of things: Web mashups for embedded
the device status devices. WWW (International World Wide Web Conferences),
Enterprise Mashups and Lightweight Composition on the Web (MEM
2009) Workshop, 2009.
VI. LIMITATIONS OF THE SOLUTION [9] D. Guinard, V. M. Trifa, E. Wilde. Architecting a mashable open world
wide web of things. ETH, Department of Computer Science, 2010
Since there is currently no standardized format defined for
the data and communication between the cloud providers and [10] Kary Framling, Sylvain Kubler, Andrea Buda. Universal Messaging
Standards for the IoT from a Lifecycle Management Perspective. IEEE
the client device, so our solution is specific to the Internet of Things, Vol. 1, Issue 4, 2014. pp. 319-327
implementation platform and cannot be generalized per se. [11] Google Cloud Platform [Online]. Available:
However, it is easy to port our web browser based solution to cloud.google.com/solutions/iot/
multiple ecosystems with relatively less code rework. Also, [12] The Physical Web [Online]. Available: google.github.io/physical-web/
some device APIs for controlling IoT devices through the [13] Project Brillo [Online]. Available: developers.google.com/brillo
browser might not be currently available. Moreover, [14] Android Webview interface [Online]. Available:
controlling IoT devices through the web browser may cause developer.android.com/reference/android/webkit/WebView.html
some performance degradation when compared to native [15] Chromium Browser. [Online]. Available: chromium.org
apps. [16] OAuth [Online]. Available: oauth.net/
[17] Android Developers. Javascript Interface. [Online]. Available:
VII. CONCLUSION AND FUTURE WORK developer.android.com/reference/android/webkit/JavascriptInterface.ht
ml
In this paper we have presented the design of a web [18] SmarThing SDK Documentation [Online]. Available:
browser to control connected devices in an Internet of Things http://docs.smartthings.com/en/latest/cloud-and-lan-connected-device-
(IoT) environment. Integrating the control of devices within types-developers-guide/index.html
the browser, rather than having a separate web application for [19] The Groovy programming language [Online]. Available: groovy-
the same, provides a number of benefits for the user and lang.org
allows them to go beyond certain limitations. For example, [20] Github. OpenIoT project.[Online]. Available:
the user can use the single sign in process from saved github.com/OpenIotOrg/openiot
credentials in the browser or can use offline feature etc. [21] NeuroSky store: Mindwave. store.neurosky.com/products/mindwave-1
[22] Emotiv EPOC headset. emotiv.com/epoc.php
In future, we aim to create a framework to provide easy [23] MUSE: The Brain Sensing Headband. choosemuse.com
setup with the help of generic interfaces. We will explore [24] Liu, N.-H., Chiang, C.-Y., Chu, H.-C. Recognizing the Degree of
using data locally available in the mobile device such as Human Attention Using EEG Signals from Mobile Sensors. Sensors
sensor data, contacts data using native device APIs and use (Basel, Switzerland), 13(8), 10273–10286.
extracted information from this data such as information [25] Arno Puder, Nikolai Tillmann, and Michał Moskal. Exposing native
about the user’s schedule, to control the connected devices. device APIs to web apps. In Proceedings of the 1st International
Conference on Mobile Software Engineering and Systems
We also plan to use a location engine that allows the user to (MOBILESoft 2014). ACM, New York, NY, USA, 18-26. 2014.
see the approximate location of connected devices, via
Authorized licensed use limited to: VIT University. Downloaded on October 24,2020 at 08:28:27 UTC from IEEE Xplore. Restrictions apply.