Software Architecture

Domotic Abstraction Layer (DAL)

DALayer

Unit Types

UnitClassDiagramm

Location Architecture

LocationClassStructure

LocationHierarchicalStructure

LocationGraphStructure

More Details

Software Components

GUI Overview

Core Framework

BCO DAL

Build Status Build Status

Maven Artifact

<dependency>
    <groupId>org.openbase.bco</groupId>
    <artifactId>dal.remote</artifactId>
    <version>[1.6,1.7-SNAPSHOT)</version>
</dependency>

Repository: https://github.com/openbase/bco.dal.git

BCO Registry

Build Status Build Status

Maven Artifact

<dependency>
    <groupId>org.openbase.bco</groupId>
    <artifactId>registry</artifactId>
    <version>[1.6,1.7-SNAPSHOT)</version>
</dependency>

Repository: https://github.com/openbase/bco.registry.git

BCO Manager

Build Status Build Status

Maven Artifact

<dependency>
    <groupId>org.openbase.bco</groupId>
    <artifactId>manager</artifactId>
    <version>[1.6,1.7-SNAPSHOT)</version>
</dependency>

Repository: https://github.com/openbase/bco.manager.git

Developer Tools

bco-registry-editor
bco-print-registry
bco-print-interface-rsb
bco-query
bco-scene-editor
bco-visual-remote

Simulation Mode

You can test and prove new components in a simulated environment.

bco --simulate

Benchmark Mode

You can test new components via the benchmark mode to prove how your components act during massive bco system load. During the benchmark, bco will start in simulation mode and high frequenly unit state changes are generated.

Note: Please never start the benchmark mode if you are connected to any physical devices to avoid hardware damage.

bco --benchmark

User Interfaces

Desktop (JavaFX)

bcozy

Android

bcomfy

Used Libaries

Libraries from openBase

Libraries from Citec (University of Bielefeld)

Development Installation Guide - Ubuntu / Debian

Reqirements

Environment Setup

Define where to install the bco distribution via the prefix variable.

echo 'export prefix="$HOME/local/bco"' >> ~/.bashrc

Add the bin folder to your global $PATH variable to support direct binary execution.

echo 'export PATH="$PATH:$prefix/bin"' >> ~/.bashrc

Reload your bash configuration

. ~/.bashrc

Make sure the $prefix folder exists.

mkdir -p $prefix

Make sure you have right permissions to $prefix

sudo chown -R $USER $prefix
chmod -R 750 $prefix

Setup Cor-Lab Debian Repository

This repository provides a collection of precompiled libs and tools for rsb. This includes transport layers like spread as well as dev-libs for using rsb in python or c++. To register the repository to your local debian package manager follow the instructions on http://packages.cor-lab.de/

Spread Installation

Spread is the recommended and most stable transport protocol for bco.

RSB Libs and Tools (Optional)

The rsb python and c++ libs can be installed via the cor-lab debian repository as well as the rsb developer tools:

sudo apt-get install librsc0.17 librsb0.17 rsb0.17 rst0.17 cl-rsb rsb-tools-cpp0.18 rsb-tools-cl0.18

RSB Configuration

Create the configuration file touch ~/.config/rsb.conf and add the following lines to deactivate the socket and enable the spread transport protocol.

[transport.socket]
enabled = 0
    
[transport.spread]
enabled = 1
host    = localhost

If your bco runtime is hosted on another mschine than your local one and there is already a spread daemon running, just refere to this host instead linking to your local host.

#host    = localhost
host    = 192.168.x.x

BCO Installation

Create a new developer directory if it not already exists (e.g. ~/workspace/openbase) and change into these directory.

mkdir -p ~/workspace/openbase
cd ~/workspace/openbase

Repository Download

Download the bco core repository into your development workspace:

cd ~/workspace/openbase
git clone -b latest-stable https://github.com/openbase/bco.git

This core repository provides all binaries and libaries. If you plan to extend or bugfix any BCO core components, you can download all submodules (exclusive for bco development) via the following command:

cd ~/workspace/openbase/bco
./workspace-prepare.sh

Installation

Now, you should be able to start the installation. During this, all bco core components are installed to the previously defined $prefix. To perform the installation (or update the components later on) execute the installation script provided by the bco folder.

./install.sh

Setup Registry DB

Download the example db.

mkdir -p ~/.config/bco/var/registry
cd ~/.config/bco/var/registry
git clone https://github.com/csra/bco.registry.csra-db db

How to start BCO

Provide a Spread Daemon

First of all we need at least one running spread daemon in your network to provide the communication between all distributed bco components. You can choose to start your own spread daemon or to connect to an already running instance.

Start BCO

You can start the bco runtime with the following command:

bco

Code Examples

This examples can be used as kick-off before jumping into the bco development. They pick up the basic functions like how to query, control and access any units.

Note: Please make sure spread and bco are started within your network before executing the howtos.

Java DAL Remote

For running any java examples you only need to include the dal remote dependency in your maven or gradle project description:

<dependency>
    <groupId>org.openbase.bco</groupId>
    <artifactId>dal.remote</artifactId>
    <version>[1.6,1.7-SNAPSHOT)</version>
</dependency>

How to activate a scene

Request the unit

    LOGGER.info("request the scene with the label \"WatchingTV\"");
    testScene = Units.getUnitByLabel("WatchingTV", true, Units.SCENE);

Control the unit

    LOGGER.info("activate the scene");
    testScene.setActivationState(ActivationState.State.ACTIVE);

How to control a colorable light

Request the unit

    LOGGER.info("request the light unit with the label \"TestUnit_0\"");
    testLight = Units.getUnitByLabel("TestUnit_0", true, Units.LIGHT_COLORABLE);

Control the unit

    LOGGER.info("switch the light on");
    testLight.setPowerState(PowerState.State.ON);
    
    LOGGER.info("switch light color to blue");
    testLight.setColor(Color.BLUE);

How to observe a location specific reed contact

How to observe service state changes

Java RSB

How to observe service state changes

Python RSB

How to request, control and observe units

Contribution