-
Notifications
You must be signed in to change notification settings - Fork 21
/
features-architecture.html
executable file
·282 lines (273 loc) · 19.3 KB
/
features-architecture.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en">
<!--<![endif]-->
<head>
<!-- Basic Page Needs
================================================== -->
<meta charset="utf-8">
<title>openHAB - empowering the smart home</title>
<meta name="description" content="OHMY! HTML5 responsive Website template based on Twitter Bootstrap framework. Easy to customize.">
<meta name="author" content="Little NEKO">
<!-- Mobile Specific Metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- CSS
================================================== -->
<!-- Bootstrap -->
<link type="text/css" rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<!-- web font -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,800" rel="stylesheet" type="text/css">
<!-- plugin css -->
<link rel="stylesheet" type="text/css" href="js-plugin/pretty-photo/css/prettyPhoto.css" />
<link rel="stylesheet" type="text/css" href="js-plugin/rs-plugin/css/settings.css" media="screen" />
<link type="text/css" rel="stylesheet" href="js-plugin/hoverdir/css/style.css">
<!-- icon fonts -->
<link type="text/css" rel="stylesheet" href="font-icons/custom-icons/css/custom-icons.css">
<link type="text/css" rel="stylesheet" href="font-icons/custom-icons/css/custom-icons-ie7.css">
<!-- Custom css -->
<link type="text/css" rel="stylesheet" href="css/layout.css">
<link type="text/css" id="colors" rel="stylesheet" href="css/colors.css">
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<!--[if gte IE 9]><style type="text/css">.iconBig, .active, .hover a , .Shover a { filter: none !important; } </style> <![endif]-->
<script src="js/modernizr-2.6.1.min.js"></script>
<!-- Favicons
================================================== -->
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="apple-touch-icon" href="apple-icon.png" />
<style type="text/css">
.inversedlink {
color:#FFFFFF;
}
.inversedlink:hover {
color:#FFFFFF;
}
.inversedlink:visited {
color:#FFFFFF;
}
.inversedlink:active {
color:#FFFFFF;
}
</style>
</head>
<body>
<!-- Primary Page Layout
================================================== -->
<!-- header -->
<header id="mainHeader" class="clearfix">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container"> <a href="index.html" class="brand"><img src="images/openhab-logo-top.png" alt="openHAB"/></a>
<nav id="mainMenu" class="clearfix">
<ul>
<li><a href="index.html" class="firstLevel" >Home</a>
</li>
<li><a href="features.html" class="firstLevel active">Features</a>
</li>
<li><a href="downloads.html" class="firstLevel">Downloads</a>
</li>
<li><a href="community.html" class="firstLevel">Community</a></li>
<li><a href="https://github.com/openhab/openhab" class="firstLevel">Github</a></li>
<li><a href="https://github.com/openhab/openhab/wiki" class="firstLevel">Wiki</a></li>
<li><a href="https://my.openhab.org/" class="firstLevel">my.openHAB</a></li>
</ul>
</nav>
</div>
</div>
</div>
</header>
<!-- header -->
<!-- global wrapper -->
<div id="globalWrapper">
<!-- page content -->
<section id="content" class="fullWidth">
<header class="headerPage">
<div class="container clearfix">
<div class="row">
<h1 class="span8">Architecture</h1>
<div class="span4" id="navTrail"> <a href="index.html" class="homeLink">home</a><span>/</span><a href="features.html">features</a><span>/</span><a href="features-architecture.html">architecture</a> </div>
</div>
</div>
</header>
</section>
<section id="content" class="features" >
<div class="slice clearfix">
<div class="container">
<div class="row ">
<aside class="span2" id="sidebar">
<nav id="subnav">
<ul>
<li> <a href="features.html"> Introduction </a> </li>
<li> <a href="features-architecture.html" class="active"> Architecture </a> </li>
<li> <a href="features-tech.html"> Supported Technologies </a> </li>
<li> <a href="features-ui.html"> User Interfaces </a> </li>
<li> <a href="features-rules.html"> Rules And Scripts </a> </li>
<li> <a href="features-persistense.html"> Persistence And Charts </a> </li>
<li> <a href="features-platforms.html"> Supported Platforms </a> </li>
</ul>
</nav>
</aside>
<div class="span10">
<section id="FIntroduction" class="row-fluid">
<h2>Overview</h2>
<div class="divider"><span></span></div>
<p>
If you are completely new to openHAB and you prefer listening over reading, you can start with our presentation at Devoxx in 2012, which is available on Parleys:
</p>
<div class="imgWrapper"><a href="http://parleys.com/play/5148922b0364bc17fc56c8c3/chapter10/agenda"><img src="https://raw.github.com/wiki/openhab/openhab/images/parleys.jpg" alt="project title"></a> </div>
<p>
The openHAB project is split into two parts: openhab runtime , which you will actually run on your server and which does the "real" work and
openhab designer which is more or less a configuration tool for the openhab runtime. It comes with user-friendly editors to configure your runtime, to define your UIs and to implement your rules.
</p>
<h2>openHAB Runtime</h2>
<div class="divider"><span></span></div>
<p>
The openHAB runtime is a set of OSGi bundles deployed on an OSGi framework (Equinox). It is therefore a pure Java solution and needs a JVM to run. Being based on OSGi, it provides a highly modular architecture, which even allows adding and removing functionality during runtime without stopping the service. Here is an overview over the main bundles and how they depend on each other:
</p>
<div class="imgWrapper"><img src="https://github.com/openhab/openhab/wiki/images/architecture.png" alt="project title"></div>
<h3>Communication</h3>
<p>
openHAB has two different internal communication channels: an asynchronous event bus and a stateful repository, which can be queried.
</p>
<h3>The Event Bus</h3>
<p>
The event bus is THE base service of openHAB. All bundles that do not require stateful behaviour should use it to inform other bundles about events and to be updated by other bundles on external events.
There are mainly two types of events: xommands which trigger an action or a state change of some item/device and
status updates which inform about a status change of some item/device (often as a response to a command).
</p>
<p>
All protocol bindings (which provide the link to the real hardware devices) should be communicating via the Event Bus. This makes sure that there is a very low coupling between the bundles, which facilitates the dynamic nature of openHAB.
</p>
<p>
As a technical foundation, the OSGi EventAdmin service is used by openHAB. This is a light-weight and ready-to-use pub-sub implementation, which perfectly meets the requirements.
</p>
<p>
It is important to note that openHAB is not meant to reside on (or near) actual hardware devices and as thus to remotely communicate with many other distributed openHAB instances. Instead, openHAB rather serves as an integration hub between such devices and as a mediator between different protocols that are spoken between these devices. In a typical installation there will therefore be usually just one instance of openHAB running on some central server. Nonetheless, as the OSGi EventAdmin service can also be used as a remote service, it is possible to connect several distributed openHAB instances via the Event Bus.
</p>
<h3>Item Repository</h3>
<p>
Not all functionality can be covered purely by stateless services. Out of this reason openHAB also offers the Item Repository, which is connected to the Event Bus and keeps track of the current status of all items. The Item Repository can be used whenever it is necessary to be able to access the current state of items. E.g. a user interface needs to display the current state of items in the moment of the user access. Also the automation logic execution engine needs always needs to be informed about the current states. The Item Repository avoids each bundle to cache states themselves for there internal use. It also makes sure that the state is in sync for all those bundles and it provides the possibility to persist states to the file system or a database, so that they are even kept throughout a system restart.
</p>
<p>
The following diagram shows how these communication channels are used:
</p>
<div class="imgWrapper"><img src="images/architecture/events.png" alt="project title"></div>
<h3>Sitemap</h3>
<p>
openHAB comes with a generic textual configuration for its user interfaces: The so-called Sitemap. The sitemap is a tree structure of widgets, which define the different pages of a UI and their content. Widgets can be associated to items, for which they should show the status and/or control elements.
</p>
<p>
The definition of the Sitemap is quite abstract by design; it is supposed to be a suitable UI model for different kinds of user interfaces, so that the user does not have to configure each of them in case he sets up multiple UIs. If a UI has further requirements on top of the sitemap, it is still possible to introduce additional configuration options which are then specific for the UI in question.
</p>
<h3>Item UI Providers</h3>
<p>
Item UI providers offer a dynamic way to configure the UI, so that not everything must be stored statically in the Sitemap. An item UI provider can for example define, what widget should be used for an item, if none is specified and can dynamically define icons and labels (which might depend on the current state of the item) for the widgets.
</p>
<p>
An important use case for this feature is the dynamic display of item groups - all that there is stored in the Sitemap is the information that a certain group should be displayed; the page is then dynamically assembled at runtime with whatever items are available at that time.
</p>
<h2>
openHAB Designer
</h2>
<div class="divider"><span></span></div>
<p>
The openHAB Designer is an Eclipse RCP application for configuring the openHAB runtime. It comes with editors for configuration files like the sitemap. Its big advantage over simple text editors is the full IDE support like syntax checking, auto completion, highlighting and content assist. It is also meant to implement and deploy rules for automatic actions.
</p>
</section>
</div>
</section>
<!-- page content -->
<!-- footer -->
<footer class="footer1">
<div class="container" id="footer">
<div class="row">
<div class="span6 timelineWidget">
<h2>Latest tweets</h2>
<div class="divider"><span></span></div>
<div id="twitterFrame"> <a class="twitter-timeline" href="https://twitter.com/openHAB?height=250" data-widget-id="432945951875948545" data-tweet-limit="2" data-theme="dark" data-chrome="nofooter noheader transparent" >Tweets by @openHAB</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
</div>
<div class="span3 contactWidget">
<h2>Contact us</h2>
<div class="divider"><span></span></div>
<address>
<p><strong>openHAB UG (haftungsbeschränkt)</strong></p>
<p> <i class="icon-twitter"></i> <a href="http://twitter.com/openHAB">@openHAB</a></p>
<p> <i class="icon-mail-alt"></i> <a href="mailto:[email protected]">[email protected]</a></p>
</address>
</div>
<div class="span3 sociallWidget">
<h2>Follow us</h2>
<div class="divider"><span></span></div>
<ul class="socialNetwork nav">
<li><a href="https://www.facebook.com/pages/OpenHAB/153141161476518" class="icon-facebook socialIcon tips" title="follow us on Facebook"><span>facebook</span></a></li>
<li><a href="http://twitter.com/openHAB" class="icon-twitter-bird socialIcon tips" title="follow us on Twitter"><span>twitter</span></a></li>
<li><a href="https://plus.google.com/u/0/b/112853105449135193256/112853105449135193256/posts" class="icon-gplus socialIcon tips" title="follow us on Google +"><span>google +</span></a></li>
<li><a href="http://www.youtube.com/playlist?list=PLGlxCdrGUagz6lfgo9SlNLhdwI4la_VSv" class="icon-videocam socialIcon tips" title="follow us on Youtube"><span>youtube</span></a></li>
</ul>
<p></p>
<h2>Support openHAB</h2>
<div class="divider"><span></span></div>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="KB7LEKJLYWUQQ">
<input type="image" style="border:none; background:transparent" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
</div>
</div>
</footer>
<footer class="footer2" id="footerRights">
<div class="container">
<div class="row">
<div class="span12">
<p>Copyright © 2014 openHAB UG (haftungsbeschränkt) / All rights reserved | <a class="inversedlink" href="imprint.html"> → Imprint / Terms of use</a></p>
</div>
</div>
</div>
</footer>
<!-- footer -->
</div>
<!-- Global wrapper -->
<!-- End Document
================================================== -->
<script type="text/javascript" src="js-plugin/respond/respond.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="js-plugin/jquery-ui/jquery-ui-1.8.23.custom.min.js"></script>
<!-- third party plugins -->
<script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap-carousel.js"></script>
<script type="text/javascript" src="js-plugin/easing/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="js-plugin/pretty-photo/js/jquery.prettyPhoto.js"></script>
<script type="text/javascript" src="js-plugin/hoverdir/jquery.hoverdir.js"></script>
<!-- jQuery KenBurn Slider -->
<script type="text/javascript" src="js-plugin/rs-plugin/js/jquery.themepunch.plugins.min.js"></script>
<script type="text/javascript" src="js-plugin/rs-plugin/js/jquery.themepunch.revolution.min.js"></script>
<!-- Custom -->
<script type="text/javascript" src="js/custom.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', UA]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-47717934-1', 'openhab.org');
ga('send', 'pageview');
</script>
</body>
</html>