34
The Domotic OSGi Gateway A SHORT INTRODUCTION A brief overview on the Dog gateway, starting from the design principles and going deep into the gateway architecture and modules, with some application sample

The Dog Gateway - Intro

Embed Size (px)

DESCRIPTION

A short introduction to the Dog Gateway and its internal modules / logic

Citation preview

Page 1: The Dog Gateway - Intro

The Domotic OSGi

Gateway A SHORT INTRODUCTION

A brief overview on the Dog gateway, starting from the design

principles and going deep into the gateway architecture and

modules, with some application sample

Page 2: The Dog Gateway - Intro

What? COMFORT

LIGHTING

SECURITY

HEATING AND

AIR CONDITIONING

NETWORKS ENTERTAINMENT

REMOTE

DEVICES

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Page 3: The Dog Gateway - Intro

How? HOW TO GET IT?

PLANTS / ARCHITECTURES / CONTROL / INTELLIGENCE

NETWORKS DEVICES

INTELLIGENCE

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Page 4: The Dog Gateway - Intro

However WIRELESS

WIRED

WIRED

MOST DIFFUSED NETWORKS

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Page 5: The Dog Gateway - Intro

Whishlist

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

SINGLE POINT OF ACCESS

SINGLE LANGUAGE / PROTOCOL

FULLY INTEGRATED SYSTEM

FLEXIBILITY

EASY DEVELOPMENT

(EXTERNAL APPLICATIONS)

NETWORK-LEVEL

INDEPENDENCE

SUPPORT FOR MANY TECHNOLOGIES

Page 6: The Dog Gateway - Intro

Abstraction / Information hiding SEGREGATION OF THE “PARTS” THAT ARE MOST LIKELY TO CHANGE, THUS PROTECTING OTHER

COMPONENTS FROM EXTENSIVE MODIFICATION IF THE “PARTS” ARE CHANGED

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

NETWORK CHANGES IN TIME

APPLICATION PROGRAMMING

INTERFACE

CHANGES IN FEATURES

CHANGES IN PARADIGMS

SINGLE

SLOWLY EVOLVING

INFORMATION HIDING

Page 7: The Dog Gateway - Intro

Natural Modeling Technology indepedent Home Modeling

Representing devices, appliances, furniture and home environments

in a technology independent, yet actionable manner.

Page 8: The Dog Gateway - Intro

Natural Modeling

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

LAMP On Off

Page 9: The Dog Gateway - Intro

Natural Modeling

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Meter + Plug On Off

Power Energy

Page 10: The Dog Gateway - Intro

*10*1*1#

Natural Modeling

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

*10*0*1#

Off On

Page 11: The Dog Gateway - Intro

A Device is...

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

WHAT IT CAN DO UPON COMMAND (FUNCTIONALITIES)

WHAT IT CAN BE (STATES)

WHAT IT CAN DO AUTONOMOUSLY (NOTIFICATIONS)

Page 12: The Dog Gateway - Intro

DogOnt

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

SEMANTIC WEB technologies: OWL, Reasoning, SPARQL

ONTOLOGY Formal model for representing devices, rooms, furniture, etc.

TECHNOLOGY INDEPENDENT Hides network-specific information (segregated in a single modeling tree)

Page 13: The Dog Gateway - Intro

Core modeling

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Thing

Building

Environment

Building

Thing Functionality

State

Notification

Command StateValue

Notification

Functionality

Query

Functionality

Command

Functionality

UnControllable

Controllable

hasState

hasFunctionality

isIn

hasCommand

hasCommand

generateCommand*

hasNotification

Page 14: The Dog Gateway - Intro

Device Modeling

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Lamp

House

Plant Electric

System

Controllable

Building

Thing Building

Environment

Building Apartment

Room

isIn /

contains

OnOff

Functionality

Control

Functionality

Functionality

hasFunctionality

Discrete

State

OnOff

State

State hasState

Page 15: The Dog Gateway - Intro

Device Modeling - Instances

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Sample Room

Lamp

Switch

OnOffFunctionality

OnNotification

OffCommand

OnOffNotification

Functionality

OffNotification

OnOffState

OnOffState

hasState OnCommand

hasFunctionality

hasCommand hasCommand

isIn isIn

hasState

hasFunctionality

hasNotification

hasNotification Generates

Command

generates

Command

OnStateValue

OffStateValue

OffStateValue

OnStateValue

Page 16: The Dog Gateway - Intro

Over 150 Controllables...

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Page 17: The Dog Gateway - Intro

Dog Domotic OSGi Gateway

Architecture, technology and APIs

Page 18: The Dog Gateway - Intro

General Architecture

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

D D D D D D D A

GW GW

Application

Dog

IP-Network

Rest API

Wireless Protocol (e.g., ZigBee) Wired Protocol (e.g., KNX)

e.g., /devices/lamp1/commands/on

Page 19: The Dog Gateway - Intro

REST

• Representational State Transfer

– a stateless, client-server, cacheable communications protocol (over HTTP)

• HTTP requests to:

– post data (create and/or update),

– read data (e.g., make queries),

– and delete data.

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Page 20: The Dog Gateway - Intro

Dog RESTful API

• Quickly evolving / constantly updated

• Technology independent (based on DogOnt)

• Transfers XML / JSON data

• 3 main APIs

– Devices

– Environment

– Rules

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Page 21: The Dog Gateway - Intro

Device API

• Allows to manage connected devices:

– query the gateway about installed devices, their location, functionalities

and configurations;

– require execution of commands to existing devices;

– monitor device statuses and measures in real-time;

– add, modify or update the set of devices controlled through

the gateway;

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Page 22: The Dog Gateway - Intro

Device API - Query

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<dhc:dogHomeConfiguration>

<dhc:controllables>

<dhc:device domoticSystem="ELITE" id="oven1" class="ElectricalOven">

<dhc:description>A ElectricalOven instance named oven1</dhc:description>

<dhc:isIn>kitchen</dhc:isIn>

<dhc:pluggedIn>MainsPowerOutlet_p12_kitchen</dhc:pluggedIn>

<dhc:controlFunctionality class="OnOffFunctionality">

<dhc:commands>

<dhc:command name="on" class="OnCommand"/>

<dhc:command name="off" class="OffCommand"/>

</dhc:commands>

Resource: /devices

Page 23: The Dog Gateway - Intro

Device API – Execute Commands

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

PUT http://the.dog.address/devices

/lamp1/commands/on

Resource: /devices/{device-id}/commands/{command-name}

Off On

Page 24: The Dog Gateway - Intro

Device API – Status

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

?

GET http://the.dog.address/devices/lamp1/status

Resource: /devices/status

Resource: /devices/{device-id}/status

{

“id" : “lamp1",

"description" : " The lamp over the closet near to the livingroom armchair",

"active" : true,

"status":[

{

“OnOffstate" : "on"

}

]

}

On

Page 25: The Dog Gateway - Intro

Device API - Update

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

A lamp

The Lamp near to the armchair

PUT http://the.dog.address/devices/lamp1

{

"description" : "The Lamp

near to the armchair

"

}

Page 26: The Dog Gateway - Intro

Environment API

• Allows to manage information

about the environment:

– insert, update or delete rooms;

– insert, update or delete flats;

• E.g.,

– GET

http://www.mydog.com/environm

ent/flats/flat/rooms

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

{

"rooms":[

{

"id" : "kitchen",

"class" : "Kitchen",

"description" : "The best room in the house“

},

{

"id" : "sam_bedroom",

"class": "Bedroom“,

"description" : "Sam's bedroom"

}

]

}

Page 27: The Dog Gateway - Intro

Rules API (under refinement)

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

IF

WHEN

THEN

TRIGGER-EVENT

CONDITION (S)

ACTION(S)

OR-IF

WHEN

TRIGGER-EVENT

CONDITION (S)

Page 28: The Dog Gateway - Intro

Domotic OSGi Gateway

• Based on OSGi (formerly Open Services Gateway Initiative) which facilitates: – componentization of software modules and applications

– assures remote management and interoperability

– provides specifications, reference implementations (Eclipse Equinox, Apache Felix), test suites and certification

• Many interacting components organized in 4 layers: – Core

– Drivers

– Communication

– Addons

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Communication

Core Addons

Drivers

Page 29: The Dog Gateway - Intro

Architecture

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Communication

Core Addons

Drivers

Core functions: house

model, device model, unit of

measure support, device

management

Rest API

Rules,

Historic Storage

Support to different

technologies

Page 30: The Dog Gateway - Intro

Device Handling - Attachment

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Network Z-Wave

Dog

SimpleLamp(lamp1) Z-Wave nodeId: 1

Z-Wave Lamp Driver

Device Manager

Device Factory

Z-Wave Gateway Driver

Z-Wave Network Driver

Detection

Identification

Creation

Match & Attach

Page 31: The Dog Gateway - Intro

Device Handling – Attachment (2)

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Network

KNX

Dog

SimpleLamp(lamp1) KNX groupAddress: 1/1/1

KNX Lamp Driver

Device Manager

Device Factory

KNX Gateway Driver

KNX Network Driver Creation

Match & Attach

Configuration

Page 32: The Dog Gateway - Intro

Device Handling - Operation

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Network Z-Wave

Dog

Z-Wave Lamp Driver

Z-Wave Network Driver

Rest API

Executor

Application

SimpleLamp(lamp1) Z-Wave nodeId: 1

Page 33: The Dog Gateway - Intro

Device Handling - Operation

10/24/2013 The Domotic OSGi Gateway - Dario Bonino

Network KNX

Dog

KNX Lamp Driver

KNX Network Driver

Rest API

Executor

Application

SimpleLamp(lamp1) KNX groupAddress: 1/1/1

Page 34: The Dog Gateway - Intro

Questions? More details available on-line:

http:domoticdog.sourceforge.net