Skip to content

3rd Party Application Developers Manual

Elia Traore edited this page Jul 3, 2017 · 24 revisions

Welcome application developer!
This page contains a guide to writing a Smarthouse application.

Table of Contents


The Developer API

The API allows you to:

  • Easily create GUI for the application, that can be loaded directly into the house
  • Communicate with a sensor connected to the system:
    • Receive the information the sensor observed in the environment
      (e.g. be notified by a stove sensor on the current temperature of the stove)
    • Instruct the sensor
      (e.g. tell the stove sensor to turn the stove off)

Installing the API

  1. Download System-1.01-jar-with-dependencies.jar from our latest release, and add it as a dependency to your java project.

  2. You can add a jar in Eclipse by right-clicking on the Project → Build Path → Configure Build Path. Under Libraries tab, click Add Jars or Add External JARs and give the Jar.

If you had difficulties with the process, you can watch this video guide.

Using the API

A standard Smarthouse application developement is comprised of 4 main components:

Inheriting from class SmarthouseApplication

Your application must have a class inheriting from class SmarthouseApplication in order to allow the Smarthouse to load it.
Read here to learn which methods are available in the class and how are you expected to implement any abstract methods there.

Communicating with Services

Services provide various functionalities - alerts sending, sensor managing (receiving information, sending instructions) and more. Read here to learn about the services available at the moment along with usage examples.

Designing the GUI with class AppBuilder

You can easily generate GUI with through our javafx abstraction class, AppBuilder. Read here to learn how to add various GUI elements to your application and update the contents of those elements.

Testing your application

You can set up the system and use real sensors to verify the correctness of you application, but it might be time consuming and hard to control. Moreover, if you're an independent application developer you might even not have a physical sensor available.

Because of those reasons, we've created the Sensors Simulator - an API abstracting sensors simulation.
Simulated sensors can:

  • Be configured to send messages identical to those the real sensors will send
  • Execute intricate scenarios (e.g. temperature sensors reporting temperature changes compatible with a specific country)
  • Run from a separate computer (in the same sub-net as the running Smarthouse instance)

The Sensors Simulator

You can learn about configuring and running the simulator in the following pages:

  • Sensors Simulator - configuring simulator through code, and run your application in developer mode with it.
  • Sensors Simulator GUI - general manual on what the GUI offers, and how to use it to configure sensors on-the-fly.

Deploying Your Application

In order to run your application on a smarthouse, you must produce a .jar file that contains a class that extends the class SmarthouseApplication.
Such jar file can be added to our AppStore[1] and be available to any Smarthouse owner.

[1] Not being developed at the moment, but part of the wider design for the Smarthouse

Clone this wiki locally