Secure links should be standard, where available. (#1354)
Signed-off-by: Jerome Luckenbach <github@luckenba.ch>pull/1355/head
|
@ -1,5 +1,5 @@
|
|||
; This file is for unifying the coding style for different editors and IDEs.
|
||||
; More information at http://EditorConfig.org
|
||||
; More information at https://EditorConfig.org
|
||||
|
||||
root = true
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ The sign-off is a simple line at the end of the explanation for the
|
|||
patch, which certifies that you wrote it or otherwise have the right to
|
||||
pass it on as an open-source patch. The rules are pretty simple: if you
|
||||
can certify the below (from
|
||||
[developercertificate.org](http://developercertificate.org/)):
|
||||
[developercertificate.org](https://developercertificate.org/)):
|
||||
|
||||
```
|
||||
Developer Certificate of Origin
|
||||
|
|
|
@ -177,7 +177,7 @@ then
|
|||
end
|
||||
```
|
||||
|
||||
For information on making use of the [openHAB Cloud service](https://github.com/openhab/openhab-cloud/blob/master/README.md) hosted by the [openHAB Foundation e.V.](https://www.openhabfoundation.org/), visit the [myopenhab.org website](http://www.myopenhab.org).
|
||||
For information on making use of the [openHAB Cloud service](https://github.com/openhab/openhab-cloud/blob/master/README.md) hosted by the [openHAB Foundation e.V.](https://www.openhabfoundation.org/), visit the [myopenhab.org website](https://www.myopenhab.org).
|
||||
|
||||
## Ephemeris
|
||||
|
||||
|
@ -275,8 +275,8 @@ The following is an example listing a few custom days.
|
|||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<tns:Configuration hierarchy="us" description="United States"
|
||||
xmlns:tns="http://www.example.org/Holiday" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.example.org/Holiday /Holiday.xsd">
|
||||
xmlns:tns="https://www.example.org/Holiday" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="https://www.example.org/Holiday /Holiday.xsd">
|
||||
<tns:Holidays>
|
||||
<tns:Fixed month="MARCH" day="20" descriptionPropertiesKey="Rich Birthday" />
|
||||
<tns:Fixed month="MARCH" day="27" descriptionPropertiesKey="Son's Birthday" />
|
||||
|
|
|
@ -23,7 +23,7 @@ Detailed instructions and requirements may be found in the corresponding documen
|
|||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Some openHAB 1 service modules have not yet completed validation for inclusion in the distribution; however, they may indeed work properly under openHAB 2.
|
||||
Some openHAB 1 service modules have not yet completed validation for inclusion in the distribution; however, they may indeed work properly under openHAB 2.
|
||||
All openHAB 1 addons can be downloaded in a <a href="https://bintray.com/openhab/mvn/download_file?file_path=org%2Fopenhab%2Fdistro%2Fopenhab%2F1.9.0%2Fopenhab-1.9.0-addons.zip">zip file</a>.
|
||||
We need your help testing them so that they may be easily installed in a future distribution.
|
||||
Please see the <a href="{{base}}/developers/development/compatibilitylayer.html#how-to-use-openhab-1x-add-ons-that-are-not-part-of-the-distribution">compatibility layer documentation</a> and
|
||||
|
@ -54,13 +54,13 @@ Detailed instructions and requirements may be found in the corresponding documen
|
|||
{% endfor %}
|
||||
<tr>
|
||||
<td>
|
||||
<h4><a href="http://www.myopenhab.org/" target="_blank"><img class="logo" src="{{base}}/images/addons/ifttt.png" title="IFTTT" alt="IFTTT" /></a></h4>
|
||||
<h4><a href="https://www.myopenhab.org/" target="_blank"><img class="logo" src="{{base}}/images/addons/ifttt.png" title="IFTTT" alt="IFTTT" /></a></h4>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Activating <a href="https://ifttt.com" target="_blank">IFTTT</a> integration is easy.
|
||||
Just log in to your IFTTT account and activate the openHAB channel.
|
||||
You will be forwarded to the <a href="http://www.myopenhab.org/" target="_blank">myopenHAB website</a> to authorize the IFTTT channel connection.
|
||||
You will be forwarded to the <a href="https://www.myopenhab.org/" target="_blank">myopenHAB website</a> to authorize the IFTTT channel connection.
|
||||
Before you start creating IFTTT recipes you need to make sure that you have your runtime configured to expose certain items to myopenHAB.
|
||||
Only those items will be visible to IFTTT.
|
||||
You will also be able to send commands to those items from IFTTT Applets.
|
||||
|
|
|
@ -42,7 +42,7 @@ To view and control your own devices, navigate to the Settings page, then disabl
|
|||
In the "Local URL" field enter the base URL to your openHAB webinterface, either using its IP address (e.g. `http://192.168.1.125:8080`) or hostname (e.g. `http://openhabianpi:8080`).
|
||||
|
||||
You can also connect to openHAB remotely, using either a direct connection or an openHAB Cloud instance like myopenHAB.
|
||||
Please see the [article on secure remote access](http://docs.openhab.org/installation/security.html) for more details.
|
||||
Please see the [article on secure remote access](https://docs.openhab.org/installation/security.html) for more details.
|
||||
Simply enter your "Remote URL" in the respective Settings field.
|
||||
The openHAB app will henceforth first try connecting to the local URL, then fall back to the remote URL.
|
||||
|
||||
|
|
|
@ -196,4 +196,4 @@ sudo sed -i -e "s/sshPort = .*/sshPort = 1234/g" /var/lib/openhab2/etc/org.apach
|
|||
|
||||
----
|
||||
|
||||
Please check the [Apache Karaf reference](http://karaf.apache.org/manual/latest/) for more details.
|
||||
Please check the [Apache Karaf reference](https://karaf.apache.org/manual/latest/) for more details.
|
||||
|
|
|
@ -7,7 +7,7 @@ title: Advanced Functionality and Administrative Tasks
|
|||
|
||||
# Advanced Functionality and Administrative Tasks
|
||||
|
||||
As a runtime environment openHAB uses [Apache Karaf](http://karaf.apache.org), a modern and polymorphic container for hosting Java applications.
|
||||
As a runtime environment openHAB uses [Apache Karaf](https://karaf.apache.org), a modern and polymorphic container for hosting Java applications.
|
||||
Karaf provides features such as a console CLI, remote access, hot deployment of modules, and dynamic configuration.
|
||||
The Karaf Console is a powerful tool for interacting with and controlling your openHAB installation.
|
||||
You will learn more about advanced administration of your openHAB installation, using the Karaf Console and other tools, in this section.
|
||||
|
|
|
@ -57,7 +57,7 @@ openhab> log:tail org.openhab.io.rest.core.item.ItemResource
|
|||
20:36:53.545 [DEBUG] [thome.io.rest.core.item.ItemResource] - Received HTTP POST request at 'items/Light_FF_Bath_Ceiling' with value 'OFF'.
|
||||
```
|
||||
|
||||
Please see the [Karaf documentation](http://karaf.apache.org/manual/latest/#_commands_2) for more examples and details.
|
||||
Please see the [Karaf documentation](https://karaf.apache.org/manual/latest/#_commands_2) for more examples and details.
|
||||
|
||||
## Config file
|
||||
|
||||
|
|
|
@ -40,4 +40,4 @@ udevadm info -a -p $(udevadm info -q path -n /dev/ttyACM0)
|
|||
|
||||
## macOS
|
||||
|
||||
When working with a Mac, it may be necessary to install a driver for the USB-RS232 converter (e.g. [Prolific PL2303](http://www.prolific.com.tw/us/showproduct.aspx?p_id=229&pcid=41) and create the `/var/lock` folder; see the [rxtx troubleshooting guide](http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#Mac_OS_X_users).
|
||||
When working with a Mac, it may be necessary to install a driver for the USB-RS232 converter (e.g. [Prolific PL2303](https://www.prolific.com.tw/us/showproduct.aspx?p_id=229&pcid=41) and create the `/var/lock` folder; see the [rxtx troubleshooting guide](https://rxtx.qbang.org/wiki/index.php/Trouble_shooting#Mac_OS_X_users).
|
||||
|
|
|
@ -126,7 +126,7 @@ Modifications to the dashboard are not saved automatically, use the **Save** but
|
|||
When a dashboard is running, widgets can be interacted with, and server-sent events are received when items' states are updated, so widgets update automatically in HABPanel.
|
||||
|
||||
The icons in the top-right corner perform the following:
|
||||
- the **speech balloon** activates the speech recognition feature and send the results as text to openHAB's default human language interpreter. This implies [some configuration on the server]({{base}}/configuration/multimedia.html#human-language-interpreter), and this icon might not be displayed if the browser doesn't support voice recognition ([mainly only in Chrome and other webkit variants currently](http://caniuse.com/#feat=speech-recognition){:target="_blank"}). It can also be configured in the panel configuration to appear on the bottom of the screen;
|
||||
- the **speech balloon** activates the speech recognition feature and send the results as text to openHAB's default human language interpreter. This implies [some configuration on the server]({{base}}/configuration/multimedia.html#human-language-interpreter), and this icon might not be displayed if the browser doesn't support voice recognition ([mainly only in Chrome and other webkit variants currently](https://caniuse.com/#feat=speech-recognition){:target="_blank"}). It can also be configured in the panel configuration to appear on the bottom of the screen;
|
||||
- the **refresh** button forces HABPanel to retrieve the current state of all items;
|
||||
- the **fullscreen** button tells the browser to go fullscreen, if supported.
|
||||
|
||||
|
@ -194,7 +194,7 @@ Multiple buttons are often used together to present different options for an ite
|
|||
|
||||
![Slider widget](images/habpanel_widget-slider.png)
|
||||
|
||||
The slider widget can reflect the state of, and update, numerical items within a range of values. Several options are available to alter its appearance and behavior.
|
||||
The slider widget can reflect the state of, and update, numerical items within a range of values. Several options are available to alter its appearance and behavior.
|
||||
|
||||
#### Knob (knob)
|
||||
|
||||
|
@ -264,7 +264,7 @@ The list of custom widgets either via the dashboard designer (click/tap the gear
|
|||
|
||||
From the list, custom widgets can be created from scratch, or imported from a previously exported .json file or a GitHub repository. Members of the openHAB community also present their custom widgets on the forum: the _Get widgets from the openHAB community_ link brings up a filtered lists of custom widgets from the community.
|
||||
|
||||
Widgets can also come from [an openHAB addon or OSGi bundle](https://community.openhab.org/t/new-feature-globally-provisioned-widgets-i-e-with-osgi-bundles/26994): those are "globally-provisioned widgets". They cannot be modified or deleted (but can be cloned and then modified), and are available to all panel configurations.
|
||||
Widgets can also come from [an openHAB addon or OSGi bundle](https://community.openhab.org/t/new-feature-globally-provisioned-widgets-i-e-with-osgi-bundles/26994): those are "globally-provisioned widgets". They cannot be modified or deleted (but can be cloned and then modified), and are available to all panel configurations.
|
||||
|
||||
The context menu **⁝** can be used to perform operations on the widget: globally-provisioned widgets can only be cloned, and manually defined or imported widgets can be exported or deleted. Widgets imported from GitHub can also be updated and include a link to repository's Readme file.
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ In order to represent all of these, openHAB defines the following base component
|
|||
- [Transformations](transform.html) - Helper functions to transform your data
|
||||
- [Persistence](persistence.html) - Services to store data over time
|
||||
- [Rules](rules-dsl.html) - Automation logic, the "smart" in your Smart Home!
|
||||
- [JSR223 Scripting](jsr223.html) - Define rules and other runtime objects using [Javascript](http://openjdk.java.net/projects/nashorn/), [Jython](http://www.jython.org) or [Groovy](http://www.groovy-lang.org/)
|
||||
- [JSR223 Scripting](jsr223.html) - Define rules and other runtime objects using [Javascript](https://openjdk.java.net/projects/nashorn/), [Jython](https://www.jython.org) or [Groovy](https://www.groovy-lang.org/)
|
||||
|
||||
The individual articles have all the details needed to understand the concepts behind these building blocks for your Smart Home.
|
||||
For more details on the basic concepts behind openHAB, please visit the [Concepts Overview page](/docs/concepts/index.html).
|
||||
|
@ -146,7 +146,7 @@ It would work to mix these, but you can easily forget which is your "source of t
|
|||
|
||||
Things/Items configured in files will become visible in Main UI if no Thing/Item of the same name is already present in the system database, but a lock will symbolize that you can NOT change them in the GUI. You can only change them by editing the source files.
|
||||
**Note:** Things/Items you create via Main UI will be stored in the system database, but those additions or changes will not be written back into any `.things / .items` file.
|
||||
Textual configuration is a one-way street.
|
||||
Textual configuration is a one-way street.
|
||||
Likewise, openHAB settings defined in `services/addons.cfg` and `services/runtime.cfg` will take precedence over any settings made via Main UI.
|
||||
|
||||
::: warning Important
|
||||
|
@ -168,4 +168,4 @@ Here are some hints to avoid some common pitfalls when starting out.
|
|||
You can use the import function to import `.items` files or snippets taken from other sources like the openHAB community forum.
|
||||
* Use VS code extensions to [edit rules, items and sitemap files](editors.html).
|
||||
You can also use any text editor or cloud based tool, but VS code extensions will work locally and help you by highlighting and cross-checking the file syntax.
|
||||
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ and are comfortable working with the command line prompt of the operating system
|
|||
[JSR223](https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/) ([spec](https://jcp.org/aboutJava/communityprocess/pr/jsr223/index.html)) is a standard scripting API for Java Virtual Machine (JVM) [languages](https://en.wikipedia.org/wiki/List_of_JVM_languages).
|
||||
The JVM languages provide varying levels of support for the JSR223 API and interoperability with the Java runtime.
|
||||
Currently the following languages are known to work well for openHAB scripting:
|
||||
[**Jython**](https://jython.github.io/) (Python on the JVM), and [**Apache Groovy**](http://www.groovy-lang.org/) (JVM scripting language).
|
||||
[**Jython**](https://jython.github.io/) (Python on the JVM), and [**Apache Groovy**](https://www.groovy-lang.org/) (JVM scripting language).
|
||||
(At the time of writing a **JavaScript** reimplementation is under development.)
|
||||
|
||||
Although JSR223 scripts can be used as a general-purpose extension language for openHAB, it is most commonly used for the creation of rules, and within scripted Actions or Conditions.
|
||||
|
|
|
@ -26,6 +26,6 @@ Note that you still need to define your items, sitemaps, persistence configurati
|
|||
|
||||
Here you can find a small screencast about the Paper UI:
|
||||
|
||||
[![Paper UI](https://img.youtube.com/vi/MV2a5qwtmRE/0.jpg)](http://www.youtube.com/watch?v=MV2a5qwtmRE)
|
||||
[![Paper UI](https://img.youtube.com/vi/MV2a5qwtmRE/0.jpg)](https://www.youtube.com/watch?v=MV2a5qwtmRE)
|
||||
|
||||
{% include contribution-wanted.html %}
|
||||
|
|
|
@ -22,7 +22,7 @@ On this page you will learn how to leverage its functionality to do *real* home
|
|||
### File Location
|
||||
|
||||
Rules are placed in the folder `$OPENHAB_CONF/rules`.
|
||||
The [demo setup](http://demo.openhab.org:8080/) already comes with a demo file called [`demo.rules`](https://github.com/openhab/openhab-distro/blob/master/features/distro-resources/src/main/resources/rules/demo.rules), which has a couple of examples that can be a good starting point.
|
||||
The [demo setup](https://demo.openhab.org) already comes with a demo file called [`demo.rules`](https://github.com/openhab/openhab-distro/blob/master/features/distro-resources/src/main/resources/rules/demo.rules), which has a couple of examples that can be a good starting point.
|
||||
|
||||
A rule file can contain multiple rules.
|
||||
All rules of a file share a common execution context, i.e. they can access and exchange variables with each other.
|
||||
|
@ -56,7 +56,7 @@ Check out the editors page for more information and additional editor possibilit
|
|||
### The Syntax
|
||||
|
||||
::: tip Note
|
||||
The rule syntax is based on [Xbase](http://www.eclipse.org/Xtext/#xbase) and as a result it is sharing many details with [Xtend](http://www.eclipse.org/xtend/), which is built on top of Xbase as well.
|
||||
The rule syntax is based on [Xbase](https://www.eclipse.org/Xtext/#xbase) and as a result it is sharing many details with [Xtend](https://www.eclipse.org/xtend/), which is built on top of Xbase as well.
|
||||
As a result, we will often point to the Xtend documentation for details.
|
||||
:::
|
||||
|
||||
|
@ -68,7 +68,7 @@ A rule file is a text file with the following structure:
|
|||
|
||||
The **Imports** section contains import statement just like in Java.
|
||||
As in Java, they make the imported types available without having to use the fully qualified name for them.
|
||||
For further details, please see the [Xtend documentation for imports](http://www.eclipse.org/xtend/documentation/202_xtend_classes_members.html#imports).
|
||||
For further details, please see the [Xtend documentation for imports](https://www.eclipse.org/xtend/documentation/202_xtend_classes_members.html#imports).
|
||||
|
||||
Example:
|
||||
|
||||
|
@ -88,7 +88,7 @@ org.openhab.model.script.actions
|
|||
|
||||
The **Variable Declarations** section can be used to declare variables that should be accessible to all rules in this file.
|
||||
You can declare variables with or without initial values and modifiable or read-only.
|
||||
For further details, please see the [Xtend documentation for variable declarations](http://www.eclipse.org/xtend/documentation/203_xtend_expressions.html#variable-declaration).
|
||||
For further details, please see the [Xtend documentation for variable declarations](https://www.eclipse.org/xtend/documentation/203_xtend_expressions.html#variable-declaration).
|
||||
|
||||
Example:
|
||||
|
||||
|
@ -192,7 +192,7 @@ A cron expression takes the form of six or optionally seven fields:
|
|||
6. Day-of-Week
|
||||
7. Year (optional field)
|
||||
|
||||
You may use [CronMaker](http://www.cronmaker.com/) or the generator at [FreeFormatter.com](http://www.freeformatter.com/cron-expression-generator-quartz.html) to generate cron expressions.
|
||||
You may use [CronMaker](https://www.cronmaker.com/) or the generator at [FreeFormatter.com](https://www.freeformatter.com/cron-expression-generator-quartz.html) to generate cron expressions.
|
||||
|
||||
{: #system-based-triggers}
|
||||
### System-based Triggers
|
||||
|
@ -281,7 +281,7 @@ end
|
|||
{: #scripts}
|
||||
## Scripts
|
||||
|
||||
The expression language used within scripts is the same that is used in the Xtend language - see the [documentation of expressions](http://www.eclipse.org/xtend/documentation/203_xtend_expressions.html) on the Xtend homepage.
|
||||
The expression language used within scripts is the same that is used in the Xtend language - see the [documentation of expressions](https://www.eclipse.org/xtend/documentation/203_xtend_expressions.html) on the Xtend homepage.
|
||||
|
||||
The syntax is very similar to Java, but has many nice features that allow writing concise code.
|
||||
It is especially powerful in handling collections.
|
||||
|
|
|
@ -74,7 +74,7 @@ To avoid very long or unstructured lines of element definition, parameters can b
|
|||
By encapsulating elements with curly brackets, multiple elements can be nested inside or behind others.
|
||||
The `Frame` element type is often used in combination with element blocks.
|
||||
Frames are used to visually distinguish multiple elements of the same topic on one interface page.
|
||||
When using code blocks behind other element types such as `Text` or `Group`, these UI elements will, in addition to their normal function, be links to a new view, presenting the nested elements.
|
||||
When using code blocks behind other element types such as `Text` or `Group`, these UI elements will, in addition to their normal function, be links to a new view, presenting the nested elements.
|
||||
In the above example, multiple Frames are defined and some elements are not visible on the main view but are accessible behind their parent element.
|
||||
These are indicated by the ">" control icon on the right of an element.
|
||||
|
||||
|
@ -362,7 +362,7 @@ Please be aware that Webview elements are not usable by all user interface optio
|
|||
**Example:**
|
||||
|
||||
```perl
|
||||
Webview url="http://www.openhab.org" height=5
|
||||
Webview url="https://www.openhab.org" height=5
|
||||
```
|
||||
|
||||
![Presentation of the Webview element in BasicUI](images/sitemap_demo_webview.png)
|
||||
|
@ -393,7 +393,7 @@ Image [item=<itemname>] [icon="<iconname>"] url="<url of image>" [label="<labeln
|
|||
|
||||
This element type is able to present an image.
|
||||
The image must be available on a reachable website or webserver without password or access token.
|
||||
Alternatively, the image file (e.g. YourImageFile.png) may be stored locally in the $OPENHAB_CONF/html folder, and will be accessible through the static route, http://<my.openHAB.device>:8080/static/YourImageFile.png.
|
||||
Alternatively, the image file (e.g. YourImageFile.png) may be stored locally in the $OPENHAB_CONF/html folder, and will be accessible through the static route, https://<my.openHAB.device>:8080/static/YourImageFile.png.
|
||||
|
||||
- `item` can refer to either an Image Item whose state is the raw data of the image, or a String Item whose state is an URL that points to an image. Some clients may not (yet) consider `item`.
|
||||
- `url` is the default URL from which to retrieve the image, if there is no associated Item or if the associated item's state is not a URL.
|
||||
|
@ -405,7 +405,7 @@ Alternatively, the image file (e.g. YourImageFile.png) may be stored locally in
|
|||
Image url="https://raw.githubusercontent.com/wiki/openhab/openhab/images/features.png"
|
||||
|
||||
// display a snapshot image from an IP camera, using refresh parameter to get updated images
|
||||
Image url="http://192.168.1.203:8080/?action=snapshot" refresh=10000
|
||||
Image url="https://192.168.1.203:8080/?action=snapshot" refresh=10000
|
||||
```
|
||||
|
||||
![Presentation of the Image element in BasicUI](images/sitemap_demo_image.png)
|
||||
|
@ -430,7 +430,7 @@ An embedded and/or protected video is not supported.
|
|||
**Example:**
|
||||
|
||||
```perl
|
||||
Video url="http://demo.openhab.org/Hue.m4v"
|
||||
Video url="https://demo.openhab.org/Hue.m4v"
|
||||
```
|
||||
|
||||
![Presentation of the Video element in BasicUI](images/sitemap_demo_video.png)
|
||||
|
@ -463,7 +463,7 @@ Visit [Charts](https://github.com/openhab/openhab/wiki/Charts) in the Wiki for e
|
|||
|
||||
**Other options to look out for:**
|
||||
The Chart element type is a good way to present time series data quickly.
|
||||
For more sophisticated diagrams, openHAB supports the integration of outside sources like most logging and graphing solutions (e.g. [Grafana](http://grafana.org)).
|
||||
For more sophisticated diagrams, openHAB supports the integration of outside sources like most logging and graphing solutions (e.g. [Grafana](https://grafana.org)).
|
||||
See this [Tutorial](https://community.openhab.org/t/13761/1) for more details.
|
||||
|
||||
**Technical constraints and details:**
|
||||
|
@ -743,10 +743,10 @@ sitemap demo label="My home automation" {
|
|||
Image url="https://raw.githubusercontent.com/wiki/openhab/openhab/images/features.png"
|
||||
}
|
||||
Frame {
|
||||
Video url="http://demo.openhab.org/Hue.m4v"
|
||||
Video url="https://demo.openhab.org/Hue.m4v"
|
||||
}
|
||||
Frame {
|
||||
Webview url="http://www.openhab.org" height=5
|
||||
Webview url="https://www.openhab.org" height=5
|
||||
}
|
||||
Frame {
|
||||
Text item=Temperature label="Livingroom [22.0 °C]" icon="temperature" labelcolor=[!=1="blue"] valuecolor=[!=1="green"]
|
||||
|
|
|
@ -22,7 +22,7 @@ For the declarative way, you add your binding information in form of a `binding.
|
|||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<binding:binding id="bindingID"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:binding="https://openhab.org/schemas/binding/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0
|
||||
https://openhab.org/schemas/binding-1.0.0.xsd">
|
||||
|
@ -69,7 +69,7 @@ The following code gives an example for a binding definition.
|
|||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<binding:binding id="bindingID"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:binding="https://openhab.org/schemas/binding/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0
|
||||
https://openhab.org/schemas/binding-1.0.0.xsd">
|
||||
|
|
|
@ -37,7 +37,7 @@ These must be inside the XML escape sequence - eg.
|
|||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<config-description:config-descriptions
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0
|
||||
https://openhab.org/schemas/config-description-1.0.0.xsd">
|
||||
|
@ -80,7 +80,7 @@ These must be inside the XML escape sequence - eg.
|
|||
<tr><td>parameter.name</td><td>The name of the configuration parameter (mandatory).</td></tr>
|
||||
<tr><td>parameter.type</td><td>The data type of the configuration parameter (mandatory).</td></tr>
|
||||
<tr><td>parameter.min</td><td>The minimal value for numeric types, or the minimal length of strings. Note that the value of any options may be outside of this value (optional).</td></tr>
|
||||
<tr><td>parameter.max</td><td>The maximum value for numeric types, or the maximum length of strings. Note that the value of any options may be outside of this value (optional).</td></tr>
|
||||
<tr><td>parameter.max</td><td>The maximum value for numeric types, or the maximum length of strings. Note that the value of any options may be outside of this value (optional).</td></tr>
|
||||
<tr><td>parameter.step</td><td>The value granularity for a numeric value (optional).</td></tr>
|
||||
<tr><td>parameter.pattern</td><td>The regular expression for a text type (optional).</td></tr>
|
||||
<tr><td>parameter.required</td><td>Specifies whether the value is required (optional).</td></tr>
|
||||
|
@ -100,8 +100,8 @@ These must be inside the XML escape sequence - eg.
|
|||
<tr><td>option.value</td><td>The value of the selection list element. Note that the value may be outside of the range specified in the min/max if this is specified.</td></tr>
|
||||
<tr><td>multipleLimit</td><td>If `multiple` is true, sets the maximum number of options that can be selected (optional).</td></tr>
|
||||
<tr><td>limitToOptions</td><td>If true (default) will only allow the user to select items in the options list. If false, will allow the user to enter other text (optional).</td></tr>
|
||||
<tr><td>criteria</td><td>The filter criteria for values of a dynamic selection list (optional).</td></tr>
|
||||
<tr><td>criteria.name</td><td>The name of the context related filter.</td></tr>
|
||||
<tr><td>criteria</td><td>The filter criteria for values of a dynamic selection list (optional).</td></tr>
|
||||
<tr><td>criteria.name</td><td>The name of the context related filter.</td></tr>
|
||||
</table>
|
||||
|
||||
### Supported Contexts
|
||||
|
@ -145,10 +145,10 @@ Further, the <strong>item</strong> context can contain criteria to filter the li
|
|||
```
|
||||
|
||||
In the case of above filter only those items will be shown that satisfy the filter's conditions.
|
||||
The above filter is evaluated as follows:
|
||||
The above filter is evaluated as follows:
|
||||
|
||||
```
|
||||
(type=Switch OR type=Dimmer) AND (tag=Light OR tag=Heating)
|
||||
(type=Switch OR type=Dimmer) AND (tag=Light OR tag=Heating)
|
||||
|
||||
```
|
||||
Similarly, the <strong>Channel</strong> context can contain criteria to filter channels based on <strong>kind</strong> field.
|
||||
|
@ -186,7 +186,7 @@ The following code gives an example for one configuration description.
|
|||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<config-description:config-description uri="thing-type:my-great-binding:my-bridge-name"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0
|
||||
https://openhab.org/schemas/config-description-1.0.0.xsd">
|
||||
|
|
|
@ -916,7 +916,7 @@ mDNS discovery is implemented in the framework as `MDNSDiscoveryService`.
|
|||
To facilitate the development, binding developers only need to implement a `MDNSDiscoveryParticipant`.
|
||||
Here the developer only needs to implement four simple methods:
|
||||
|
||||
- `getServiceType` - Defines the [mDNS service type](http://www.dns-sd.org/ServiceTypes.html).
|
||||
- `getServiceType` - Defines the [mDNS service type](https://www.dns-sd.org/ServiceTypes.html).
|
||||
- `getSupportedThingTypeUIDs` - Returns the list of thing type UIDs that this participant supports.
|
||||
The discovery service uses this method of all registered discovery participants to return the list of currently supported thing type UIDs.
|
||||
- `getThingUID` - Creates a thing UID out of the mDNS service info or returns `null` if this is not possible.
|
||||
|
|
|
@ -195,13 +195,13 @@ There exist system-wide trigger channel types that are available by default:
|
|||
| button | system.button | Can trigger `SHORT_PRESSED`, `DOUBLE_PRESSED` and `LONG_PRESSED` |
|
||||
| rawrocker | system.rawrocker | Can trigger `DIR1_PRESSED`, `DIR1_RELEASED`, `DIR2_PRESSED` and `DIR2_RELEASED` |
|
||||
|
||||
In the following sections the declaration and semantics of tags, state descriptions and channel categories will be explained in more detail.
|
||||
In the following sections the declaration and semantics of tags, state descriptions and channel categories will be explained in more detail.
|
||||
For a complete sample of the thing types XML file and a full list of possible configuration options please see the [XML Configuration Guide](config-xml.html).
|
||||
|
||||
### Default Tags
|
||||
|
||||
The XML definition of a ThingType allows to assign default tags to channels.
|
||||
All items bound to this channel will automatically be tagged with these default tags.
|
||||
The XML definition of a ThingType allows to assign default tags to channels.
|
||||
All items bound to this channel will automatically be tagged with these default tags.
|
||||
The following snippet shows a 'Lighting' tag definition:
|
||||
|
||||
```xml
|
||||
|
@ -241,7 +241,7 @@ The following XML snippet shows the definition for a temperature actuator channe
|
|||
For all sensors the `readonly` attribute should be set to `true`.
|
||||
* The `pattern` attribute can be used for `Number` and `String` items.
|
||||
It gives user interface a hint how to render the item.
|
||||
The format of the pattern must be compliant to the [Java Number Format](http://docs.oracle.com/javase/tutorial/java/data/numberformat.html).
|
||||
The format of the pattern must be compliant to the [Java Number Format](https://docs.oracle.com/javase/tutorial/java/data/numberformat.html).
|
||||
The pattern can be localized (see also [Internationalization](../../features/internationalization.html)).
|
||||
The special pattern placeholder `%unit%` is used for channels which bind to items of type `Number:<dimension>` which define a dimension for unit support.
|
||||
These channels will send state updates of type [QuantityType](../../concepts/units-of-measurement.html#quantitytype) and the unit is then rendered for the placeholder.
|
||||
|
@ -434,7 +434,7 @@ Inside the thing types XML file channel groups can be defined like this:
|
|||
<channel-group id="switchActor2" typeId="switchActor" />
|
||||
</channel-groups>
|
||||
<!-- ... -->
|
||||
</thing-type>
|
||||
</thing-type>
|
||||
```
|
||||
|
||||
The channel group type is defined on the same level as the thing types and channel types.
|
||||
|
@ -499,7 +499,7 @@ This could be a MAC address (e.g. Hue bridge, camera, all IP-based devices), a u
|
|||
This property is normally part of a discovery result for that specific thing type.
|
||||
Having this property identified per binding it could be used as the `representation property` for this thing.
|
||||
|
||||
The `representation property` shall be defined in the thing type XML:
|
||||
The `representation property` shall be defined in the thing type XML:
|
||||
|
||||
```xml
|
||||
<thing-type id="thingTypeId">
|
||||
|
@ -618,7 +618,7 @@ The full Java API for bridge and *Thing* descriptions can be found in the Java p
|
|||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<thing:thing-descriptions bindingId="bindingID"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
|
||||
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0
|
||||
https://openhab.org/schemas/thing-description-1.0.0.xsd">
|
||||
|
@ -739,7 +739,7 @@ The full Java API for bridge and *Thing* descriptions can be found in the Java p
|
|||
...
|
||||
</options>
|
||||
</event>
|
||||
|
||||
|
||||
<command>
|
||||
<options>
|
||||
<option value="String" />
|
||||
|
@ -754,7 +754,7 @@ The full Java API for bridge and *Thing* descriptions can be found in the Java p
|
|||
</config-description>
|
||||
OR
|
||||
<config-description-ref uri="{binding|thing-type|channel-type|any_other}:bindingID:..." />
|
||||
</channel-type>
|
||||
</channel-type>
|
||||
|
||||
<channel-group-type id="channelGroupTypeID" advanced="{true|false}">
|
||||
<label>String</label>
|
||||
|
@ -765,7 +765,7 @@ The full Java API for bridge and *Thing* descriptions can be found in the Java p
|
|||
<channel id="channelID" typeId="channelTypeID" />
|
||||
...
|
||||
</channels>
|
||||
</channel-group-type>
|
||||
</channel-group-type>
|
||||
|
||||
...
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ The rules are defined at https://github.com/openhab/static-code-analysis/tree/ma
|
|||
|
||||
### Java Coding Style
|
||||
|
||||
* The [Java naming conventions](http://java.about.com/od/javasyntax/a/nameconventions.htm) should be used for source files.
|
||||
* The [Java naming conventions](https://java.about.com/od/javasyntax/a/nameconventions.htm) should be used for source files.
|
||||
* Generics must be used where applicable. See example below:
|
||||
|
||||
```java
|
||||
|
|
|
@ -15,7 +15,7 @@ title: IntelliJ
|
|||
This article refers to the directory where you installed the distribution as `<DISTRO_DIR>`.
|
||||
|
||||
## Build the addons repostory
|
||||
1. fork and clone the [openhab addons repository](http://www.github.com/openhab/openhab-addons) into a new directory (Reference `<ADDON_DIR>` from now on for this arcticle)
|
||||
1. fork and clone the [openhab addons repository](https://www.github.com/openhab/openhab-addons) into a new directory (Reference `<ADDON_DIR>` from now on for this arcticle)
|
||||
- `git clone https://github.com/<yourgitusername>/openhab-addons` (replace git user name accordingly)
|
||||
1. open IntelliJ and create a new Project from existing sources (File | New | Project from existing sources) and pick `<ADDON_DIR>`/pom.xml
|
||||
- IntelliJ will start importing, indexing and building, it will take while, wait until finished (see status bar)
|
||||
|
|
|
@ -11,7 +11,7 @@ We will cover the most important ones here.
|
|||
openHAB uses [git](https://git-scm.com/) as its version control system and [GitHub](https://github.com/openhab) for hosting the different repositories and source code.
|
||||
You will come in contact with git in many places, and it makes sense to familiarize yourself with its basic commands and concepts.
|
||||
There are many places to learn about Git.
|
||||
Try [git - the simple guide](http://rogerdudler.github.io/git-guide/) as a start.
|
||||
Try [git - the simple guide](https://rogerdudler.github.io/git-guide/) as a start.
|
||||
|
||||
Add-ons and the openHAB core itself are written in Java.
|
||||
Java is not hard to learn, but it helps if you have a general technical understanding of programming languages.
|
||||
|
|
|
@ -50,21 +50,21 @@ and windows `C:\Users\your.name\.m2\..`).
|
|||
3. Save the following content in the `config.ini` file:
|
||||
|
||||
```ini
|
||||
osgi.bundles=\
|
||||
org.eclipse.core.runtime,\
|
||||
org.eclipse.equinox.common,\
|
||||
org.eclipse.core.jobs,\
|
||||
org.eclipse.equinox.registry,\
|
||||
org.eclipse.equinox.preferences,\
|
||||
org.eclipse.core.contenttype,\
|
||||
org.eclipse.equinox.app,\
|
||||
org.eclipse.equinox.console,\
|
||||
org.apache.felix.gogo.runtime,\
|
||||
org.apache.felix.gogo.shell,\
|
||||
org.apache.felix.gogo.command
|
||||
osgi.bundles=\
|
||||
org.eclipse.core.runtime,\
|
||||
org.eclipse.equinox.common,\
|
||||
org.eclipse.core.jobs,\
|
||||
org.eclipse.equinox.registry,\
|
||||
org.eclipse.equinox.preferences,\
|
||||
org.eclipse.core.contenttype,\
|
||||
org.eclipse.equinox.app,\
|
||||
org.eclipse.equinox.console,\
|
||||
org.apache.felix.gogo.runtime,\
|
||||
org.apache.felix.gogo.shell,\
|
||||
org.apache.felix.gogo.command
|
||||
|
||||
eclipse.ignoreApp=true
|
||||
eclipse.consoleLog=true
|
||||
eclipse.ignoreApp=true
|
||||
eclipse.consoleLog=true
|
||||
```
|
||||
|
||||
6. Use the following command line to run Equinox:
|
||||
|
@ -88,7 +88,7 @@ Some of the basic OSGi commands are:
|
|||
| *diag* [bundle # or bundle name] | Reports any resolution problems for the bundle with the given numeric or symbolic id |
|
||||
| *services* [filter] | Lists all available services or only services matching to [LDAP-style filter](http://www.ldapexplorer.com/en/manual/109010000-ldap-filter-syntax.htm) (e.g. services (objectClass="\*virtage\*") - will print only services having *virtage* in their class name) |
|
||||
|
||||
Table 1. Equinox commands (Source: <http://www.eclipse.org/equinox/documents/quickstart-framework.php>)
|
||||
Table 1. Equinox commands (Source: <https://www.eclipse.org/equinox/documents/quickstart-framework.php>)
|
||||
|
||||
## Equinox Bundles
|
||||
|
||||
|
@ -105,34 +105,34 @@ Event Admin Service | org.eclipse.equinox.event | OSGi Compendium Release 7 [Eve
|
|||
Equinox Utilities | org.eclipse.equinox.util | A library of utility classes that are frequently used from the Equinox OSGi Service implementation bundles
|
||||
OSGi Services API | org.eclipse.osgi.service | This bundle contains the set of OSGi specified service APIs
|
||||
|
||||
Table 2. OSGi Bundles (Full list can be found at: <http://www.eclipse.org/equinox/bundles/>)
|
||||
Table 2. OSGi Bundles (Full list can be found at: <https://www.eclipse.org/equinox/bundles/>)
|
||||
|
||||
## Further Reading
|
||||
|
||||
- <http://www.eclipse.org/equinox/>
|
||||
- <http://www.eclipse.org/equinox/bundles/>
|
||||
- <http://www.eclipse.org/equinox/documents/quickstart-framework.php>
|
||||
- <http://www.eclipse.org/equinox/framework/>
|
||||
- <http://www.eclipse.org/equinox/incubator/>
|
||||
- <https://www.eclipse.org/equinox/>
|
||||
- <https://www.eclipse.org/equinox/bundles/>
|
||||
- <https://www.eclipse.org/equinox/documents/quickstart-framework.php>
|
||||
- <https://www.eclipse.org/equinox/framework/>
|
||||
- <https://www.eclipse.org/equinox/incubator/>
|
||||
- [OSGiEquinoxExplained](https://eclipse.org/equinox/documents/eclipsist2007/EclipseSummitTurkey2007-OSGiEquinoxExplained.pdf)
|
||||
- <http://blog.idzona.com/2016/01/different-ways-to-start-the-eclipse-equinox-osgi-console.html>
|
||||
- <https://bugs.eclipse.org/bugs/show_bug.cgi?id=371101>
|
||||
- <http://www.eclipse.org/equinox/p2/>
|
||||
- <http://wiki.eclipse.org/Equinox_P2_Resolution>
|
||||
- <http://wiki.eclipse.org/Equinox/p2/FAQ>
|
||||
- <https://wiki.eclipse.org/Installable_Units>
|
||||
- [Products and features](http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fproduct_def.htm)
|
||||
- [Dependency Management for the Eclipse Ecosystem, Eclipse p2, metadata and resolution, Daniel Le Berre, Pascal Rapicault,2009](https://hal.archives-ouvertes.fr/hal-00870855/document)
|
||||
- <https://bugs.eclipse.org/bugs/show_bug.cgi?id=371101>
|
||||
- <https://www.eclipse.org/equinox/p2/>
|
||||
- <https://wiki.eclipse.org/Equinox_P2_Resolution>
|
||||
- <https://wiki.eclipse.org/Equinox/p2/FAQ>
|
||||
- <https://wiki.eclipse.org/Installable_Units>
|
||||
- [Products and features](https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fproduct_def.htm)
|
||||
- [Dependency Management for the Eclipse Ecosystem, Eclipse p2, metadata and resolution, Daniel Le Berre, Pascal Rapicault,2009](https://hal.archives-ouvertes.fr/hal-00870855/document)
|
||||
- [RT meets p2](https://bkapukaranov.wordpress.com/category/tech/virgo/)
|
||||
|
||||
[Equinox]: http://www.eclipse.org/equinox/
|
||||
[Equinox]: https://www.eclipse.org/equinox/
|
||||
[OSGi-Core]: https://osgi.org/download/r7/osgi.core-7.0.0.pdf
|
||||
[Equinox-repo]: http://git.eclipse.org/c/equinox/
|
||||
[Equinox-repo]: https://git.eclipse.org/c/equinox/
|
||||
[Eclipse]: https://eclipse.org/eclipse/
|
||||
[Equinox-Bundles]: http://www.eclipse.org/equinox/bundles/
|
||||
[Equinox-Incubator]: http://www.eclipse.org/equinox/incubator/
|
||||
[p2]: http://www.eclipse.org/equinox/p2/
|
||||
[Equinox-Server]: http://www.eclipse.org/equinox/incubator/server/
|
||||
[products]: http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fproduct_def.htm
|
||||
[plugins]: http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fproduct_def_plugins.htm&cp=2_0_21_2
|
||||
[features]: http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fproduct_def_feature.htm&cp=2_0_21_1
|
||||
[Equinox-Bundles]: https://www.eclipse.org/equinox/bundles/
|
||||
[Equinox-Incubator]: https://www.eclipse.org/equinox/incubator/
|
||||
[p2]: https://www.eclipse.org/equinox/p2/
|
||||
[Equinox-Server]: https://www.eclipse.org/equinox/incubator/server/
|
||||
[products]: https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fproduct_def.htm
|
||||
[plugins]: https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fproduct_def_plugins.htm&cp=2_0_21_2
|
||||
[features]: https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fproduct_def_feature.htm&cp=2_0_21_1
|
||||
|
|
|
@ -17,7 +17,7 @@ Let's use the definition for the pattern that can be found in the [OSGi Compendi
|
|||
The publisher posts events to the channel, which identifies which handlers need to be notified and then takes care of the notification process.*
|
||||
|
||||
Both publishers and subscribers can disappear at any time.
|
||||
A central module to track the handlers availability is needed - the *Event Admin Service*.
|
||||
A central module to track the handlers availability is needed - the *Event Admin Service*.
|
||||
|
||||
## Event Admin Service
|
||||
|
||||
|
@ -28,7 +28,7 @@ But let's illustrate that with the following picture:
|
|||
|
||||
![Bundle lifecycle][fig1]
|
||||
|
||||
Fig.1 Event Admin Service (Source: <http://enroute.osgi.org/img/services/org.osgi.service.event.overview.png>)
|
||||
Fig.1 Event Admin Service (Source: <https://enroute.osgi.org/img/services/org.osgi.service.event.overview.png>)
|
||||
|
||||
Before going into more details, let's take a look at the events.
|
||||
|
||||
|
@ -79,7 +79,7 @@ The service contains two methods for sending events:
|
|||
## Further Reading
|
||||
|
||||
- [OSGi Compendium Release 7][OSGi-cmpn]
|
||||
- <http://enroute.osgi.org/services/org.osgi.service.event.html>
|
||||
- <https://enroute.osgi.org/services/org.osgi.service.event.html>
|
||||
- <http://blog.vogella.com/2017/05/16/osgi-event-admin-publish-subscribe/>
|
||||
|
||||
[fig1]:images/event-admin.png
|
||||
|
|
|
@ -37,7 +37,7 @@ The OSGi framework consist of several layers build on top of each other (See Fig
|
|||
- **Actual Services** (Bundles on Fig.1) - this is the application layer, using all other layers;
|
||||
- **Security Layer** - optional layer, based on the Java 2 security architecture, that manages permissions for different modules.
|
||||
|
||||
![OSGi Layers][fig1]
|
||||
![OSGi Layers][fig1]
|
||||
Fig.1 OSGi Layering (Source:<https://www.osgi.org/wp-content/uploads/layering-osgi.png>)
|
||||
|
||||
More details about the OSGi architecture can be found at <https://www.osgi.org/developer/architecture/>
|
||||
|
@ -52,7 +52,7 @@ The *Bundle-SymbolicName* and the *Bundle-Version* headers uniquely identify a b
|
|||
In OSGi is allowed to have **bundles with same name, but different version running at the same time.**
|
||||
|
||||
Some of the most important information that the manifest contains are the bundle dependencies.
|
||||
**A bundle can depend on another bundle or on a package**.
|
||||
**A bundle can depend on another bundle or on a package**.
|
||||
|
||||
The **OSGi runtime uses the information about the dependencies to *wire* the bundles and hides everything in this JAR unless it is explicitly exported**.
|
||||
The dependencies to the Java standard libraries are managed by the *Bundle-RequiredExecutionEnvironment* header, so it is not needed to import the Java core packages.
|
||||
|
@ -92,13 +92,13 @@ The table below shows the possible states of an OSGi bundle with a short explana
|
|||
| STARTING | A temporary state that the bundle goes through while the bundle is starting, after all dependencies have been resolved. The bundle is permitted to register services. |
|
||||
| ACTIVE | The bundle is running |
|
||||
| STOPPING | A temporary state that the bundle goes through while the bundle is stopping |
|
||||
| UNINSTALLED | The bundle has been removed from the OSGi container. |
|
||||
| UNINSTALLED | The bundle has been removed from the OSGi container. |
|
||||
|
||||
Table 1 Bundle states description
|
||||
|
||||
The possible status transitions are shown in the state diagram below:
|
||||
|
||||
![Bundle lifecycle][fig2]
|
||||
![Bundle lifecycle][fig2]
|
||||
Fig.2 Bundle State diagram
|
||||
|
||||
## Services
|
||||
|
@ -114,7 +114,7 @@ A bundle can therefore register a service, it can get a service and it can track
|
|||
**Any number of bundles can register the same service type and any number of bundles can get the same service.**
|
||||
A simple diagram of the service usage and tracking is shown on Fig. 3.
|
||||
|
||||
![OSGi Services][fig3]
|
||||
![OSGi Services][fig3]
|
||||
Fig.3 OSGi Services (Source: <https://www.osgi.org/wp-content/uploads/services.png>)
|
||||
|
||||
If you are keen to know how that works in code, read on in [OSGi Declarative Services](osgids.html).
|
||||
|
@ -149,8 +149,8 @@ We will list the most popular OSGi containers with a short description of their
|
|||
- Open source:
|
||||
- [Equinox](https://www.eclipse.org/equinox/) - this is the reference implementation of OSGi and developed by the Eclipse Foundation.
|
||||
As it is used in the openHAB project, we have [more detailed information](equinox.html).
|
||||
- [Apache Felix](http://felix.apache.org/) - developed by the Apache Software Foundation.
|
||||
[Apache Karaf](http://karaf.apache.org/) is a distribution based on Apache Felix that provides some additional features on top of it (e.g. folder based hot deployment, improved default console with remote SSH, maven plugins and others). The openHAB project is using karaf for runtime dependency installation.
|
||||
- [Apache Felix](https://felix.apache.org/) - developed by the Apache Software Foundation.
|
||||
[Apache Karaf](https://karaf.apache.org/) is a distribution based on Apache Felix that provides some additional features on top of it (e.g. folder based hot deployment, improved default console with remote SSH, maven plugins and others). The openHAB project is using karaf for runtime dependency installation.
|
||||
- [Concierge](https://www.eclipse.org/concierge/) - is aimed at mobile and embedded devices. With a size of around 250 kb it has the smallest footprint of the presented containers;
|
||||
|
||||
- Commercial:
|
||||
|
@ -172,7 +172,7 @@ We will list the most popular OSGi containers with a short description of their
|
|||
- [OSGi API](https://osgi.org/javadoc/osgi.core/7.0.0/)
|
||||
- [OSGi Vogella guide](http://www.vogella.com/tutorials/OSGi/article.html)
|
||||
- [Lifecycle of a bundle](https://developer.atlassian.com/docs/atlassian-platform-common-components/plugin-framework/behind-the-scenes-in-the-plugin-framework/lifecycle-of-a-bundle)
|
||||
- [OSGi enRoute](http://enroute.osgi.org/)
|
||||
- [OSGi enRoute](https://enroute.osgi.org/)
|
||||
- <https://www.osgi.org/developer/where-to-start/>
|
||||
|
||||
[OSGi]: https://www.osgi.org/
|
||||
|
|
|
@ -25,14 +25,14 @@ In order to understand this model, we will have to first explain a few terms, us
|
|||
- **Service Component** (or also **component**) - an object whose lifecycle is managed,
|
||||
usually by a component framework such as Declarative Services (DS).
|
||||
A component may publish itself as an OSGi service or consume OSGi services.
|
||||
A component can refer to a number of services;
|
||||
A component can refer to a number of services;
|
||||
- **Component Description** - The declaration of a component.
|
||||
It is contained within an XML document in a bundle.
|
||||
|
||||
## DS Container
|
||||
|
||||
In order to use the Declarative Services functionality you have to start a bundle with an implementation of the DS container.
|
||||
In [Equinox](http://www.eclipse.org/equinox/) (the reference implementation of OSGi that is used in openHAB) this bundle is called `org.eclipse.equinox.ds`.
|
||||
In [Equinox](https://www.eclipse.org/equinox/) (the reference implementation of OSGi that is used in openHAB) this bundle is called `org.eclipse.equinox.ds`.
|
||||
|
||||
When a bundle that contains a component is added to the framework, DS reads its component description (the XML file that is generated by the Java annotations).
|
||||
If the conditions, described in this file are fulfilled (you will understand more about this in the next chapters), the DS activates the component (more on the that in the [component lifecycle](#vii-component-lifecycle) chapter).
|
||||
|
@ -128,7 +128,7 @@ Let's take a look at some configuration parameters, that we can apply:
|
|||
If you want to react when a service got resolved, you may use annotated methods instead of fields like in the example below.
|
||||
|
||||
The annotated `activate()` and `deactivate()` methods are called from DS, when the component configuration is activated and deactivated (more about [activation](osgids.html#activation)):
|
||||
|
||||
|
||||
```java
|
||||
@Component(service = MyService.class, immediate = true)
|
||||
@NonNullByDefault
|
||||
|
@ -195,10 +195,10 @@ In this case we tell tell Event Admin Service in which topics we are interested.
|
|||
## Component types
|
||||
|
||||
A component lifecycle depends of the type of the component.
|
||||
Three type of components are defined:
|
||||
Three type of components are defined:
|
||||
|
||||
- **immediate** - with ```immediate``` attribute set to ```true``` - see the [example component description](#service-component-description);
|
||||
- **delayed** - with ```immediate``` attribute set to ```false```;
|
||||
- **immediate** - with ```immediate``` attribute set to ```true``` - see the [example component description](#service-component-description);
|
||||
- **delayed** - with ```immediate``` attribute set to ```false```;
|
||||
- **factory** - we will not discuss the lifecycle of this type in this article.
|
||||
|
||||
You can find more information in the [OSGi Compendium Release 7, Chapter 112.2: Components][OSGi-cmpn].
|
||||
|
@ -211,11 +211,11 @@ A component goes through several states in his lifecycle:
|
|||
- **REGISTERED** - temporary state. Only *delayed* components go through this state;
|
||||
- **ACTIVE** - the component is active and component instance is created.
|
||||
|
||||
<img src="images/immediatecomponent.png" width="320" height="200" />
|
||||
<img src="images/immediatecomponent.png" width="320" height="200" />
|
||||
Fig.1 Immediate component lifecycle
|
||||
|
||||
<img src="images/delayedcomponent.png" width="400" height="200" />
|
||||
Fig.2 Delayed component lifecycle
|
||||
<img src="images/delayedcomponent.png" width="400" height="200" />
|
||||
Fig.2 Delayed component lifecycle
|
||||
|
||||
### States
|
||||
|
||||
|
@ -227,7 +227,7 @@ A component is **enabled**, when the component's bundle is **started** and **dis
|
|||
After the Component is enabled, it is moved to the UNSATISFIED state.
|
||||
The next step is to satisfy the component configuration.
|
||||
|
||||
The component **configuration is satisfied** when:
|
||||
The component **configuration is satisfied** when:
|
||||
|
||||
- component is **enabled**;
|
||||
- all the **component references are satisfied**.
|
||||
|
@ -247,14 +247,14 @@ Activation consists of following steps:
|
|||
After the activation, the component is in ACTIVE state.
|
||||
From this state the component can go back to the *REGISTERED* state (or to the *UNSATISFIED* state), if the component configuration becomes unsatisfied.
|
||||
|
||||
### Deactivation
|
||||
### Deactivation
|
||||
|
||||
Deactivation consists of the following actions:
|
||||
|
||||
- The method that is annotated with `@Deactivate` is called, if present
|
||||
- All `@Reference`d services are unbound
|
||||
- Release all references to the component instance.
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Find a few tips down below if something has gone wrong.
|
||||
|
@ -279,7 +279,7 @@ You might review again the [Equinox commands](equinox.html#iv-commands) before y
|
|||
|
||||
- [OSGi Compendium Release 7][OSGi-cmpn]
|
||||
- [Lars Vogel - Declarative services](http://www.vogella.com/tutorials/OSGiServices/article.html#declarativeservices)
|
||||
- [Getting Started with OSGi: Declarative Services](http://www.eclipsezone.com/eclipse/forums/t97690.rhtml)
|
||||
- <http://stackoverflow.com/questions/8886430/what-is-the-difference-between-osgi-components-and-services>
|
||||
- [Getting Started with OSGi: Declarative Services](https://www.eclipsezone.com/eclipse/forums/t97690.rhtml)
|
||||
- <https://stackoverflow.com/questions/8886430/what-is-the-difference-between-osgi-components-and-services>
|
||||
|
||||
[OSGi-cmpn]: https://osgi.org/download/r7/osgi.cmpn-7.0.0.pdf
|
||||
|
|
|
@ -44,7 +44,7 @@ assertThat(pt.toString(), is(equalTo("0.0001")));
|
|||
|
||||
In order to keep tests as focused as possible we use the mocking framework [https://github.com/mockito/mockito Mockito].
|
||||
Mockito lets us verify interactions between supporting classes and the unit under test and additionally supports stubbing of method calls for these classes.
|
||||
Please read the very short but expressive introduction on the [http://site.mockito.org/ Mockito homepage] in addition to this small example:
|
||||
Please read the very short but expressive introduction on the [https://site.mockito.org/ Mockito homepage] in addition to this small example:
|
||||
|
||||
```java
|
||||
public class MyBindingHandlerTest {
|
||||
|
@ -60,7 +60,7 @@ public class MyBindingHandlerTest {
|
|||
handler = new MyBindingHandler(thing);
|
||||
handler.setCallback(callback);
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
// Free any resources, like open database connections, files etc.
|
||||
|
@ -113,7 +113,7 @@ public void assertionsToBeUsed() {
|
|||
assertThat(null, is(nullValue()));
|
||||
assertThat(new Object(), is(not(nullValue())));
|
||||
assertThat(true, is(not(false)));
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Integration tests
|
||||
|
@ -131,7 +131,7 @@ Most situations can be tested using mocks (see [Mockito](#mockito)) and unit tes
|
|||
|
||||
From maven one can execute the test with `mvn install` command from the folder of the test fragment bundle.
|
||||
|
||||
### Example
|
||||
### Example
|
||||
|
||||
The base class `JavaOSGiTest` sets up a bundle context and has convenience methods for registering mocks as OSGi services and the retrieval of registered OSGi services.
|
||||
Public methods with a @Test annotation will automatically be executed as OSGi tests, as long as the class-name ends with `Test`.
|
||||
|
|
|
@ -160,7 +160,7 @@ Received events can be cast to the event implementation class for further proces
|
|||
Each event subscriber must be registered via OSGi Declarative Services (DS) under the `org.openhab.core.event.EventSubscriber` interface.
|
||||
|
||||
```xml
|
||||
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="SomeItemEventSubscriber">
|
||||
<scr:component xmlns:scr="https://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="SomeItemEventSubscriber">
|
||||
<implementation class="org.openhab.core.items.events.SomeItemEventSubscriber"/>
|
||||
<service>
|
||||
<provide interface="org.openhab.core.events.EventSubscriber"/>
|
||||
|
|
|
@ -36,7 +36,7 @@ any_<language-code>.properties
|
|||
any.properties
|
||||
```
|
||||
|
||||
You can find detailed information about Java internationalization support and a list of the ISO 639 and ISO 3166 codes at [The Java Tutorials](http://docs.oracle.com/javase/tutorial/i18n/locale/create.html) page.
|
||||
You can find detailed information about Java internationalization support and a list of the ISO 639 and ISO 3166 codes at [The Java Tutorials](https://docs.oracle.com/javase/tutorial/i18n/locale/create.html) page.
|
||||
|
||||
The properties files have to be placed in the following directory of the bundle:
|
||||
|
||||
|
@ -219,7 +219,7 @@ XML file (`thing-types.xml`):
|
|||
<description>This is the weather forecast in two days</description>
|
||||
</channel-group>
|
||||
</channel-groups>
|
||||
|
||||
|
||||
<config-description>
|
||||
<parameter name="apikey" type="text" required="true">
|
||||
<context>password</context>
|
||||
|
|
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="78" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="78" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h43v20H0z"/><path fill="#97CA00" d="M43 0h35v20H43z"/><path fill="url(#b)" d="M0 0h78v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="21.5" y="15" fill="#010101" fill-opacity=".3">install</text><text x="21.5" y="14">install</text><text x="59.5" y="15" fill="#010101" fill-opacity=".3">auto</text><text x="59.5" y="14">auto</text></g></svg>
|
||||
<svg xmlns="https://www.w3.org/2000/svg" width="78" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="78" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h43v20H0z"/><path fill="#97CA00" d="M43 0h35v20H43z"/><path fill="url(#b)" d="M0 0h78v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="21.5" y="15" fill="#010101" fill-opacity=".3">install</text><text x="21.5" y="14">install</text><text x="59.5" y="15" fill="#010101" fill-opacity=".3">auto</text><text x="59.5" y="14">auto</text></g></svg>
|
Before Width: | Height: | Size: 750 B After Width: | Height: | Size: 751 B |
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="88" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="88" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h43v20H0z"/><path fill="#dfb317" d="M43 0h45v20H43z"/><path fill="url(#b)" d="M0 0h88v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="21.5" y="15" fill="#010101" fill-opacity=".3">install</text><text x="21.5" y="14">install</text><text x="64.5" y="15" fill="#010101" fill-opacity=".3">legacy</text><text x="64.5" y="14">legacy</text></g></svg>
|
||||
<svg xmlns="https://www.w3.org/2000/svg" width="88" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="88" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h43v20H0z"/><path fill="#dfb317" d="M43 0h45v20H43z"/><path fill="url(#b)" d="M0 0h88v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="21.5" y="15" fill="#010101" fill-opacity=".3">install</text><text x="21.5" y="14">install</text><text x="64.5" y="15" fill="#010101" fill-opacity=".3">legacy</text><text x="64.5" y="14">legacy</text></g></svg>
|
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 755 B |
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="94" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="94" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h43v20H0z"/><path fill="#9f9f9f" d="M43 0h51v20H43z"/><path fill="url(#b)" d="M0 0h94v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="21.5" y="15" fill="#010101" fill-opacity=".3">install</text><text x="21.5" y="14">install</text><text x="67.5" y="15" fill="#010101" fill-opacity=".3">manual</text><text x="67.5" y="14">manual</text></g></svg>
|
||||
<svg xmlns="https://www.w3.org/2000/svg" width="94" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="94" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h43v20H0z"/><path fill="#9f9f9f" d="M43 0h51v20H43z"/><path fill="url(#b)" d="M0 0h94v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="21.5" y="15" fill="#010101" fill-opacity=".3">install</text><text x="21.5" y="14">install</text><text x="67.5" y="15" fill="#010101" fill-opacity=".3">manual</text><text x="67.5" y="14">manual</text></g></svg>
|
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 755 B |
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="64" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h37v20H0z"/><path fill="#a4a61d" d="M37 0h27v20H37z"/><path fill="url(#b)" d="M0 0h64v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="18.5" y="15" fill="#010101" fill-opacity=".3">since</text><text x="18.5" y="14">since</text><text x="49.5" y="15" fill="#010101" fill-opacity=".3">1.x</text><text x="49.5" y="14">1.x</text></g></svg>
|
||||
<svg xmlns="https://www.w3.org/2000/svg" width="64" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="64" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h37v20H0z"/><path fill="#a4a61d" d="M37 0h27v20H37z"/><path fill="url(#b)" d="M0 0h64v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="18.5" y="15" fill="#010101" fill-opacity=".3">since</text><text x="18.5" y="14">since</text><text x="49.5" y="15" fill="#010101" fill-opacity=".3">1.x</text><text x="49.5" y="14">1.x</text></g></svg>
|
Before Width: | Height: | Size: 744 B After Width: | Height: | Size: 745 B |
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="64" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h37v20H0z"/><path fill="#fe7d37" d="M37 0h27v20H37z"/><path fill="url(#b)" d="M0 0h64v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="18.5" y="15" fill="#010101" fill-opacity=".3">since</text><text x="18.5" y="14">since</text><text x="49.5" y="15" fill="#010101" fill-opacity=".3">2.x</text><text x="49.5" y="14">2.x</text></g></svg>
|
||||
<svg xmlns="https://www.w3.org/2000/svg" width="64" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="64" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h37v20H0z"/><path fill="#fe7d37" d="M37 0h27v20H37z"/><path fill="url(#b)" d="M0 0h64v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="18.5" y="15" fill="#010101" fill-opacity=".3">since</text><text x="18.5" y="14">since</text><text x="49.5" y="15" fill="#010101" fill-opacity=".3">2.x</text><text x="49.5" y="14">2.x</text></g></svg>
|
Before Width: | Height: | Size: 744 B After Width: | Height: | Size: 745 B |
|
@ -31,7 +31,7 @@ Train your understanding of Linux permissions at [linuxjourney.com/lesson/file-p
|
|||
As a first step, please verify, that your system meets the [prerequisites](index.html#prerequisites).
|
||||
You may want to install Zulu, a fully certified Java build [as a package or manually](https://docs.azul.com/zulu/zuludocs/ZuluUserGuide/InstallingZulu/InstallZulu.htm).
|
||||
|
||||
Alternatively, Zulu Embedded can be installed for small systems either from the same package repository as above or [manually](http://www.azul.com/downloads/zulu-embedded/).
|
||||
Alternatively, Zulu Embedded can be installed for small systems either from the same package repository as above or [manually](https://www.azul.com/downloads/zulu-embedded/).
|
||||
If you're unsure which manual file you should download, using `dpkg --print-architecture` or `rpm -q --qf '%{ARCH}\n' rpm` in your Linux terminal should point you in the right direction (e.g. armhf means ARM Hard Float).
|
||||
|
||||
When installing Zulu or Zulu Embedded from a .zip or .tar archive, make sure to [set Zulu as the main Java "alternative"](https://docs.azul.com/zulu/zuludocs/#ZuluUserGuide/SwitchingBetweenJavaAlternatives/SwitchBetweenJavaAlts.htm).
|
||||
|
|
|
@ -16,7 +16,7 @@ This page is structured as follows:
|
|||
|
||||
If you're unfamiliar with using the macOS terminal, then feel free to follow the many guides on the internet. For example:
|
||||
|
||||
[Macworld: How to use Terminal on mac](http://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/)
|
||||
[Macworld: How to use Terminal on mac](https://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/)
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
|
@ -246,7 +246,7 @@ openHABian is supposed to provide a ready-to-use openHAB base system. There are
|
|||
|
||||
All of these settings **can easily be changed** via the openHABian Configuration Tool.
|
||||
|
||||
Here are the passwords in question with their respective default "username:password" values.
|
||||
Here are the passwords in question with their respective default "username:password" values.
|
||||
All password can be changed from openHABian menu.
|
||||
|
||||
{: #passwords}
|
||||
|
|
|
@ -13,7 +13,7 @@ It is favored amongst existing users and a recommended choice for newcomers.
|
|||
![Raspberry Pi 2 Model B](images/rpi2b.png)
|
||||
|
||||
If you want to learn more about the possibilities of the Raspberry Pi and Linux in general, many tutorials can be found on the internet.
|
||||
These including the official [raspberrypi.org help articles](https://www.raspberrypi.org/help) or the in-detail articles at [eLinux.org](http://elinux.org/RPi_Tutorials).
|
||||
These including the official [raspberrypi.org help articles](https://www.raspberrypi.org/help) or the in-detail articles at [eLinux.org](https://elinux.org/RPi_Tutorials).
|
||||
|
||||
Recommendations for a ["headless"](https://en.wikipedia.org/wiki/Headless_computer) hardware setup:
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ There are many different solutions for VPN, so we cannot give any specific advic
|
|||
You can use an [openHAB Cloud](https://github.com/openhab/openhab-cloud/blob/master/README.md) instance to which openHAB creates a tunnel connection and which forwards all requests through this tunnel.
|
||||
openHAB will see these incoming requests as originating from the local loopback interface.
|
||||
|
||||
The simplest way to get hold of such an openHAB Cloud is to register an account at [myopenHAB.org](http://www.myopenhab.org/), which is operated by the [openHAB Foundation](https://www.openhabfoundation.org/).
|
||||
The simplest way to get hold of such an openHAB Cloud is to register an account at [myopenHAB.org](https://www.myopenhab.org/), which is operated by the [openHAB Foundation](https://www.openhabfoundation.org/).
|
||||
|
||||
{: #nginx-reverse-proxy}
|
||||
### Running openHAB Behind a Reverse Proxy
|
||||
|
@ -250,9 +250,9 @@ To generate a trusted certificate, you need to own a domain. To acquire your own
|
|||
|
||||
| Method | Example Links | Note |
|
||||
|:-------------------------------- |:------------- |:---- |
|
||||
| Purchasing a domain name | [GoDaddy](http://www.godaddy.com), [Namecheap](http://www.namecheap.com), [Enom](http://www.enom.com), [Register](http://www.register.com) | You should have an IP adress that doesn't change (i.e. fixed), or changes rarely, and then update the DNS *A record* so that your domain/subdomain to point towards your IP. |
|
||||
| Obtaining a free domain | [FreeNom](http://www.freenom.com) | Setup is the same as above. |
|
||||
| Using a "Dynamic DNS" sevice | [No-IP](http://www.noip.com), [Dyn](http://www.dyn.com/dns), [FreeDNS](http://freedns.afraid.org) | Uses a client to automatically update your IP to a domain of you choice, some Dynamic DNS services (like FreeDNS) offer a free domain too. |
|
||||
| Purchasing a domain name | [GoDaddy](https://www.godaddy.com), [Namecheap](https://www.namecheap.com), [Enom](https://www.enom.com), [Register](https://www.register.com) | You should have an IP adress that doesn't change (i.e. fixed), or changes rarely, and then update the DNS *A record* so that your domain/subdomain to point towards your IP. |
|
||||
| Obtaining a free domain | [FreeNom](https://www.freenom.com) | Setup is the same as above. |
|
||||
| Using a "Dynamic DNS" sevice | [No-IP](https://www.noip.com), [Dyn](https://www.dyn.com/dns), [FreeDNS](https://freedns.afraid.org) | Uses a client to automatically update your IP to a domain of you choice, some Dynamic DNS services (like FreeDNS) offer a free domain too. |
|
||||
|
||||
{: #nginx-https}
|
||||
#### Enabling HTTPS
|
||||
|
@ -380,7 +380,7 @@ server {
|
|||
```
|
||||
|
||||
It might be the case that you can't use standard ports. When trying to access a HTTPS port with HTTP, NGINX will respond with a `400 Bad Request`.
|
||||
We can redirect this gracefully using a "HTTPS [error page](http://nginx.org/en/docs/http/ngx_http_core_module.html#error_page)" for the [non-standard HTTP error code 497](http://nginx.org/en/docs/http/ngx_http_ssl_module.html#errors)
|
||||
We can redirect this gracefully using a "HTTPS [error page](https://nginx.org/en/docs/http/ngx_http_core_module.html#error_page)" for the [non-standard HTTP error code 497](https://nginx.org/en/docs/http/ngx_http_ssl_module.html#errors)
|
||||
|
||||
```nginx
|
||||
server {
|
||||
|
@ -434,7 +434,7 @@ server {
|
|||
{: #synology-remote-config}
|
||||
#### Configuration on Synology DiskStation
|
||||
|
||||
Synology DSM (as of 6.2) has the ability to automatically acquire certificates from Let's Encrypt and renew them every 90 days as required.
|
||||
Synology DSM (as of 6.2) has the ability to automatically acquire certificates from Let's Encrypt and renew them every 90 days as required.
|
||||
The majority of the configuration mentioned above can be completed through the DSM GUI, but SSH access is required to implement authentication (**authentication is essential for remote access to your openHAB instance**).
|
||||
|
||||
Before you continue, make sure you have the below conditions:
|
||||
|
@ -444,11 +444,11 @@ Before you continue, make sure you have the below conditions:
|
|||
- Access to your DiskStation by SSH ([How to login to DSM with root permission via SSH/Telnet](https://www.synology.com/en-global/knowledgebase/DSM/tutorial/General_Setup/How_to_login_to_DSM_with_root_permission_via_SSH_Telnet/))
|
||||
- Ports 80 and 443 forwarded from your router to your DiskStation (make sure you reconfigure the router web UI to a different port first, so you don't lose access!)
|
||||
|
||||
Log into the GUI of your DiskStation as administrator, and open the package center.
|
||||
Install Apache HTTP Server.
|
||||
Log into the GUI of your DiskStation as administrator, and open the package center.
|
||||
Install Apache HTTP Server.
|
||||
This is needed to generate the password files.
|
||||
|
||||
Go to Control Panel > Application Portal > Reverse Proxy. We will set up two reverse proxies, one for HTTP and one for HTTPS.
|
||||
Go to Control Panel > Application Portal > Reverse Proxy. We will set up two reverse proxies, one for HTTP and one for HTTPS.
|
||||
The HTTP one can be disabled later if desired (not at all essential if you will only use the app remotely, and never a browser).
|
||||
|
||||
Create two reverse proxies as follows:
|
||||
|
@ -485,10 +485,10 @@ Next, acquire certificates from Let's Encrypt using the GUI in DSM.
|
|||
|
||||
Go to Control Panel > Security > Certificate, and click on 'Add'.
|
||||
Select the option to 'Add a new Certificate'.
|
||||
Put in a description, something like 'openHAB SSL Cert' (it doesn't matter).
|
||||
Select 'Get a certificate from Let's Encrypt' and check the box to set it as default.
|
||||
Put in a description, something like 'openHAB SSL Cert' (it doesn't matter).
|
||||
Select 'Get a certificate from Let's Encrypt' and check the box to set it as default.
|
||||
Click next.
|
||||
Put in your domain name and email address.
|
||||
Put in your domain name and email address.
|
||||
Add a 'Subject Alternative Name' if you want a different topic in the subject line when Let's Encrypt email you about that certificate (not essential).
|
||||
Click Apply, and wait a few minutes - your certificate is done!
|
||||
|
||||
|
@ -498,7 +498,7 @@ If the certifcate has been generated, you are good to go.
|
|||
:::
|
||||
|
||||
Select the certificate that has just been created, and click on 'Configure'.
|
||||
Ensure that the new certificate is listed next to your-hostname.com in the table - something like the below.
|
||||
Ensure that the new certificate is listed next to your-hostname.com in the table - something like the below.
|
||||
If it's not selected, update it.
|
||||
|
||||
| Services | Certificate |
|
||||
|
@ -511,16 +511,16 @@ If it's not selected, update it.
|
|||
Once this is done, update the CAA record for your-hostname.com with your registrar (exact process will vary by registrar).
|
||||
Within an hour or so, you should not receive the security warning for https://your-hostname.com.
|
||||
|
||||
Next, you must add authentication to the reverse proxy.
|
||||
Next, you must add authentication to the reverse proxy.
|
||||
There's no GUI way to do this, so we need to create another small NGINX virtual host on the DiskStation.
|
||||
|
||||
Log into your DiskStation by SSH.
|
||||
Log into your DiskStation by SSH.
|
||||
Use the admin username and password.
|
||||
Create a .htpasswd file in your openHAB userdata folder (your userdata location may vary, update accordingly):
|
||||
```shell
|
||||
htpasswd -c /volume1/openHAB/userdata/.htpasswd username
|
||||
```
|
||||
Next, add a very simple NGINX configuration similar to that created above, but without the SSL parameters.
|
||||
Next, add a very simple NGINX configuration similar to that created above, but without the SSL parameters.
|
||||
DSM comes with vi installed by default, but you may wish to [install nano](https://anto.online/other/how-to-install-nano-on-your-synology-nas/)
|
||||
|
||||
```shell
|
||||
|
@ -534,7 +534,7 @@ server {
|
|||
listen 2020; #This is simply an unused port, it can be any number
|
||||
|
||||
server_name your_domain.com;
|
||||
|
||||
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
|
@ -565,8 +565,8 @@ Once you are done, save the file, restart and test NGINX:
|
|||
```shell
|
||||
sudo nginx -s reload && sudo nginx -t
|
||||
```
|
||||
As above, the first part of the file redirects any HTTP queries to HTTPS directly.
|
||||
If you don't get any errors, update the reverse proxy settings in the DSM GUI to point to these new endpoints.
|
||||
As above, the first part of the file redirects any HTTP queries to HTTPS directly.
|
||||
If you don't get any errors, update the reverse proxy settings in the DSM GUI to point to these new endpoints.
|
||||
Back in the GUI, go to Control Panel > Application Portal > Reverse Proxy, make the updates below:
|
||||
|
||||
| Parameter | Value |
|
||||
|
@ -608,7 +608,7 @@ openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
|
|||
```
|
||||
|
||||
Now we can configure NGINX to use this key, as well as telling the client to use specific cyphers and SSL settings, just add the following under your `ssl_certificate **` settings but above ``location *``.
|
||||
All of these settings are customisable, but make sure you [read up on](http://nginx.org/en/docs/http/configuring_https_servers.html) what these do first before changing them:
|
||||
All of these settings are customisable, but make sure you [read up on](https://nginx.org/en/docs/http/configuring_https_servers.html) what these do first before changing them:
|
||||
|
||||
```nginx
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
|
|
|
@ -28,12 +28,12 @@ The filename and format of the uploaded file will be checked before installation
|
|||
If there is not a Java8 package in the Package Center, your machine may not be supported by the [Synology package](https://www.synology.com/en-us/dsm/packages/Java8).
|
||||
|
||||
The best option for older unsupported Synology models such as **PowerPC** and **ARMv5** is to include the [PC-Loadletter](https://pcloadletter.co.uk/2011/08/23/java-package-for-synology/) Repo.
|
||||
[Download Java SE](http://www.oracle.com/technetwork/java/embedded/embedded-se/downloads/index.html) [(latest ARMv6)](http://www.oracle.com/technetwork/java/embedded/embedded-se/downloads/javase-embedded-downloads-2209751.html) [(Java Cryptography Extension if required)](http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html) and put them in the *public* folder of your NAS.
|
||||
[Download Java SE](https://www.oracle.com/technetwork/java/embedded/embedded-se/downloads/index.html) [(latest ARMv6)](https://www.oracle.com/technetwork/java/embedded/embedded-se/downloads/javase-embedded-downloads-2209751.html) [(Java Cryptography Extension if required)](https://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html) and put them in the *public* folder of your NAS.
|
||||
Then start the installation of Java8 SE.
|
||||
|
||||
*Note that it may be necessary to rename the downloaded file to match the name the Loadletter utility expects which may be an older version than what is currently available.*
|
||||
|
||||
The **Java8 PowerPC** versions are available from [Oracle](http://www.oracle.com/technetwork/java/embedded/embedded-se/downloads/javaseembedded8u6-2406243.html).
|
||||
The **Java8 PowerPC** versions are available from [Oracle](https://www.oracle.com/technetwork/java/embedded/embedded-se/downloads/javaseembedded8u6-2406243.html).
|
||||
|
||||
## Installation
|
||||
|
||||
|
@ -52,7 +52,7 @@ If your NAS cannot connect to the internet, the installer will tell you to downl
|
|||
|
||||
## Configuration
|
||||
|
||||
The location of configuration files by openHAB differs depending on wether or not a shared folder named `public` exists:
|
||||
The location of configuration files by openHAB differs depending on wether or not a shared folder named `public` exists:
|
||||
|
||||
* with public share folder: `/volume1/public/openHAB2/conf/`
|
||||
* without public share folder: `/volume1/@appstore/openHAB2/conf/`
|
||||
|
|
|
@ -28,7 +28,7 @@ Please be sure you have installed the required supporting applications as descri
|
|||
|
||||
![JAVA_HOME](images/JAVA_HOME.png)
|
||||
|
||||
### Choose a folder name for the openHAB installation.
|
||||
### Choose a folder name for the openHAB installation.
|
||||
The name must **contain no spaces**. On this page, we will be using `C:\openHAB` as an example.
|
||||
|
||||
## Installation
|
||||
|
@ -49,10 +49,10 @@ To install it, follow these simple steps:
|
|||
|
||||
4. Point your browser to `http://localhost:8080`.
|
||||
You should be looking at the openHAB page requesting you to set up an administrator username and password:
|
||||
|
||||
|
||||
![Home_OH_adminCreate](images/Home_OH_adminCreate.png)
|
||||
|
||||
You are now able to work in the openHAB environment, when launched using `C:\openHAB\start.bat`.
|
||||
|
||||
You are now able to work in the openHAB environment, when launched using `C:\openHAB\start.bat`.
|
||||
You can choose to add a link to it on your Desktop, Taskbar or start menu as you deem more convenient.
|
||||
If you instead would like to have openHAB start automatically with Windows and run in the background, you can choose to install it as a service as described below.
|
||||
|
||||
|
@ -172,7 +172,7 @@ By installing the openHAB process as a service in Windows, you can:
|
|||
![Windows Service](images/Windows_Service.jpg)
|
||||
|
||||
- Logging in with an SSH client to the console (see info below)
|
||||
|
||||
|
||||
|
||||
### File Locations
|
||||
|
||||
|
@ -189,7 +189,7 @@ Assuming a successful install, you will now have various folders inside `C:\open
|
|||
|
||||
## What next?
|
||||
You can:
|
||||
- continue reading the [Additional steps]({{base}}/installation/index.md#additional-steps) section of the Installation overview
|
||||
- continue reading the [Additional steps]({{base}}/installation/index.md#additional-steps) section of the Installation overview
|
||||
- read more about how to handle basic maintenance tasks, in the section below
|
||||
|
||||
## Maintenance
|
||||
|
@ -213,7 +213,7 @@ Update-openHAB -OHVersion x.x.x
|
|||
```
|
||||
Now that openHAB has updated, you only need to run the above commands again for future versions.
|
||||
|
||||
### Uninstallation
|
||||
### Uninstallation
|
||||
- perform a backup as described above
|
||||
- uninstall openHAB as a Windows service: run PowerShell as an administrator and use the following commands
|
||||
```
|
||||
|
@ -224,7 +224,7 @@ C:\openHAB\userdata\bin\openHAB-service.bat remove
|
|||
|
||||
### Connecting to the openHAB console
|
||||
|
||||
You can connect to openHAB's console using the the `C:\openHAB\runtime\bin\client.bat` script on the local machine.
|
||||
You can connect to openHAB's console using the the `C:\openHAB\runtime\bin\client.bat` script on the local machine.
|
||||
Alternatively, you can use a standard SSH client:
|
||||
|
||||
- Install an SSH client application, e.g., [Putty](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html), [KiTTY](http://kitty.9bis.net/) or [Xshell 5](https://www.netsarang.com/products/xsh_overview.html)
|
||||
|
|
|
@ -186,7 +186,7 @@ But it comes with a rather steep learning curve.
|
|||
## A Deeper Dive: openHAB Structure for Advanced Users
|
||||
|
||||
openHAB is developed in [Java](https://www.java.com/) and uses [OSGi](https://www.osgi.org/) for modularity.
|
||||
[Apache Karaf](http://karaf.apache.org/) serves as a container with [Eclipse Equinox](https://www.eclipse.org/equinox/) as the OSGi runtime environment.
|
||||
[Apache Karaf](https://karaf.apache.org/) serves as a container with [Eclipse Equinox](https://www.eclipse.org/equinox/) as the OSGi runtime environment.
|
||||
[Jetty](https://www.eclipse.org/jetty/) is included as an HTTP server.
|
||||
|
||||
openHAB is highly modular software that can be extended through "Add-ons".
|
||||
|
|
|
@ -5,11 +5,11 @@ title: openhab-docs Markdown StyleGuide
|
|||
|
||||
{% include base.html %}
|
||||
|
||||
# openHAB Documentation Style Guide
|
||||
# openHAB Documentation Style Guide
|
||||
|
||||
## General Remarks
|
||||
|
||||
First and foremost we are following the recommendations given at: [http://www.cirosantilli.com/markdown-style-guide/](http://www.cirosantilli.com/markdown-style-guide/).
|
||||
First and foremost we are following the recommendations given at: [https://www.cirosantilli.com/markdown-style-guide/](https://www.cirosantilli.com/markdown-style-guide/).
|
||||
|
||||
## Markdown Decisions
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ Instead, it's publishing metrics regularly in a simple JSON structure like the f
|
|||
## Prerequisites
|
||||
- A basic understanding of how MQTT works (HiveMQ provides a good [tutorial](https://www.hivemq.com/blog/mqtt-essentials-part-3-client-broker-connection-establishment/)
|
||||
- An installed and configured MQTT Broker (e.g. Mosquitto which can be installed through openHABian if that is how you installed openHAB)
|
||||
- A MiFlora device configured to connect to the MQTT Broker, or an MQTT client application (e.g. [MQTT Explorer](http://mqtt-explorer.com/), [MQTT.fx](http://mqttfx.org/) that allows one to publish and subscribe to MQTT topics
|
||||
- A MiFlora device configured to connect to the MQTT Broker, or an MQTT client application (e.g. [MQTT Explorer](https://mqtt-explorer.com/), [MQTT.fx](http://mqttfx.org/) that allows one to publish and subscribe to MQTT topics
|
||||
|
||||
## Install the Binding and Transformation
|
||||
This device publishes JSON formatted messages so we need to install an add-on that can process JSON: the JSONPath Transformation.
|
||||
|
|