Upload
dario-bonino
View
6.950
Download
3
Tags:
Embed Size (px)
DESCRIPTION
A short introduction to the Dog Gateway and its internal modules / logic
Citation preview
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
What? COMFORT
LIGHTING
SECURITY
HEATING AND
AIR CONDITIONING
NETWORKS ENTERTAINMENT
REMOTE
DEVICES
10/24/2013 The Domotic OSGi Gateway - Dario Bonino
How? HOW TO GET IT?
PLANTS / ARCHITECTURES / CONTROL / INTELLIGENCE
NETWORKS DEVICES
INTELLIGENCE
10/24/2013 The Domotic OSGi Gateway - Dario Bonino
However WIRELESS
WIRED
WIRED
MOST DIFFUSED NETWORKS
10/24/2013 The Domotic OSGi Gateway - Dario Bonino
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
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
Natural Modeling Technology indepedent Home Modeling
Representing devices, appliances, furniture and home environments
in a technology independent, yet actionable manner.
Natural Modeling
10/24/2013 The Domotic OSGi Gateway - Dario Bonino
LAMP On Off
Natural Modeling
10/24/2013 The Domotic OSGi Gateway - Dario Bonino
Meter + Plug On Off
Power Energy
*10*1*1#
Natural Modeling
10/24/2013 The Domotic OSGi Gateway - Dario Bonino
*10*0*1#
Off On
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)
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)
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
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
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
Over 150 Controllables...
10/24/2013 The Domotic OSGi Gateway - Dario Bonino
Dog Domotic OSGi Gateway
Architecture, technology and APIs
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
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
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
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
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
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
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
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
"
}
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"
}
]
}
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)
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
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
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
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
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
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
Questions? More details available on-line:
http:domoticdog.sourceforge.net