<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Integrating the Node-RED server in an IoT platform for ECA rules management</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Giuseppe Desolda</string-name>
          <email>giuseppe.desolda@uniba.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Francesco Greco</string-name>
          <email>f.greco66@studenti.uniba.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>ECA rules.</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Internet of Things, End-User Development</institution>
          ,
          <addr-line>Tailoring Environments</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Bari</institution>
          ,
          <addr-line>Via Orabona 4, 70125 Bari</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>EFESTO-5W is a Web platform that implements a visual paradigm for allowing non-technical users to define the behavior of smart objects. This paper presents the integration of the NodeRED server in EFESTO-5W to make more robust, efficient, and reliable the management of EMPATHY: Empowering People in Dealing with Internet of Things Ecosystems. Workshop co-located with AVI 2020, Island of Ischia, Italy</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>The Internet of Things (IoT) has emerged in the last 10 years as a new paradigm in modern wireless
telecommunications. The basic idea is the pervasive presence of a variety of devices, the so-called smart
objects, which can be worn, installed at home, guided, etc., and that can interact with people and each
other. However, research in the field of IoT has focused mainly on technical aspects, for example, how
to program networks of sensors and actuators and how to ensure their interoperability.</p>
      <p>
        Despite the evident advantages of IoT, there are still some issues to be resolved to increase its impact
and bring out its full potential. Although smart objects cover many user needs, people often feel the
need to use them in a personalized way or to synchronize their behavior to solve situational needs.
However, this activity today is performed by programming the smart object's behavior, thus requiring
programming skills that non-technical people, which are the majority of IoT users, do not have. To
enable all IoT users to use smart objects more flexibly and effectively, there is a need for technological
and methodological solutions that support also non-technical users in defining the behavior of smart
objects. To meet these needs today there are already some websites or mobile app (e.g. IFTTT [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]) that,
offering visual mechanisms, support the definition of synchronizations between smart objects (e.g., if a
volumetric sensor detects a human in the room then the lamp is turned on). However, these tools only
support simple customizations and they are not very useful in real scenarios and everyday situations.
      </p>
      <p>In order to directly involve non-technical users in a meaningful configuration of their smart objects,
it is necessary to devise new approaches, based on high-level abstractions and appropriate interaction
paradigms. In the last years, EFESTO-5W has been proposed as a web platform that supports
nontechnical users in synchronizing the smart object's behavior by visually defining
Event-ConditionAction (ECA) rules (see for example Figure 1) [2; 3]. Despite EFESTO-5W has been developed as a
professional prototype, some technical aspects go beyond the platform itself and deserve a strong effort
during the platform life. In particular, since EFESTO-5W requires the registration of smart objects and
web services, one of the most important challenges is the heterogeneity of the technologies and related
network protocols (e.g., HTTP, MQTT, web socket, QoS, CoAP), security access mechanisms (OAuth,
OAuth 2.0), and data format/syntax. In the previous version of EFESTO-5W, this challenge has been
solved by implementing different modules that manage each aspect. However, during the time the smart
objects manufacturers update and improve their protocols, security access mechanisms, add or remove</p>
      <p>2020 Copyright for this paper by its authors.
some functionalities, change the data format or syntax, thus requiring a continuous refactoring of the
smart objects catalog and of the platform modules and components.</p>
      <p>In this paper a new version of EFESTO-5W is proposed: it overcomes the aspects underlined above
delegating all the related issues to a third-party application that controls the smart objects and governs
the ECA rules behaviors. Different technological solutions have been evaluated, for example
NodeRED, crosser, n8n.io, ioBroker, AWS IoT, Zenaton, SiteWhere.io considering different requirements:
open-source project, reliable and fast application, installable on a web server, availability of a wide
catalog of web services and smart objects, management of workflows that can be shaped as
EFESTO5W ECA rules, availability of APIs to export/import services and ECA rules to EFESTO-5W.
Considering all these constraints, Node-RED has been selected as the best candidate. In the next section,
the most important details of this integration are reported.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Empowering EFESTO-5W with the Node-RED server</title>
      <p>
        Node-RED is an open-source programming tool for wiring together hardware devices, APIs and
online services by using a visual paradigm [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Its wide community daily adds, updates and improves a
catalog of thousands of smart objects and web services. The Node-RED platform is written in NodeJS
and it is mainly composed of 1) a web-based user interface that supports the visual creation of the flows
and 2) a web server that manages the user-defined flows. However, it has been demonstrated that the
graph metaphor proposed by Node-RED UI is not suitable for non-technical users [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. In addition, the
visual creation of flows often requires technical aspects and script coding that can be managed only by
programmers.
      </p>
      <p>In order to combine the powerful visual metaphor of EFESTO-5W with the robust, efficient, and
reliable features of the Node-RED server, we recently integrated the two systems. In this way, both the
smart objects' life cycle and ECA rule execution management are delegated to the Node-RED server
still maintaining the easy composition paradigm proposed in EFESTO-5W.</p>
      <p>The integration of the two systems has required the development of new modules in EFESTO-5W.
First, since smart objects and web services are codified in Node-RED as JSON strings, the
EFESTO5W smart objects catalog is based on these JSON descriptors. As shown in the system architecture
reported in Figure 2, in the Service Layer there is a Service Descriptor repository that now stores all
the web services and smart objects descriptors codified by using the Node-RED syntax. Second, the
Rule Generator in the Interaction Layer has been modified so that every time an ECA rule is visually
defined by a user it is translated into a JSON string representing the ECA rule according to the
NodeRED workflow syntax. In addition, since some web services and smart objects included in the rule can
use authentication credentials, such data are not immediately included in the JSON file since they would
be exposed to attacks like man-in-the-middle. When this JSON file is sent to the Logic Layer installed
on a Web server, in particular to the Rule Manager component, it is completed with all the missing
authentication data safely stored in the server database. When completed, this file is sent to the
NodeRED server that immediately executes it. From that moment on, Node-RED is in charge of the rule
management, with all the related aspects like the event listening, communication protocols,
authentications mechanisms, etc.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Conclusion and Future Work</title>
      <p>
        This paper has presented the new version of the EFESTO-5W platform, which aims to become more
reliable, effective, stable, and efficient, and to reduce the maintenance effort thanks to the integration
of the Node-RED server. This new version of EFESTO-5W will be used in real contexts, in particular
in the EMPATHY PRIN project, which aims to investigate if and how domain experts, even without
skills in IT, are able to define smart environments by using tools like EFESTO-5W. Different domains
will be considered in this project, for example cultural heritage involving professional guides that will
define smart museums, or Ambient Assisted Living involving caregivers that will design smart homes,
for example orchestrating the behavior of conversational agents and other smart objects that help
patients with Parkinson's disease [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>
        As future work, new interaction paradigms for ECA rule definitions will be investigated, for
example exploiting tangible programming and/or cross-device interaction mechanisms [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. In addition,
since this tool will be used by end users in real contexts, to improve its internal qualities we are adopting
the GQM-based approach presented in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>This workshop could be an ideal venue to present the new advances of EFESTO-5W and to discuss
with other researchers pro and cons of the proposed approach.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Acknowledgements</title>
      <p>This work is partially supported by the Italian Ministry of University and Research (MIUR) under
grant PRIN 2017 “EMPATHY: EMpowering People in deAling with internet of THings ecosYstems”.</p>
    </sec>
    <sec id="sec-5">
      <title>5. References</title>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Ardimento</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Baldassarre</surname>
            ,
            <given-names>M.T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Caivano</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Visaggio</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          (
          <year>2004</year>
          ).
          <article-title>Multiview Framework for Goal Oriented Measurement Plan Design</article-title>
          .
          <source>In Proc. of the International Conference on Product Focused Software Process Improvement (PROFES '04)</source>
          . Springer Berlin Heidelberg,
          <fpage>159</fpage>
          -
          <lpage>173</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Ardito</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Desolda</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lanzilotti</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Malizia</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Matera</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          (
          <year>2019</year>
          ).
          <article-title>Analysing Trade-offs in Frameworks for the Design of Smart Environments</article-title>
          .
          <source>Behaviour &amp; Information Technology</source>
          ,
          <volume>39</volume>
          (
          <issue>1</issue>
          ),
          <fpage>47</fpage>
          -
          <lpage>71</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Balducci</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Buono</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Desolda</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Impedovo</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Piccinno</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          (
          <year>2020</year>
          ).
          <article-title>Improving smart interactive experiences in cultural heritage through pattern recognition techniques</article-title>
          .
          <source>Pattern Recognition Letters</source>
          ,
          <volume>131</volume>
          ,
          <fpage>142</fpage>
          -
          <lpage>149</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Desolda</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ardito</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jetter</surname>
          </string-name>
          , H.-C. and
          <string-name>
            <surname>Lanzilotti</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          (
          <year>2019</year>
          ).
          <article-title>Exploring spatially-aware crossdevice interaction techniques for mobile collaborative sensemaking</article-title>
          .
          <source>International Journal of Human-Computer Studies</source>
          , Volume
          <volume>122</volume>
          (
          <year>February 2019</year>
          ),
          <fpage>1</fpage>
          -
          <lpage>20</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Dimauro</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nicola</surname>
            ,
            <given-names>V.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bevilacqua</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Caivano</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Girardi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          (
          <year>2017</year>
          ).
          <article-title>Assessment of Speech Intelligibility in Parkinson's Disease Using a Speech-To-Text System</article-title>
          .
          <source>IEEE Access</source>
          ,
          <volume>5</volume>
          ,
          <fpage>22199</fpage>
          -
          <lpage>22208</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>IFTTT</given-names>
            <surname>Inc. IFTTT</surname>
          </string-name>
          . Retrieved from https://ifttt.com/ Last Access June 10,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>JS</given-names>
            <surname>Foundation.</surname>
          </string-name>
          Node-RED. Retrieved from http://nodered.org/ Last Access February 28th,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Namoun</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nestler</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          and
          <string-name>
            <surname>De Angeli</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          (
          <year>2010</year>
          ).
          <article-title>Conceptual and Usability Issues in the Composable Web of Software Services</article-title>
          . In:
          <string-name>
            <given-names>F.</given-names>
            <surname>Daniel</surname>
          </string-name>
          and
          <string-name>
            <given-names>F.</given-names>
            <surname>Facca</surname>
          </string-name>
          (Eds.) Current Trends in Web Engineering - ICWE
          <source>2010 Lecture Notes in Computer Science</source>
          , Vol.
          <volume>6385</volume>
          , Springer Berlin Heidelberg,
          <fpage>396</fpage>
          -
          <lpage>407</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>