Apply bulk automated corrections. 🔧(#1433)
Signed-off-by: Jerome Luckenbach <github@luckenba.ch>pull/1436/head
parent
e879ad83b3
commit
d509fe56d6
|
@ -3,5 +3,6 @@
|
||||||
"MD004": { "style": "dash" },
|
"MD004": { "style": "dash" },
|
||||||
"MD013": false,
|
"MD013": false,
|
||||||
"MD025": false,
|
"MD025": false,
|
||||||
"MD029": { "style": "one" }
|
"MD029": { "style": "one" },
|
||||||
|
"MD041": false
|
||||||
}
|
}
|
|
@ -106,6 +106,7 @@ All HTTP Actions can have a last `timeout` parameter added in ms. eg. `sendHttpP
|
||||||
:::
|
:::
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
val headers = newHashMap("Cache-control" -> "no-cache")
|
val headers = newHashMap("Cache-control" -> "no-cache")
|
||||||
val output = sendHttpGetRequest("https://example.com/?id=1", headers, 1000)
|
val output = sendHttpGetRequest("https://example.com/?id=1", headers, 1000)
|
||||||
|
@ -158,6 +159,7 @@ if ((thingStatusInfo !== null) && (thingStatusInfo.getStatus().toString() == "ON
|
||||||
```
|
```
|
||||||
|
|
||||||
### openHAB Subsystem Actions
|
### openHAB Subsystem Actions
|
||||||
|
|
||||||
openHAB has several subsystems that can be accessed from Rules. These include persistence, see [Persistence Extensions in Scripts and Rules]({{base}}/configuration/persistence.html#persistence-extensions-in-scripts-and-rules), transformations, scripts.
|
openHAB has several subsystems that can be accessed from Rules. These include persistence, see [Persistence Extensions in Scripts and Rules]({{base}}/configuration/persistence.html#persistence-extensions-in-scripts-and-rules), transformations, scripts.
|
||||||
|
|
||||||
- `callScript(String scriptName)`: Calls a script which must be located in the `$OPENHAB_CONF/scripts` folder.
|
- `callScript(String scriptName)`: Calls a script which must be located in the `$OPENHAB_CONF/scripts` folder.
|
||||||
|
@ -182,6 +184,7 @@ Three different actions are available:
|
||||||
- `sendLogNotification(message)`: Sends a log notification to the `notifications` list at your openHAB Cloud instance. Notifications are NOT sent to any registered devices
|
- `sendLogNotification(message)`: Sends a log notification to the `notifications` list at your openHAB Cloud instance. Notifications are NOT sent to any registered devices
|
||||||
|
|
||||||
For each of the three actions, there's another variant accepting an icon name and a severity:
|
For each of the three actions, there's another variant accepting an icon name and a severity:
|
||||||
|
|
||||||
- `sendNotification(emailAddress, message, icon, severity)`
|
- `sendNotification(emailAddress, message, icon, severity)`
|
||||||
- `sendBroadcastNotification(message, icon, severity)`
|
- `sendBroadcastNotification(message, icon, severity)`
|
||||||
- `sendLogNotification(message, icon, severity)`
|
- `sendLogNotification(message, icon, severity)`
|
||||||
|
@ -189,6 +192,7 @@ For each of the three actions, there's another variant accepting an icon name an
|
||||||
Icon and severity can potentially be used by cloud instance clients (such as the openHAB apps for Android or iOS) to be displayed in the list of notifications.
|
Icon and severity can potentially be used by cloud instance clients (such as the openHAB apps for Android or iOS) to be displayed in the list of notifications.
|
||||||
|
|
||||||
The parameters for these actions have the following meaning:
|
The parameters for these actions have the following meaning:
|
||||||
|
|
||||||
- `emailAddress`: String containing the email address the target user is registered with in the cloud instance
|
- `emailAddress`: String containing the email address the target user is registered with in the cloud instance
|
||||||
- `message`: String containing the notification message text
|
- `message`: String containing the notification message text
|
||||||
- `icon`: String containing the icon name (as described in [Items]({{base}}/configuration/items.html#icons))
|
- `icon`: String containing the icon name (as described in [Items]({{base}}/configuration/items.html#icons))
|
||||||
|
@ -294,6 +298,7 @@ dayset-workday=[MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY]
|
||||||
dayset-weekend=[SATURDAY,SUNDAY]
|
dayset-weekend=[SATURDAY,SUNDAY]
|
||||||
dayset-trash=[MONDAY]
|
dayset-trash=[MONDAY]
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Custom Bank Holidays
|
#### Custom Bank Holidays
|
||||||
|
|
||||||
In addition to the ability to define custom daysets, one can define a custom list of holidays or other important days.
|
In addition to the ability to define custom daysets, one can define a custom list of holidays or other important days.
|
||||||
|
@ -314,6 +319,7 @@ The following is an example listing a few custom days.
|
||||||
</tns:Holidays>
|
</tns:Holidays>
|
||||||
</tns:Configuration>
|
</tns:Configuration>
|
||||||
```
|
```
|
||||||
|
|
||||||
For further examples and to find the list of elements to reference holidays that require more complicated calculations (e.g. holidays based on a lunar calendar, Easter, etc.) see the [XSD that defines the structures of the XML](https://github.com/svendiedrichsen/jollyday/blob/b78fa20e75d48bdf14e3fa8107befe44e3bacf3a/src/main/xsd/Holiday.xsd) or the XML file for your country or others.
|
For further examples and to find the list of elements to reference holidays that require more complicated calculations (e.g. holidays based on a lunar calendar, Easter, etc.) see the [XSD that defines the structures of the XML](https://github.com/svendiedrichsen/jollyday/blob/b78fa20e75d48bdf14e3fa8107befe44e3bacf3a/src/main/xsd/Holiday.xsd) or the XML file for your country or others.
|
||||||
|
|
||||||
You can place these XML files anywhere on your file system that openHAB has permission to read.
|
You can place these XML files anywhere on your file system that openHAB has permission to read.
|
||||||
|
|
|
@ -99,7 +99,6 @@ binding = astro,mqtt1,network
|
||||||
|
|
||||||
After saving the file, the add-on will be installed.
|
After saving the file, the add-on will be installed.
|
||||||
|
|
||||||
|
|
||||||
### Through manually provided add-ons
|
### Through manually provided add-ons
|
||||||
|
|
||||||
> Attention:
|
> Attention:
|
||||||
|
|
|
@ -23,7 +23,7 @@ The relevant transformation service needs to be installed via the paperUI before
|
||||||
Be aware, that some Transformation services rely on transformation files, while others work by directly providing the transformation logic.
|
Be aware, that some Transformation services rely on transformation files, while others work by directly providing the transformation logic.
|
||||||
Transformation files need to be placed in the directory `$OPENHAB_CONF/transform`.
|
Transformation files need to be placed in the directory `$OPENHAB_CONF/transform`.
|
||||||
|
|
||||||
1. Item and Sitemap Labels
|
1. Item and Sitemap Labels
|
||||||
|
|
||||||
Transformations used in the [state/value part]({{base}}/configuration/items.html#state-transformations) of labels are applied **on the fly**.
|
Transformations used in the [state/value part]({{base}}/configuration/items.html#state-transformations) of labels are applied **on the fly**.
|
||||||
While the **transformed value** will (for example) be visible on a Sitemap, the **original value** is stored in the Item.
|
While the **transformed value** will (for example) be visible on a Sitemap, the **original value** is stored in the Item.
|
||||||
|
|
|
@ -148,7 +148,7 @@ To add custom parameters or overwrite the default values, you can change the con
|
||||||
### Changing the Password
|
### Changing the Password
|
||||||
|
|
||||||
The password is stored in the file `users.properties`, located in the `etc` directory as [mentioned above](#console-settings-files-and-directories).
|
The password is stored in the file `users.properties`, located in the `etc` directory as [mentioned above](#console-settings-files-and-directories).
|
||||||
By default, the line with the password contains the text `openhab = `, followed by the current password (e.g. `habopen`) or a password hash (e.g. `{CRYPT}4AE1A0FD...{CRYPT}`).
|
By default, the line with the password contains the text `openhab =`, followed by the current password (e.g. `habopen`) or a password hash (e.g. `{CRYPT}4AE1A0FD...{CRYPT}`).
|
||||||
|
|
||||||
To change the authentication password edit the file manually, replacing the password or password hash (including `{CRYPT}`) with your new password in clear text.
|
To change the authentication password edit the file manually, replacing the password or password hash (including `{CRYPT}`) with your new password in clear text.
|
||||||
Alternately, run the following Linux shell command, which will perform the replacement for you.
|
Alternately, run the following Linux shell command, which will perform the replacement for you.
|
||||||
|
@ -180,7 +180,6 @@ To enable binding to all interfaces, uncomment the line
|
||||||
|
|
||||||
in `services/runtime.cfg`.
|
in `services/runtime.cfg`.
|
||||||
|
|
||||||
|
|
||||||
### Change the Port Number
|
### Change the Port Number
|
||||||
|
|
||||||
The SSH port configuration is done through the file `org.apache.karaf.shell.cfg`, located in the `etc` directory as [mentioned above](#console-settings-files-and-directories).
|
The SSH port configuration is done through the file `org.apache.karaf.shell.cfg`, located in the `etc` directory as [mentioned above](#console-settings-files-and-directories).
|
||||||
|
|
|
@ -18,7 +18,6 @@ It is possible to query and even change the state of entities like items or thin
|
||||||
Some of the described commands are executed on the internal database and could break your installation. Please use this functionality only if you know what you are doing!
|
Some of the described commands are executed on the internal database and could break your installation. Please use this functionality only if you know what you are doing!
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
Query an item's state:
|
Query an item's state:
|
||||||
|
|
|
@ -12,7 +12,6 @@ Join today and find answers for all details of openHAB:
|
||||||
|
|
||||||
* [community.openhab.org](https://community.openhab.org)
|
* [community.openhab.org](https://community.openhab.org)
|
||||||
|
|
||||||
|
|
||||||
# FAQs - Frequently Asked Questions
|
# FAQs - Frequently Asked Questions
|
||||||
|
|
||||||
In the community forum you'll also find a list of recurring questions with short answers, commonly known as FAQs.
|
In the community forum you'll also find a list of recurring questions with short answers, commonly known as FAQs.
|
||||||
|
|
|
@ -33,7 +33,6 @@ A typical example of a bridge is an IP gateway for some non-IP based home automa
|
||||||
|
|
||||||
As many Things can be automatically discovered, there are special mechanisms available that deal with the handling of [automatically discovered Things](discovery.html).
|
As many Things can be automatically discovered, there are special mechanisms available that deal with the handling of [automatically discovered Things](discovery.html).
|
||||||
|
|
||||||
|
|
||||||
## Thing Status
|
## Thing Status
|
||||||
|
|
||||||
Each Thing has a status object, which helps to identify possible problems with the device or service.
|
Each Thing has a status object, which helps to identify possible problems with the device or service.
|
||||||
|
@ -93,4 +92,3 @@ The following table lists the different status details for each status:
|
||||||
<tr valign="top"><td>REMOVING</td> <td>NONE</td><td>No further status details available.</td></tr>
|
<tr valign="top"><td>REMOVING</td> <td>NONE</td><td>No further status details available.</td></tr>
|
||||||
<tr valign="top"><td>REMOVED</td> <td>NONE</td><td>No further status details available.</td></tr>
|
<tr valign="top"><td>REMOVED</td> <td>NONE</td><td>No further status details available.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,6 @@ The placeholder `%unit%` can be placed anywhere in the state description.
|
||||||
|
|
||||||
In order to match `NumberItems` and Channels and define a default state description with unit placeholder the Channel also has to provide an Item type which includes the dimension information:
|
In order to match `NumberItems` and Channels and define a default state description with unit placeholder the Channel also has to provide an Item type which includes the dimension information:
|
||||||
|
|
||||||
|
|
||||||
<channel-type id="temperature">
|
<channel-type id="temperature">
|
||||||
<item-type>Number:Temperature</item-type>
|
<item-type>Number:Temperature</item-type>
|
||||||
<label>Temperature</label>
|
<label>Temperature</label>
|
||||||
|
@ -80,7 +79,6 @@ The `org.openhab.core.library.dimension` and `javax.measure.quantity` packages p
|
||||||
|
|
||||||
All units which are currently supported by default are listed in the tables below.
|
All units which are currently supported by default are listed in the tables below.
|
||||||
|
|
||||||
|
|
||||||
Imperial (base unit symbols):
|
Imperial (base unit symbols):
|
||||||
|
|
||||||
| Type | Unit | Symbol |
|
| Type | Unit | Symbol |
|
||||||
|
@ -213,6 +211,7 @@ Binary Prefixes:
|
||||||
| Yobi | Yi | 2⁸⁰ |
|
| Yobi | Yi | 2⁸⁰ |
|
||||||
|
|
||||||
To use the prefixes simply add the prefix to the unit symbol - for example:
|
To use the prefixes simply add the prefix to the unit symbol - for example:
|
||||||
|
|
||||||
* milliAmpere - `mA`
|
* milliAmpere - `mA`
|
||||||
* centiMetre - `cm`
|
* centiMetre - `cm`
|
||||||
* kiloWatt - `kW`
|
* kiloWatt - `kW`
|
||||||
|
|
|
@ -72,7 +72,6 @@ binding = astro,network
|
||||||
|
|
||||||
After saving the file, the add-on will be installed.
|
After saving the file, the add-on will be installed.
|
||||||
|
|
||||||
|
|
||||||
## Through manually provided add-ons
|
## Through manually provided add-ons
|
||||||
|
|
||||||
::: warning Attention
|
::: warning Attention
|
||||||
|
|
|
@ -27,6 +27,7 @@ If you are using [openHABian]({{base}}/installation/openhabian.html), the networ
|
||||||
*Attention Windows users:* Directly accessing network shares (UNC paths) is often not supported. Please be sure to mount the network share to a drive letter.
|
*Attention Windows users:* Directly accessing network shares (UNC paths) is often not supported. Please be sure to mount the network share to a drive letter.
|
||||||
|
|
||||||
{: #openhab-vscode}
|
{: #openhab-vscode}
|
||||||
|
|
||||||
## openHAB VS Code Extension
|
## openHAB VS Code Extension
|
||||||
|
|
||||||
openHAB VS Code is an extension for the [Visual Studio Code](https://code.visualstudio.com) editor.
|
openHAB VS Code is an extension for the [Visual Studio Code](https://code.visualstudio.com) editor.
|
||||||
|
@ -50,6 +51,7 @@ The validation needs a running openHAB installation in your environment and can
|
||||||
You can find all important information in the extensions [readme file](https://github.com/openhab/openhab-vscode#validating-the-rules).
|
You can find all important information in the extensions [readme file](https://github.com/openhab/openhab-vscode#validating-the-rules).
|
||||||
|
|
||||||
{: #others}
|
{: #others}
|
||||||
|
|
||||||
## Other Editor Integrations
|
## Other Editor Integrations
|
||||||
|
|
||||||
The here summarized projects provide syntax highlighting for different text editors, but have no _on top_ functionality.
|
The here summarized projects provide syntax highlighting for different text editors, but have no _on top_ functionality.
|
||||||
|
@ -60,6 +62,7 @@ mcedit is an editor which comes with mc (Midnight Commander).
|
||||||
You can find the syntax files and installation instructions on [openhab-mcedit](https://github.com/CWempe/openhab-mcedit).
|
You can find the syntax files and installation instructions on [openhab-mcedit](https://github.com/CWempe/openhab-mcedit).
|
||||||
|
|
||||||
{: #notepadpp}
|
{: #notepadpp}
|
||||||
|
|
||||||
### Notepad++
|
### Notepad++
|
||||||
|
|
||||||
Notepad++ is a free source code editor for Windows.
|
Notepad++ is a free source code editor for Windows.
|
||||||
|
@ -85,4 +88,3 @@ You can find the syntax file and installation instructions on [openhab-syntax-te
|
||||||
|
|
||||||
BBEdit is a text and code editor for macOS and the offical successor of TextWrangler.
|
BBEdit is a text and code editor for macOS and the offical successor of TextWrangler.
|
||||||
You can find the syntax file and installation instructions on [BBEdit-openHAB-language](https://github.com/mjmeijer/BBEdit-openHAB-language).
|
You can find the syntax file and installation instructions on [BBEdit-openHAB-language](https://github.com/mjmeijer/BBEdit-openHAB-language).
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ HABPanel uses service configuration variables to store its data on the openHAB s
|
||||||
openhab> config:edit org.openhab.habpanel
|
openhab> config:edit org.openhab.habpanel
|
||||||
openhab> config:property-get <property>
|
openhab> config:property-get <property>
|
||||||
```
|
```
|
||||||
|
|
||||||
The following properties are defined:
|
The following properties are defined:
|
||||||
|
|
||||||
- `panelsRegistry`: contains the entire registry serialized in JSON, it is maintained by the application and shouldn't be modified directly (editing it by hand, while possible, is strongly discouraged);
|
- `panelsRegistry`: contains the entire registry serialized in JSON, it is maintained by the application and shouldn't be modified directly (editing it by hand, while possible, is strongly discouraged);
|
||||||
|
@ -58,6 +59,7 @@ Use the gears icon in the top-right corner to switch between the two modes.
|
||||||

|

|
||||||
|
|
||||||
When in edit mode, several features are available:
|
When in edit mode, several features are available:
|
||||||
|
|
||||||
* Add a new empty dashboard with the **Add new dashboard** link;
|
* Add a new empty dashboard with the **Add new dashboard** link;
|
||||||
* Go to the settings screen (for instance, to switch from local storage to a server-managed panel configuration) by clicking on the **Advanced settings** link;
|
* Go to the settings screen (for instance, to switch from local storage to a server-managed panel configuration) by clicking on the **Advanced settings** link;
|
||||||
* Adjust the number of columns for the grid of main menu tiles with the slider, from 1 (the default) to 6;
|
* Adjust the number of columns for the grid of main menu tiles with the slider, from 1 (the default) to 6;
|
||||||
|
@ -126,6 +128,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.
|
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 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](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 **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 **refresh** button forces HABPanel to retrieve the current state of all items;
|
||||||
- the **fullscreen** button tells the browser to go fullscreen, if supported.
|
- the **fullscreen** button tells the browser to go fullscreen, if supported.
|
||||||
|
@ -136,7 +139,6 @@ Tip: while running a dasboard, append `?kiosk=on` to the URL in the web browser
|
||||||
|
|
||||||
Apart from the storage configuration discussed above, the settings screen contains several settings kept as part of the panel configuration (meaning they are set separately):
|
Apart from the storage configuration discussed above, the settings screen contains several settings kept as part of the panel configuration (meaning they are set separately):
|
||||||
|
|
||||||
|
|
||||||
| Setting | Description |
|
| Setting | Description |
|
||||||
|------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| Panel name | An user-friendly name for the panel. It will be displayed in the header of the side drawer. |
|
| Panel name | An user-friendly name for the panel. It will be displayed in the header of the side drawer. |
|
||||||
|
@ -157,7 +159,6 @@ Apart from the storage configuration discussed above, the settings screen contai
|
||||||
|
|
||||||
*Note: the text-to-speech functionality featured in HABPanel is unrelated to the [TTS services]({{base}}/configuration/multimedia.html#text-to-speech) defined on the openHAB server, and they are not compatible (this is why a String item is required and the `say()` function cannot be used). However, HABPanel will play audio streamed through the ['webaudio' sink]({{base}}/configuration/multimedia.html#audio), including spoken text.
|
*Note: the text-to-speech functionality featured in HABPanel is unrelated to the [TTS services]({{base}}/configuration/multimedia.html#text-to-speech) defined on the openHAB server, and they are not compatible (this is why a String item is required and the `say()` function cannot be used). However, HABPanel will play audio streamed through the ['webaudio' sink]({{base}}/configuration/multimedia.html#audio), including spoken text.
|
||||||
|
|
||||||
|
|
||||||
## Widgets
|
## Widgets
|
||||||
|
|
||||||
### Standard widgets
|
### Standard widgets
|
||||||
|
|
|
@ -86,7 +86,7 @@ _Note there is an option in Main UI to bulk create Items where you can copy'n'pa
|
||||||
<td>✔️</td>
|
<td>✔️</td>
|
||||||
<td>❌</td>
|
<td>❌</td>
|
||||||
<td>❌</td>
|
<td>❌</td>
|
||||||
<td>transform/*.map *.js files</td>
|
<td>transform/*.map*.js files</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Define Persistence</td>
|
<td>Define Persistence</td>
|
||||||
|
@ -168,4 +168,3 @@ 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.
|
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).
|
* 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.
|
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.
|
||||||
|
|
||||||
|
|
|
@ -32,9 +32,9 @@ For example, an Item bound to a sensor receives updated sensor readings and an I
|
||||||
|
|
||||||
There are two methods for defining Items:
|
There are two methods for defining Items:
|
||||||
|
|
||||||
1. Through UI
|
1. Through UI
|
||||||
|
|
||||||
2. Through text `.items` files located in the `$OPENHAB_CONF/items` folder.
|
2. Through text `.items` files located in the `$OPENHAB_CONF/items` folder.
|
||||||
Files here must have the extension `.items`; you may create as many `.items` files as needed.
|
Files here must have the extension `.items`; you may create as many `.items` files as needed.
|
||||||
However, each Item must be unique across all `.items` files.
|
However, each Item must be unique across all `.items` files.
|
||||||
Refer to the [installation docs]({{base}}/installation/index.html) to determine your specific installation's folder structure.
|
Refer to the [installation docs]({{base}}/installation/index.html) to determine your specific installation's folder structure.
|
||||||
|
@ -51,6 +51,7 @@ It's recommended to edit `.items` files using one of the [openHAB supporting edi
|
||||||
Doing so will provide you with full IDE support including features such as syntax checking, and context assistance.
|
Doing so will provide you with full IDE support including features such as syntax checking, and context assistance.
|
||||||
|
|
||||||
{: #syntax}
|
{: #syntax}
|
||||||
|
|
||||||
## Item Definition and Syntax
|
## Item Definition and Syntax
|
||||||
|
|
||||||
Items are defined using the following syntax:
|
Items are defined using the following syntax:
|
||||||
|
@ -89,6 +90,7 @@ The last example above defines an Item with the following fields:
|
||||||
The remainder of this article provides additional information regarding Item definition fields.
|
The remainder of this article provides additional information regarding Item definition fields.
|
||||||
|
|
||||||
{: #type}
|
{: #type}
|
||||||
|
|
||||||
### Type
|
### Type
|
||||||
|
|
||||||
The Item type defines what kind of state can be stored in that Item and which commands the Item will accept.
|
The Item type defines what kind of state can be stored in that Item and which commands the Item will accept.
|
||||||
|
@ -145,6 +147,7 @@ In the example above, if you move the Slider widget to 60%, move the Switch to O
|
||||||
-->
|
-->
|
||||||
|
|
||||||
{: #name}
|
{: #name}
|
||||||
|
|
||||||
### Name
|
### Name
|
||||||
|
|
||||||
The Item name is used to uniquely identify an Item.
|
The Item name is used to uniquely identify an Item.
|
||||||
|
@ -164,13 +167,13 @@ An Item naming scheme with a physical or logical top-down will ensure you can ea
|
||||||
|
|
||||||
The following naming style guide is recommended:
|
The following naming style guide is recommended:
|
||||||
|
|
||||||
- Words build a physical or logical hierarchy
|
- Words build a physical or logical hierarchy
|
||||||
|
|
||||||
- Every word of the Item name starts with an uppercase letter
|
- Every word of the Item name starts with an uppercase letter
|
||||||
|
|
||||||
- Words should be separated by an underscore character, except for words that logically belong together
|
- Words should be separated by an underscore character, except for words that logically belong together
|
||||||
|
|
||||||
- Names that reoccur frequently, such as the names of rooms or appliances, may be abbreviated to reduce overall name length.
|
- Names that reoccur frequently, such as the names of rooms or appliances, may be abbreviated to reduce overall name length.
|
||||||
(Example: Bathroom = BR)
|
(Example: Bathroom = BR)
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
@ -187,9 +190,9 @@ Examples:
|
||||||
Users are encouraged to apply the style guide above to group names as well as Item names.
|
Users are encouraged to apply the style guide above to group names as well as Item names.
|
||||||
Two naming schemes are established in the community for Group names:
|
Two naming schemes are established in the community for Group names:
|
||||||
|
|
||||||
1. Use a plural word form (e.g. Batteries) where possible.
|
1. Use a plural word form (e.g. Batteries) where possible.
|
||||||
Otherwise the word "Group" may be appended for clarity.
|
Otherwise the word "Group" may be appended for clarity.
|
||||||
2. Prepend a lowercase "g" to the name (e.g. gBattery)
|
2. Prepend a lowercase "g" to the name (e.g. gBattery)
|
||||||
|
|
||||||
| Group Name | Interpretation |
|
| Group Name | Interpretation |
|
||||||
|-------------------------------------------|-----------------------------------------------------------------------|
|
|-------------------------------------------|-----------------------------------------------------------------------|
|
||||||
|
@ -199,6 +202,7 @@ Two naming schemes are established in the community for Group names:
|
||||||
| "`Livingroom`" or "`gLR`" | Group for *all* Items (including lights) belonging to the living room |
|
| "`Livingroom`" or "`gLR`" | Group for *all* Items (including lights) belonging to the living room |
|
||||||
|
|
||||||
{: #label}
|
{: #label}
|
||||||
|
|
||||||
### Label
|
### Label
|
||||||
|
|
||||||
Label text is used to describe an Item in a human-readable way.
|
Label text is used to describe an Item in a human-readable way.
|
||||||
|
@ -215,28 +219,31 @@ Number Livingroom_Temperature "Temperature [%.1f °C]"
|
||||||
Channel labels can be overwritten by Item definitions and Item labels can be overwritten in [Sitemaps]({{base}}/configuration/sitemaps.html#element-types).
|
Channel labels can be overwritten by Item definitions and Item labels can be overwritten in [Sitemaps]({{base}}/configuration/sitemaps.html#element-types).
|
||||||
|
|
||||||
{: #state}
|
{: #state}
|
||||||
|
|
||||||
### State
|
### State
|
||||||
|
|
||||||
The state of an Item depends on the Item type, the Channel bound to the Item, and internal or external events.
|
The state of an Item depends on the Item type, the Channel bound to the Item, and internal or external events.
|
||||||
A analogy can be drawn between the state of an Item and the value of a variable in a computer program.
|
A analogy can be drawn between the state of an Item and the value of a variable in a computer program.
|
||||||
|
|
||||||
{: #item-state}
|
{: #item-state}
|
||||||
|
|
||||||
#### Item State
|
#### Item State
|
||||||
|
|
||||||
This section provides information about what a user can expect regarding the behavior of the state of an Item.
|
This section provides information about what a user can expect regarding the behavior of the state of an Item.
|
||||||
|
|
||||||
- Items are created with a state of `NULL`
|
- Items are created with a state of `NULL`
|
||||||
|
|
||||||
- Operations in openHAB such as a user interacting with the Item using the Basic UI, or a Binding updating the state of an Item will change the state of the Item
|
- Operations in openHAB such as a user interacting with the Item using the Basic UI, or a Binding updating the state of an Item will change the state of the Item
|
||||||
|
|
||||||
- An Item's state may also be set through a Binding which may be reacting to changes in the real world
|
- An Item's state may also be set through a Binding which may be reacting to changes in the real world
|
||||||
|
|
||||||
- A Binding may set the state of an Item to `UNDEF` if it looses communications with a Thing (for example, a Z-wave doorbell with a dead battery).
|
- A Binding may set the state of an Item to `UNDEF` if it looses communications with a Thing (for example, a Z-wave doorbell with a dead battery).
|
||||||
The Binding may also set the state to `UNDEF` if an error exists in the binding configuration, or under other conditions
|
The Binding may also set the state to `UNDEF` if an error exists in the binding configuration, or under other conditions
|
||||||
|
|
||||||
*N.B.* Many openHAB users find that it can be very useful to use [Persistence](/addons/#persistence) and [System started]({{base}}/configuration/rules-dsl.html#system-based-triggers) rules so that their systems behaves in a predictable way after an openHAB restart.
|
*N.B.* Many openHAB users find that it can be very useful to use [Persistence](/addons/#persistence) and [System started]({{base}}/configuration/rules-dsl.html#system-based-triggers) rules so that their systems behaves in a predictable way after an openHAB restart.
|
||||||
|
|
||||||
{: #command-vs-status}
|
{: #command-vs-status}
|
||||||
|
|
||||||
#### Command vs. Status
|
#### Command vs. Status
|
||||||
|
|
||||||
Users should bear in mind the difference between an Item used to send a command to a Thing, and an Item that reflects the status of a real-world Thing in the UI.
|
Users should bear in mind the difference between an Item used to send a command to a Thing, and an Item that reflects the status of a real-world Thing in the UI.
|
||||||
|
@ -258,6 +265,7 @@ Then you add the light-level Item to your UI.
|
||||||
Now when you send the Switch Item command, and you see a corresponding increase in light level in the room, you know for sure that your command has been received and acted upon, because you have a return status Item in your UI.
|
Now when you send the Switch Item command, and you see a corresponding increase in light level in the room, you know for sure that your command has been received and acted upon, because you have a return status Item in your UI.
|
||||||
|
|
||||||
{: #state-presentation}
|
{: #state-presentation}
|
||||||
|
|
||||||
#### State Presentation
|
#### State Presentation
|
||||||
|
|
||||||
The Item definition determines the Item's textual state presentation, e.g., regarding formatting, decimal places, unit display and more.
|
The Item definition determines the Item's textual state presentation, e.g., regarding formatting, decimal places, unit display and more.
|
||||||
|
@ -286,6 +294,7 @@ Location My_Location "My Location [%2$s°N %3$s°E %1$sm]" // e.g.
|
||||||
```
|
```
|
||||||
|
|
||||||
{: #state-transformation}
|
{: #state-transformation}
|
||||||
|
|
||||||
#### State Transformation
|
#### State Transformation
|
||||||
|
|
||||||
Transformations can be used in the state part of an Item, to translate the raw state of an Item into another language, or to convert technical values into human readable information.
|
Transformations can be used in the state part of an Item, to translate the raw state of an Item into another language, or to convert technical values into human readable information.
|
||||||
|
@ -299,6 +308,7 @@ Contact Livingroom_Window "Ventana del salón [MAP(window_esp.map):%s]"
|
||||||
Please refer to the article on [Transformations](/docs/configuration/transformations.html) for more usage details and a list of available transformation services.
|
Please refer to the article on [Transformations](/docs/configuration/transformations.html) for more usage details and a list of available transformation services.
|
||||||
|
|
||||||
{: #icons}
|
{: #icons}
|
||||||
|
|
||||||
### Icons
|
### Icons
|
||||||
|
|
||||||
The icon name is used by openHAB to select the image to display next to an Item name when using one of openHAB's UIs, e.g. Basic UI.
|
The icon name is used by openHAB to select the image to display next to an Item name when using one of openHAB's UIs, e.g. Basic UI.
|
||||||
|
@ -332,6 +342,7 @@ Note that image files with the wrong file ending will be ignored.
|
||||||
Users may substitute their own icon for an icon from the default icon set by placing a file in the `$OPENHAB_CONF/icons/classic/` folder with the same filename as the name of the icon being substituted.
|
Users may substitute their own icon for an icon from the default icon set by placing a file in the `$OPENHAB_CONF/icons/classic/` folder with the same filename as the name of the icon being substituted.
|
||||||
|
|
||||||
{: #icons-dynamic}
|
{: #icons-dynamic}
|
||||||
|
|
||||||
#### Dynamic Icons
|
#### Dynamic Icons
|
||||||
|
|
||||||
Some icons are dynamically selected by openHAB depending on the Item's state.
|
Some icons are dynamically selected by openHAB depending on the Item's state.
|
||||||
|
@ -353,15 +364,15 @@ Dynamic icon filenames follow the pattern below:
|
||||||
Dynamic icon sets may consist of as many state-specific icon files as needed.
|
Dynamic icon sets may consist of as many state-specific icon files as needed.
|
||||||
Each set must meet the following criteria:
|
Each set must meet the following criteria:
|
||||||
|
|
||||||
- A default icon is mandatory.
|
- A default icon is mandatory.
|
||||||
The default icon filename is the name of the icon without a hyphen or state (e.g. `switch.svg`)
|
The default icon filename is the name of the icon without a hyphen or state (e.g. `switch.svg`)
|
||||||
|
|
||||||
- Icon filenames must follow the naming restrictions given for [icons](#icons) above
|
- Icon filenames must follow the naming restrictions given for [icons](#icons) above
|
||||||
|
|
||||||
- The state name must reflect the Item's raw state.
|
- The state name must reflect the Item's raw state.
|
||||||
[Transformations](#state-transformation) applied in the state presentation definition of the Item have no influence on icon selection.
|
[Transformations](#state-transformation) applied in the state presentation definition of the Item have no influence on icon selection.
|
||||||
|
|
||||||
- The state portion of the icon name must be in lowercase letters
|
- The state portion of the icon name must be in lowercase letters
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
|
@ -403,6 +414,7 @@ For a dimmable light (0-100%), you might provide icons as in the example:
|
||||||
Just as with regular icons, user-defined dynamic icon sets may be configured via the custom icons folder `$OPENHAB_CONF/icons/classic/`.
|
Just as with regular icons, user-defined dynamic icon sets may be configured via the custom icons folder `$OPENHAB_CONF/icons/classic/`.
|
||||||
|
|
||||||
{: #groups}
|
{: #groups}
|
||||||
|
|
||||||
### Groups
|
### Groups
|
||||||
|
|
||||||
The Group is a special Item type that can be used to define a category or collection into which you can combine other Items or Groups.
|
The Group is a special Item type that can be used to define a category or collection into which you can combine other Items or Groups.
|
||||||
|
@ -416,12 +428,12 @@ Group groupname ["labeltext"] [<iconname>] [(group1, group2, ...)]
|
||||||
The Group item is commonly used to define hierarchies of Items from different perspectives.
|
The Group item is commonly used to define hierarchies of Items from different perspectives.
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
- Location-oriented or physical perspective:
|
- Location-oriented or physical perspective:
|
||||||
- Floors in your house → Rooms on that floor → An appliance in that room...
|
- Floors in your house → Rooms on that floor → An appliance in that room...
|
||||||
|
|
||||||
- Functional or logical perspective:
|
- Functional or logical perspective:
|
||||||
- Maintenance Group → All battery states → Individual battery states in percentage
|
- Maintenance Group → All battery states → Individual battery states in percentage
|
||||||
- Further examples: all lights, all room temperatures, combined power consumption
|
- Further examples: all lights, all room temperatures, combined power consumption
|
||||||
|
|
||||||
These relationships can be exploited in [Sitemaps]({{base}}/configuration/sitemaps.html) or in [automation rules]({{base}}/configuration/rules-dsl.html) to navigate through the hierarchically organized Items or to perform computations and updates on subsets of similar Items.
|
These relationships can be exploited in [Sitemaps]({{base}}/configuration/sitemaps.html) or in [automation rules]({{base}}/configuration/rules-dsl.html) to navigate through the hierarchically organized Items or to perform computations and updates on subsets of similar Items.
|
||||||
|
|
||||||
|
@ -455,6 +467,7 @@ Because of the hierarchical structure of your group items, the rule will be clea
|
||||||
Additionally, the rule will not need to be modified when a new Item is added to the `Temperatures` group.
|
Additionally, the rule will not need to be modified when a new Item is added to the `Temperatures` group.
|
||||||
|
|
||||||
{: #group-type}
|
{: #group-type}
|
||||||
|
|
||||||
### Derive Group State from Member Items
|
### Derive Group State from Member Items
|
||||||
|
|
||||||
As you are now aware, an Item can have a state (e.g. "ON", "OFF").
|
As you are now aware, an Item can have a state (e.g. "ON", "OFF").
|
||||||
|
@ -492,13 +505,13 @@ Incompatible Item types within a Group may result in the invalid aggregation res
|
||||||
Examples for derived states on Group Items when declared in the Item DSL:
|
Examples for derived states on Group Items when declared in the Item DSL:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
Group:Number Lights "Active Lights [%d]" // e.g. "2"
|
Group:Number Lights "Active Lights [%d]" // e.g. "2"
|
||||||
Group:Switch:OR(ON,OFF) Lights "Active Lights [%d]" // e.g. ON and "2"
|
Group:Switch:OR(ON,OFF) Lights "Active Lights [%d]" // e.g. ON and "2"
|
||||||
Group:Switch:AND(ON,OFF) Lights "Active Lights [%d]" // e.g. ON and "2"
|
Group:Switch:AND(ON,OFF) Lights "Active Lights [%d]" // e.g. ON and "2"
|
||||||
Group:Number:AVG Temperatures "All Room Temperatures [%.1f °C]" // e.g. "21.3 °C"
|
Group:Number:AVG Temperatures "All Room Temperatures [%.1f °C]" // e.g. "21.3 °C"
|
||||||
Group:DateTime:EARLIEST LatestUpdate "Latest Update [%1$tY.%1$tm.%1$tY %1$tH:%1$tM:%1$tS]"
|
Group:DateTime:EARLIEST LatestUpdate "Latest Update [%1$tY.%1$tm.%1$tY %1$tH:%1$tM:%1$tS]"
|
||||||
Group:DateTime:LATEST LastSeen "Last Seen [%1$tY.%1$tm.%1$tY %1$tH:%1$tM:%1$tS]"
|
Group:DateTime:LATEST LastSeen "Last Seen [%1$tY.%1$tm.%1$tY %1$tH:%1$tM:%1$tS]"
|
||||||
Group:String:COUNT("OFFLINE") OfflineDevices "Offline Devices [%d]" // e.g. "2"
|
Group:String:COUNT("OFFLINE") OfflineDevices "Offline Devices [%d]" // e.g. "2"
|
||||||
```
|
```
|
||||||
|
|
||||||
The first three examples above compute the number of active lights and store them as group state.
|
The first three examples above compute the number of active lights and store them as group state.
|
||||||
|
@ -518,6 +531,7 @@ The `EARLIEST` function returns `now().minusDays(10)`, the `LATEST` function ret
|
||||||
The last Group counts all members of it matching the given regular expression, here any character or state (simply counts all members).
|
The last Group counts all members of it matching the given regular expression, here any character or state (simply counts all members).
|
||||||
|
|
||||||
{: #tags}
|
{: #tags}
|
||||||
|
|
||||||
### Tags
|
### Tags
|
||||||
|
|
||||||
Tags added to an Item definition allow a user to characterize the specific nature of the Item beyond its basic Item type.
|
Tags added to an Item definition allow a user to characterize the specific nature of the Item beyond its basic Item type.
|
||||||
|
@ -538,6 +552,7 @@ Tags will be ignored if no Items in the openHAB installation support it.
|
||||||
See the [Hue Emulation Service](/addons/integrations/hueemulation/) or [HomeKit Add-on](/addons/integrations/homekit/) documentation for more details.
|
See the [Hue Emulation Service](/addons/integrations/hueemulation/) or [HomeKit Add-on](/addons/integrations/homekit/) documentation for more details.
|
||||||
|
|
||||||
{: #binding}
|
{: #binding}
|
||||||
|
|
||||||
### Binding Configuration
|
### Binding Configuration
|
||||||
|
|
||||||
One of the greatest strengths of an openHAB automation system is the sheer number of devices you can interact with.
|
One of the greatest strengths of an openHAB automation system is the sheer number of devices you can interact with.
|
||||||
|
@ -609,8 +624,8 @@ Switch Office_PC {channel="lgwebos:WebOSTV:01dd3ac4-62f4-7505-208b-12345679", ch
|
||||||
|
|
||||||
The first example shows a symbiosis of the LG webOS Binding and the Wake-on-LAN Binding to interact with a TV.
|
The first example shows a symbiosis of the LG webOS Binding and the Wake-on-LAN Binding to interact with a TV.
|
||||||
|
|
||||||
|
|
||||||
{: #autoupdate}
|
{: #autoupdate}
|
||||||
|
|
||||||
#### Parameter `autoupdate`
|
#### Parameter `autoupdate`
|
||||||
|
|
||||||
When left as default, openHAB's `autoupdate` function attempts to predict the outcome of a *command* on the Item *state*.
|
When left as default, openHAB's `autoupdate` function attempts to predict the outcome of a *command* on the Item *state*.
|
||||||
|
@ -626,6 +641,7 @@ Switch Garage_Gate {channel="xxx", autoupdate="false"}
|
||||||
```
|
```
|
||||||
|
|
||||||
{: #expire}
|
{: #expire}
|
||||||
|
|
||||||
#### Parameter `expire`
|
#### Parameter `expire`
|
||||||
|
|
||||||
This parameter allows to post an update or command to an item after a period of time has passed.
|
This parameter allows to post an update or command to an item after a period of time has passed.
|
||||||
|
@ -702,6 +718,7 @@ You have an Item called `Bedroom_Light` that is connected to a Hue lamp
|
||||||
```java
|
```java
|
||||||
Color Bedroom_Light { channel="hue:0210:1:bulb1:color" }
|
Color Bedroom_Light { channel="hue:0210:1:bulb1:color" }
|
||||||
```
|
```
|
||||||
|
|
||||||
and a [Rule]({{base}}/configuration/rules-dsl.html) to toggle this light with a serial button:
|
and a [Rule]({{base}}/configuration/rules-dsl.html) to toggle this light with a serial button:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
|
|
|
@ -30,6 +30,7 @@ New APIs are planned to be implemented in the future, which will provide standar
|
||||||
:::: tabs
|
:::: tabs
|
||||||
|
|
||||||
::: tab JavaScript
|
::: tab JavaScript
|
||||||
|
|
||||||
```js
|
```js
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
@ -54,10 +55,11 @@ sRule.setTriggers([
|
||||||
|
|
||||||
automationManager.addRule(sRule);
|
automationManager.addRule(sRule);
|
||||||
```
|
```
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
::: tab Jython
|
::: tab Jython
|
||||||
|
|
||||||
```python
|
```python
|
||||||
scriptExtension.importPreset("RuleSupport")
|
scriptExtension.importPreset("RuleSupport")
|
||||||
scriptExtension.importPreset("RuleSimple")
|
scriptExtension.importPreset("RuleSimple")
|
||||||
|
@ -79,9 +81,11 @@ sRule.setTriggers([
|
||||||
|
|
||||||
automationManager.addRule(sRule)
|
automationManager.addRule(sRule)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::: tab Groovy
|
::: tab Groovy
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
import org.openhab.core.automation.*
|
import org.openhab.core.automation.*
|
||||||
import org.openhab.core.automation.module.script.rulesupport.shared.simple.*
|
import org.openhab.core.automation.module.script.rulesupport.shared.simple.*
|
||||||
|
@ -105,6 +109,7 @@ sRule.setTriggers([
|
||||||
|
|
||||||
automationManager.addRule(sRule)
|
automationManager.addRule(sRule)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
::::
|
::::
|
||||||
|
|
|
@ -60,13 +60,13 @@ openhab> openhab:audio stream example.com
|
||||||
|
|
||||||
Alternatively the [`playSound()`](https://openhab.org/javadoc/latest/org/openhab/core/model/script/actions/audio#playSound(java.lang.String)) or [`playStream()`](https://openhab.org/javadoc/latest/org/openhab/core/model/script/actions/audio#playStream(java.lang.String)) functions can be used in DSL rules:
|
Alternatively the [`playSound()`](https://openhab.org/javadoc/latest/org/openhab/core/model/script/actions/audio#playSound(java.lang.String)) or [`playStream()`](https://openhab.org/javadoc/latest/org/openhab/core/model/script/actions/audio#playStream(java.lang.String)) functions can be used in DSL rules:
|
||||||
|
|
||||||
- `playSound(String filename)` : plays a sound from the sounds folder to the default sink
|
- `playSound(String filename)` : plays a sound from the sounds folder to the default sink
|
||||||
- `playSound(String filename, PercentType volume)` : plays a sound with the given volume from the sounds folder to the default sink
|
- `playSound(String filename, PercentType volume)` : plays a sound with the given volume from the sounds folder to the default sink
|
||||||
- `playSound(String sink, String filename)` : plays a sound from the sounds folder to the given sink(s)
|
- `playSound(String sink, String filename)` : plays a sound from the sounds folder to the given sink(s)
|
||||||
- `playSound(String sink, String filename, PercentType volume)` : plays a sound with the given volume from the sounds folder to the given sink(s)
|
- `playSound(String sink, String filename, PercentType volume)` : plays a sound with the given volume from the sounds folder to the given sink(s)
|
||||||
|
|
||||||
- `playStream(String url)` : plays an audio stream from an url to the default sink (set url to `null` if streaming should be stopped)
|
- `playStream(String url)` : plays an audio stream from an url to the default sink (set url to `null` if streaming should be stopped)
|
||||||
- `playStream(String sink, String url)` : plays an audio stream from an url to the given sink(s) (set url to `null` if streaming should be stopped)
|
- `playStream(String sink, String url)` : plays an audio stream from an url to the given sink(s) (set url to `null` if streaming should be stopped)
|
||||||
|
|
||||||
#### Examples
|
#### Examples
|
||||||
|
|
||||||
|
|
|
@ -10,15 +10,15 @@ title: Configuration though Paper UI
|
||||||
The Paper UI is a new interface that helps setting up and configuring your openHAB instance.
|
The Paper UI is a new interface that helps setting up and configuring your openHAB instance.
|
||||||
It does not (yet) cover all aspects, so you still need to resort to textual configuration files, but it already offers the following:
|
It does not (yet) cover all aspects, so you still need to resort to textual configuration files, but it already offers the following:
|
||||||
|
|
||||||
- Add-on management:
|
- Add-on management:
|
||||||
Easily install or uninstall openHAB add-ons
|
Easily install or uninstall openHAB add-ons
|
||||||

|

|
||||||
|
|
||||||
- Thing discovery:
|
- Thing discovery:
|
||||||
See devices and services found on your network and add them to your setup.
|
See devices and services found on your network and add them to your setup.
|
||||||

|

|
||||||
|
|
||||||
- Linking items to channels:
|
- Linking items to channels:
|
||||||
Instead of adding a binding configuration to your item file, you can directly link Thing channels to your items.
|
Instead of adding a binding configuration to your item file, you can directly link Thing channels to your items.
|
||||||

|

|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@ The following strategies are defined internally and may be used in place of `str
|
||||||
- `restoreOnStartup`: load and initialize the last persisted state of the Item on openHAB startup (if the Item state is undefined (`UNDEF`)).
|
- `restoreOnStartup`: load and initialize the last persisted state of the Item on openHAB startup (if the Item state is undefined (`UNDEF`)).
|
||||||
|
|
||||||
#### Cron Persistence Triggers
|
#### Cron Persistence Triggers
|
||||||
|
|
||||||
openHAB uses [Quartz](https://www.quartz-scheduler.org/documentation) for time-related cron events.
|
openHAB uses [Quartz](https://www.quartz-scheduler.org/documentation) for time-related cron events.
|
||||||
See the [Rules article]({{base}}/configuration/rules-dsl.html#time-based-triggers) for more information.
|
See the [Rules article]({{base}}/configuration/rules-dsl.html#time-based-triggers) for more information.
|
||||||
|
|
||||||
|
@ -151,8 +152,8 @@ Items {
|
||||||
item1, item2 : strategy = everyChange, restoreOnStartup
|
item1, item2 : strategy = everyChange, restoreOnStartup
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
It is usually not necessary to restore all Items since there is a good chance that they are no longer accurate (switches may have been toggled, sensor values are likely to have changed), and the restoration may result in unwanted rule actions.
|
|
||||||
|
|
||||||
|
It is usually not necessary to restore all Items since there is a good chance that they are no longer accurate (switches may have been toggled, sensor values are likely to have changed), and the restoration may result in unwanted rule actions.
|
||||||
|
|
||||||
## Persistence Extensions in Scripts and Rules
|
## Persistence Extensions in Scripts and Rules
|
||||||
|
|
||||||
|
|
|
@ -97,6 +97,7 @@ Stop openhab and add this part to ```$OPENHAB_USERDATA/etc/org.apache.karaf.feat
|
||||||
<feature>openhab-*-auth</feature>
|
<feature>openhab-*-auth</feature>
|
||||||
</blacklistedFeatures>
|
</blacklistedFeatures>
|
||||||
```
|
```
|
||||||
|
|
||||||
Once openhab is restarted authentication will be disabled.
|
Once openhab is restarted authentication will be disabled.
|
||||||
|
|
||||||
## Additional Considerations
|
## Additional Considerations
|
||||||
|
|
|
@ -120,6 +120,7 @@ end
|
||||||
- `<SCRIPT_BLOCK>` - Contains the logic that should be executed when a trigger condition is met, see the [script](#scripts) section for details on its syntax.
|
- `<SCRIPT_BLOCK>` - Contains the logic that should be executed when a trigger condition is met, see the [script](#scripts) section for details on its syntax.
|
||||||
|
|
||||||
{: #rule-triggers}
|
{: #rule-triggers}
|
||||||
|
|
||||||
### Rule Triggers
|
### Rule Triggers
|
||||||
|
|
||||||
Before a rule starts working, it has to be triggered.
|
Before a rule starts working, it has to be triggered.
|
||||||
|
@ -135,6 +136,7 @@ There are different categories of rule triggers:
|
||||||
Here are the details for each category:
|
Here are the details for each category:
|
||||||
|
|
||||||
{: #event-based-triggers}
|
{: #event-based-triggers}
|
||||||
|
|
||||||
### Event-based Triggers
|
### Event-based Triggers
|
||||||
|
|
||||||
You can listen to commands for a specific item, on status updates or on status changes (an update might leave the status unchanged).
|
You can listen to commands for a specific item, on status updates or on status changes (an update might leave the status unchanged).
|
||||||
|
@ -153,6 +155,7 @@ When using the `received command` trigger, the Rule might trigger **before** the
|
||||||
Therefore, if the Rule needs to know what the command was, use the [implicit variable]({{base}}/configuration/rules-dsl.html#implicit-variables-inside-the-execution-block) `receivedCommand` instead of `<ItemName>.state`.
|
Therefore, if the Rule needs to know what the command was, use the [implicit variable]({{base}}/configuration/rules-dsl.html#implicit-variables-inside-the-execution-block) `receivedCommand` instead of `<ItemName>.state`.
|
||||||
|
|
||||||
{: #member-of-triggers}
|
{: #member-of-triggers}
|
||||||
|
|
||||||
### Member of Triggers
|
### Member of Triggers
|
||||||
|
|
||||||
As with Item based event-based triggers discussed above, you can listen for commands, status updates, or status changes on the members of a given Group.
|
As with Item based event-based triggers discussed above, you can listen for commands, status updates, or status changes on the members of a given Group.
|
||||||
|
@ -172,6 +175,7 @@ Also, as with Item event-based triggers, when using `received command`, the Rule
|
||||||
So in Rules where the Rule needs to know what the command was, use the `receivedCommand` implicit variable instead of `triggeringItem.state`.
|
So in Rules where the Rule needs to know what the command was, use the `receivedCommand` implicit variable instead of `triggeringItem.state`.
|
||||||
|
|
||||||
{: #time-based-triggers}
|
{: #time-based-triggers}
|
||||||
|
|
||||||
### Time-based Triggers
|
### Time-based Triggers
|
||||||
|
|
||||||
You can either use some pre-defined expressions for timers or use a [cron expression](https:////www.quartz-scheduler.org/documentation/quartz-2.2.2/tutorials/tutorial-lesson-06.html) instead:
|
You can either use some pre-defined expressions for timers or use a [cron expression](https:////www.quartz-scheduler.org/documentation/quartz-2.2.2/tutorials/tutorial-lesson-06.html) instead:
|
||||||
|
@ -195,6 +199,7 @@ A cron expression takes the form of six or optionally seven fields:
|
||||||
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.
|
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}
|
||||||
|
|
||||||
### System-based Triggers
|
### System-based Triggers
|
||||||
|
|
||||||
Two system-based triggers are provided as described in the table below:
|
Two system-based triggers are provided as described in the table below:
|
||||||
|
@ -219,6 +224,7 @@ end
|
||||||
```
|
```
|
||||||
|
|
||||||
{: #thing-based-triggers}
|
{: #thing-based-triggers}
|
||||||
|
|
||||||
### Thing-based Triggers
|
### Thing-based Triggers
|
||||||
|
|
||||||
Your rules can take actions based upon status updates or status changes generated by Things.
|
Your rules can take actions based upon status updates or status changes generated by Things.
|
||||||
|
@ -243,6 +249,7 @@ You need to use quotes around `thingUID` if it contains special characters such
|
||||||
:::
|
:::
|
||||||
|
|
||||||
{: #channel-based-triggers}
|
{: #channel-based-triggers}
|
||||||
|
|
||||||
### Channel-based Triggers
|
### Channel-based Triggers
|
||||||
|
|
||||||
Some add-ons provide trigger channels.
|
Some add-ons provide trigger channels.
|
||||||
|
@ -279,6 +286,7 @@ end
|
||||||
```
|
```
|
||||||
|
|
||||||
{: #scripts}
|
{: #scripts}
|
||||||
|
|
||||||
## Scripts
|
## Scripts
|
||||||
|
|
||||||
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 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.
|
||||||
|
@ -302,6 +310,7 @@ if (Temperature.state < 20) {
|
||||||
```
|
```
|
||||||
|
|
||||||
{: #manipulating-item-states}
|
{: #manipulating-item-states}
|
||||||
|
|
||||||
### Manipulating Item States
|
### Manipulating Item States
|
||||||
|
|
||||||
Rules are often used to manipulate the state of an Item, for example switching lights on and off under certain conditions.
|
Rules are often used to manipulate the state of an Item, for example switching lights on and off under certain conditions.
|
||||||
|
@ -321,12 +330,14 @@ The following table summarizes the impact of the two manipulator commands on the
|
||||||
|
|
||||||
**Beware:**
|
**Beware:**
|
||||||
In most cases, a rule with a trigger of `received update` will fire following the command `sendCommand` as:
|
In most cases, a rule with a trigger of `received update` will fire following the command `sendCommand` as:
|
||||||
|
|
||||||
- openHAB auto-updates the status of Items for which the item definition does not contain `autoupdate="false"`
|
- openHAB auto-updates the status of Items for which the item definition does not contain `autoupdate="false"`
|
||||||
- the Thing sends a status update to the Item.
|
- the Thing sends a status update to the Item.
|
||||||
|
|
||||||
Besides the specific manipulator command methods `MyItem.sendCommand(<new_state>)` and `MyItem.postUpdate(<new_state>)`, generic manipulators in the form of `sendCommand(MyItem, <new_state>)` and `postUpdate(MyItem, <new_state>)` are available. The specific versions is normally recommended.
|
Besides the specific manipulator command methods `MyItem.sendCommand(<new_state>)` and `MyItem.postUpdate(<new_state>)`, generic manipulators in the form of `sendCommand(MyItem, <new_state>)` and `postUpdate(MyItem, <new_state>)` are available. The specific versions is normally recommended.
|
||||||
|
|
||||||
{: #sendcommand-method-vs-action}
|
{: #sendcommand-method-vs-action}
|
||||||
|
|
||||||
#### MyItem.sendCommand("new state") versus sendCommand(MyItem, "new state")
|
#### MyItem.sendCommand("new state") versus sendCommand(MyItem, "new state")
|
||||||
|
|
||||||
Using the methods `MyItem.sendCommand(<new_state>)` and `MyItem.postUpdate(<new_state>)` is often preferable.
|
Using the methods `MyItem.sendCommand(<new_state>)` and `MyItem.postUpdate(<new_state>)` is often preferable.
|
||||||
|
@ -345,6 +356,7 @@ Using `Myitem.sendCommand(new_state)` or `Myitem.postUpdate(new_state)` will, in
|
||||||
|
|
||||||
The Action `sendCommand(MyItem, new_state)` does not provide the same flexibilty.
|
The Action `sendCommand(MyItem, new_state)` does not provide the same flexibilty.
|
||||||
For example, if `new_state` is typed as a primitive (e.g., `var int new_state = 3`) and myItem is of the Object type Dimmer:
|
For example, if `new_state` is typed as a primitive (e.g., `var int new_state = 3`) and myItem is of the Object type Dimmer:
|
||||||
|
|
||||||
* the following command ***will fail***: ~~sendCommand(MyItem, new_state)~~.
|
* the following command ***will fail***: ~~sendCommand(MyItem, new_state)~~.
|
||||||
* However, the following command **will work**: `MyItem.sendCommand(new_state)`.
|
* However, the following command **will work**: `MyItem.sendCommand(new_state)`.
|
||||||
|
|
||||||
|
@ -362,6 +374,7 @@ sendCommand("My_Lamp_" + index, ON)
|
||||||
```
|
```
|
||||||
|
|
||||||
{: #using-state-of-items-in-rules}
|
{: #using-state-of-items-in-rules}
|
||||||
|
|
||||||
### Using the States of Items in Rules
|
### Using the States of Items in Rules
|
||||||
|
|
||||||
Often it is desired to calculate other values from Item states or to compare Item states against other values
|
Often it is desired to calculate other values from Item states or to compare Item states against other values
|
||||||
|
@ -376,6 +389,7 @@ This section differentiates between command type and state type.
|
||||||
For ease of reading, it is possible to simply add “type” to the end of a command type thereby obtaining the state type.
|
For ease of reading, it is possible to simply add “type” to the end of a command type thereby obtaining the state type.
|
||||||
For example, a Color Item can receive an OnOffType, IncreaseDecreaseType, PercentType, or HSBType.
|
For example, a Color Item can receive an OnOffType, IncreaseDecreaseType, PercentType, or HSBType.
|
||||||
Therefore the following are all valid commands one can send to a Color Item:
|
Therefore the following are all valid commands one can send to a Color Item:
|
||||||
|
|
||||||
- `MyColorItem.sendCommand(ON)`
|
- `MyColorItem.sendCommand(ON)`
|
||||||
- `MyColorItem.sendCommand(INCREASE)`
|
- `MyColorItem.sendCommand(INCREASE)`
|
||||||
- `MyColorItem.sendCommand(new PercentType(50))`
|
- `MyColorItem.sendCommand(new PercentType(50))`
|
||||||
|
@ -400,6 +414,7 @@ These methods can be called in Rules-DSL without the "get" part in name as in `(
|
||||||
They retrieve the state of MyColorItem and then casts it as HSBType to be able to use the methods associated with the HSBType.
|
They retrieve the state of MyColorItem and then casts it as HSBType to be able to use the methods associated with the HSBType.
|
||||||
|
|
||||||
{: #conversions}
|
{: #conversions}
|
||||||
|
|
||||||
#### Working with Item States: Conversions
|
#### Working with Item States: Conversions
|
||||||
|
|
||||||
*Reminder: For a complete and up-to-date list of what item types are currently allowed in openHAB and the command types each item can accept refer to the section on [items in the openHAB documentation]({{base}}/concepts/items.html).*
|
*Reminder: For a complete and up-to-date list of what item types are currently allowed in openHAB and the command types each item can accept refer to the section on [items in the openHAB documentation]({{base}}/concepts/items.html).*
|
||||||
|
@ -649,7 +664,6 @@ One can convert from ON and OFF to 1 and 0 with code similar to:
|
||||||
val SwitchNum = if (MySwitchItem.state == ON) 1 else 0
|
val SwitchNum = if (MySwitchItem.state == ON) 1 else 0
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
#### Deeper Dive
|
#### Deeper Dive
|
||||||
|
|
||||||
While interacting with Item states, care must be taken to understand the difference between Objects and primitives.
|
While interacting with Item states, care must be taken to understand the difference between Objects and primitives.
|
||||||
|
@ -688,6 +702,7 @@ Each of these separate methods is individually written to handle all of these di
|
||||||
MyItem will automatically apply the method that corresponds to the argument type.
|
MyItem will automatically apply the method that corresponds to the argument type.
|
||||||
|
|
||||||
{: #implicit-variables}
|
{: #implicit-variables}
|
||||||
|
|
||||||
### Implicit Variables inside the Execution Block
|
### Implicit Variables inside the Execution Block
|
||||||
|
|
||||||
Besides the implicitly available variables for items and commands/states, rules can have additional pre-defined variables, depending on their triggers:
|
Besides the implicitly available variables for items and commands/states, rules can have additional pre-defined variables, depending on their triggers:
|
||||||
|
@ -700,13 +715,14 @@ Besides the implicitly available variables for items and commands/states, rules
|
||||||
- `receivedEvent` - implicitly available in every rule that has a channel-based trigger.
|
- `receivedEvent` - implicitly available in every rule that has a channel-based trigger.
|
||||||
|
|
||||||
{: #return}
|
{: #return}
|
||||||
|
|
||||||
### Early returns
|
### Early returns
|
||||||
|
|
||||||
It is possible to return early from a rule, not executing the rest of the statements like this:
|
It is possible to return early from a rule, not executing the rest of the statements like this:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
if (Temperature.state > 20) {
|
if (Temperature.state > 20) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Heating.sendCommand(ON)
|
Heating.sendCommand(ON)
|
||||||
```
|
```
|
||||||
|
@ -714,6 +730,7 @@ Heating.sendCommand(ON)
|
||||||
Caveat: Please note the semicolon after the return statement which terminates the command without an additional argument.
|
Caveat: Please note the semicolon after the return statement which terminates the command without an additional argument.
|
||||||
|
|
||||||
{: #concurrency-guard}
|
{: #concurrency-guard}
|
||||||
|
|
||||||
### Concurrency Guard
|
### Concurrency Guard
|
||||||
|
|
||||||
If a rule triggers on UI events it may be necessary to guard against concurrency.
|
If a rule triggers on UI events it may be necessary to guard against concurrency.
|
||||||
|
@ -737,6 +754,7 @@ end
|
||||||
```
|
```
|
||||||
|
|
||||||
{: #transformations}
|
{: #transformations}
|
||||||
|
|
||||||
### Transformations
|
### Transformations
|
||||||
|
|
||||||
openHAB [Transformation services](/addons/#transform) can be used in rules to transform/translate/convert data.
|
openHAB [Transformation services](/addons/#transform) can be used in rules to transform/translate/convert data.
|
||||||
|
@ -782,8 +800,8 @@ finally {
|
||||||
|
|
||||||
For all available Transformation services please refer to the list of [Transformation Add-ons](/addons/#transform).
|
For all available Transformation services please refer to the list of [Transformation Add-ons](/addons/#transform).
|
||||||
|
|
||||||
|
|
||||||
{: #logging}
|
{: #logging}
|
||||||
|
|
||||||
### Logging
|
### Logging
|
||||||
|
|
||||||
You can emit log messages from your rules to aid debugging.
|
You can emit log messages from your rules to aid debugging.
|
||||||
|
|
|
@ -11,7 +11,6 @@ title: Next-Gen Rules
|
||||||
|
|
||||||
Since openHAB 2.4 another Rule Engine has been added. It works fundamentally different than what you find with our current [Rules](https://www.openhab.org/docs/configuration/rules-dsl.html). It allows Rules to be edited in a graphical fashion and to interact with [JSR223 Scripts (Javascript, Jypthon, etc)](https://www.openhab.org/docs/configuration/jsr223.html).
|
Since openHAB 2.4 another Rule Engine has been added. It works fundamentally different than what you find with our current [Rules](https://www.openhab.org/docs/configuration/rules-dsl.html). It allows Rules to be edited in a graphical fashion and to interact with [JSR223 Scripts (Javascript, Jypthon, etc)](https://www.openhab.org/docs/configuration/jsr223.html).
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Install the rule engine from Add-ons → Misc → Rule Engine (Experimental).
|
Install the rule engine from Add-ons → Misc → Rule Engine (Experimental).
|
||||||
|
@ -79,7 +78,6 @@ A given **Module type** has the following elements:
|
||||||
defaultValue - default value for the configuration property when not specified in the rule
|
defaultValue - default value for the configuration property when not specified in the rule
|
||||||
tags - shows how to be considered a given value. For example, as a Temperature
|
tags - shows how to be considered a given value. For example, as a Temperature
|
||||||
|
|
||||||
|
|
||||||
**Output property** has the following metadata:
|
**Output property** has the following metadata:
|
||||||
|
|
||||||
name
|
name
|
||||||
|
@ -109,13 +107,13 @@ The types in the **Configuration** object are restricted to the following:
|
||||||
|
|
||||||
**JSON schemas for:**
|
**JSON schemas for:**
|
||||||
|
|
||||||
* [module types](../../schemas/ModuleTypes_schema.json)
|
* [module types](../../schemas/ModuleTypes_schema.json)
|
||||||
* [rule templates](../../schemas/Templates_schema.json)
|
* [rule templates](../../schemas/Templates_schema.json)
|
||||||
* [rule instances](../../schemas/Rules_schema.json)
|
* [rule instances](../../schemas/Rules_schema.json)
|
||||||
|
|
||||||
### Sample Rules
|
### Sample Rules
|
||||||
|
|
||||||
* **Sample rule instance referencing module types:**
|
* **Sample rule instance referencing module types:**
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
|
@ -157,7 +155,7 @@ The types in the **Configuration** object are restricted to the following:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
* **Sample module types:**
|
* **Sample module types:**
|
||||||
|
|
||||||
```
|
```
|
||||||
"triggers":[
|
"triggers":[
|
||||||
|
@ -296,10 +294,10 @@ The types in the **Configuration** object are restricted to the following:
|
||||||
|
|
||||||
There are several ways to add new rules:
|
There are several ways to add new rules:
|
||||||
|
|
||||||
* using **JAVA API** from package: **org.openhab.automation.api**;
|
* using **JAVA API** from package: **org.openhab.automation.api**;
|
||||||
* using **text console commands: openhab:automation**;
|
* using **text console commands: openhab:automation**;
|
||||||
* using **resource bundles** that provide moduletypes, rules and rule templates stored in **.json** files;
|
* using **resource bundles** that provide moduletypes, rules and rule templates stored in **.json** files;
|
||||||
* using **REST API** - see the next chapter bellow.
|
* using **REST API** - see the next chapter bellow.
|
||||||
|
|
||||||
## REST API
|
## REST API
|
||||||
|
|
||||||
|
@ -309,33 +307,33 @@ There are several ways to add new rules:
|
||||||
|
|
||||||
#### /rest/templates
|
#### /rest/templates
|
||||||
|
|
||||||
- GET /rest/templates - returns all registered rule templates.
|
- GET /rest/templates - returns all registered rule templates.
|
||||||
- GET /rest/templates/{templateUID} - returned response includes only the content of the specified template.
|
- GET /rest/templates/{templateUID} - returned response includes only the content of the specified template.
|
||||||
|
|
||||||
#### /rest/module-types
|
#### /rest/module-types
|
||||||
|
|
||||||
- GET /rest/module-types - returns all registered module types.
|
- GET /rest/module-types - returns all registered module types.
|
||||||
- optional parameter 'type' with possible values: 'trigger', 'condition' or 'action' - filters the response to include only module definitions of specified type.
|
- optional parameter 'type' with possible values: 'trigger', 'condition' or 'action' - filters the response to include only module definitions of specified type.
|
||||||
- optional parameter 'tags' - filters the response to include only module types which have specified tags.
|
- optional parameter 'tags' - filters the response to include only module types which have specified tags.
|
||||||
- GET /rest/module-types/{moduleTypeUID} - returned response includes only the content of the specified module type.
|
- GET /rest/module-types/{moduleTypeUID} - returned response includes only the content of the specified module type.
|
||||||
|
|
||||||
#### /rest/rules
|
#### /rest/rules
|
||||||
|
|
||||||
- GET /rest/rules - returns all registered rule instances.
|
- GET /rest/rules - returns all registered rule instances.
|
||||||
- POST /rest/rules - adds new rule instance to the rule registry.
|
- POST /rest/rules - adds new rule instance to the rule registry.
|
||||||
- DELETE /rest/rules/{ruleUID} - deletes the specified rule instance.
|
- DELETE /rest/rules/{ruleUID} - deletes the specified rule instance.
|
||||||
- PUT /rest/rules/{ruleUID} - updates the specified rule instance.
|
- PUT /rest/rules/{ruleUID} - updates the specified rule instance.
|
||||||
- PUT /rest/rules/{ruleUID}/enable - enable/disable specified rule instance.
|
- PUT /rest/rules/{ruleUID}/enable - enable/disable specified rule instance.
|
||||||
- PUT /rest/rules/{ruleUID}/runnow - executes actions of specified rule instance.
|
- PUT /rest/rules/{ruleUID}/runnow - executes actions of specified rule instance.
|
||||||
- GET /rest/rules/{ruleUID}/config - returns the configuration of the specified rule instance.
|
- GET /rest/rules/{ruleUID}/config - returns the configuration of the specified rule instance.
|
||||||
- PUT /rest/rules/{ruleUID}/config - updates the configuration of the specified rule instance.
|
- PUT /rest/rules/{ruleUID}/config - updates the configuration of the specified rule instance.
|
||||||
- GET /rest/rules/{ruleUID}/triggers - returns the triggers defined for the specified rule instance.
|
- GET /rest/rules/{ruleUID}/triggers - returns the triggers defined for the specified rule instance.
|
||||||
- GET /rest/rules/{ruleUID}/conditions - returns the conditions defined for the specified rule instance.
|
- GET /rest/rules/{ruleUID}/conditions - returns the conditions defined for the specified rule instance.
|
||||||
- GET /rest/rules/{ruleUID}/actions - returns the actions defined for the specified rule instance.
|
- GET /rest/rules/{ruleUID}/actions - returns the actions defined for the specified rule instance.
|
||||||
- GET /rest/rules/{ruleUID}/{moduleCategory}/{id} - returns module instance with specified id and category {triggers/conditions/actions} of the specified rule.
|
- GET /rest/rules/{ruleUID}/{moduleCategory}/{id} - returns module instance with specified id and category {triggers/conditions/actions} of the specified rule.
|
||||||
- GET /rest/rules/{ruleUID}/{moduleCategory}/{id}/config - returns the configuration of the specified module instance.
|
- GET /rest/rules/{ruleUID}/{moduleCategory}/{id}/config - returns the configuration of the specified module instance.
|
||||||
- GET /rest/rules/{ruleUID}/{moduleCategory}/{id}/config/{param} - returns the value of specified module configuration parameter (media type is text/plain).
|
- GET /rest/rules/{ruleUID}/{moduleCategory}/{id}/config/{param} - returns the value of specified module configuration parameter (media type is text/plain).
|
||||||
- PUT /rest/rules/{ruleUID}/{moduleCategory}/{id}/config/{param} - updates the value of specified module configuration parameter (media type is text/plain).
|
- PUT /rest/rules/{ruleUID}/{moduleCategory}/{id}/config/{param} - updates the value of specified module configuration parameter (media type is text/plain).
|
||||||
|
|
||||||
## JAVA API
|
## JAVA API
|
||||||
|
|
||||||
|
@ -346,36 +344,35 @@ There are several ways to add new rules:
|
||||||
|
|
||||||
`org.openhab.automation.template.TemplateRegistry` - provides functionality to get templates from the Rule Engine.
|
`org.openhab.automation.template.TemplateRegistry` - provides functionality to get templates from the Rule Engine.
|
||||||
|
|
||||||
|
|
||||||
## Text console commands
|
## Text console commands
|
||||||
|
|
||||||
`automation listModuleTypes [-st] <filter> ` - lists all Module Types. If filter is present, lists only matching Module Types.
|
`automation listModuleTypes [-st] <filter>` - lists all Module Types. If filter is present, lists only matching Module Types.
|
||||||
|
|
||||||
`automation listTemplates [-st] <filter> ` - lists all Templates. If filter is present, lists only matching Templates.
|
`automation listTemplates [-st] <filter>` - lists all Templates. If filter is present, lists only matching Templates.
|
||||||
|
|
||||||
`automation listRules [-st] <filter> `- lists all Rules. If filter is present, lists only matching Rules.
|
`automation listRules [-st] <filter>`- lists all Rules. If filter is present, lists only matching Rules.
|
||||||
|
|
||||||
`automation removeModuleTypes [-st] <url> ` - Removes the Module Types, loaded from the given url.
|
`automation removeModuleTypes [-st] <url>` - Removes the Module Types, loaded from the given url.
|
||||||
|
|
||||||
`automation removeTemplates [-st] <url ` - Removes the Templates, loaded from the given url.
|
`automation removeTemplates [-st] <url` - Removes the Templates, loaded from the given url.
|
||||||
|
|
||||||
`automation removeRule [-st] <uid> ` - Removes the rule, specified by given UID.
|
`automation removeRule [-st] <uid>` - Removes the rule, specified by given UID.
|
||||||
|
|
||||||
`automation removeRules [-st] <filter> `- Removes the rules. If filter is present, removes only matching Rules.
|
`automation removeRules [-st] <filter>`- Removes the rules. If filter is present, removes only matching Rules.
|
||||||
|
|
||||||
`automation importModuleTypes [-p] <parserType> [-st] <url> ` - Imports Module Types from given url. If parser type missing, "json" parser will be set as default.
|
`automation importModuleTypes [-p] <parserType> [-st] <url>` - Imports Module Types from given url. If parser type missing, "json" parser will be set as default.
|
||||||
|
|
||||||
`automation importTemplates [-p] <parserType> [-st] <url> ` - Imports Templates from given url. If parser type missing, "json" parser will be set as default.
|
`automation importTemplates [-p] <parserType> [-st] <url>` - Imports Templates from given url. If parser type missing, "json" parser will be set as default.
|
||||||
|
|
||||||
`automation importRules [-p] <parserType> [-st] <url> ` - Imports Rules from given url. If parser type missing, "json" parser will be set as default.
|
`automation importRules [-p] <parserType> [-st] <url>` - Imports Rules from given url. If parser type missing, "json" parser will be set as default.
|
||||||
|
|
||||||
`automation exportModuleTypes [-p] <parserType> [-st] <file> ` - Exports Module Types in a file. If parser type missing, "json" parser will be set as default.
|
`automation exportModuleTypes [-p] <parserType> [-st] <file>` - Exports Module Types in a file. If parser type missing, "json" parser will be set as default.
|
||||||
|
|
||||||
`automation exportTemplates [-p] <parserType> [-st] <file> ` - Exports Templates in a file. If parser type missing, "json" parser will be set as default.
|
`automation exportTemplates [-p] <parserType> [-st] <file>` - Exports Templates in a file. If parser type missing, "json" parser will be set as default.
|
||||||
|
|
||||||
`automation exportRules [-p] <parserType> [-st] <file> ` - Exports Rules in a file. If parser type missing, "json" parser will be set as default.
|
`automation exportRules [-p] <parserType> [-st] <file>` - Exports Rules in a file. If parser type missing, "json" parser will be set as default.
|
||||||
|
|
||||||
`automation enableRule [-st] <uid> <enable> ` - Enables the Rule, specified by given UID.
|
`automation enableRule [-st] <uid> <enable>` - Enables the Rule, specified by given UID.
|
||||||
The use of the 'enable' argument is optional, and will accept a boolean value.
|
The use of the 'enable' argument is optional, and will accept a boolean value.
|
||||||
If used, the command will enable (true) or disable (false) the Rule.
|
If used, the command will enable (true) or disable (false) the Rule.
|
||||||
If it is not used, the command will return the current status of the Rule.
|
If it is not used, the command will return the current status of the Rule.
|
||||||
|
@ -397,7 +394,7 @@ The rule template is used only once when the rule is imported in the Rule Engine
|
||||||
After that the reference from the rule instance to the rule template is removed and a given rule may exist even if the rule template is removed or modified.
|
After that the reference from the rule instance to the rule template is removed and a given rule may exist even if the rule template is removed or modified.
|
||||||
This will not have any impact on the already imported rules.
|
This will not have any impact on the already imported rules.
|
||||||
|
|
||||||
* **Sample rule instance referencing rule template:**
|
* **Sample rule instance referencing rule template:**
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
|
@ -415,7 +412,7 @@ This will not have any impact on the already imported rules.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
* **Sample rule template:**
|
* **Sample rule template:**
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
|
@ -487,7 +484,7 @@ The above example uses two rule configuration properties:
|
||||||
|
|
||||||
### GenericEventTrigger
|
### GenericEventTrigger
|
||||||
|
|
||||||
GenericEventTrigger has 3 configuration paramters: `eventTopic`,` eventSource` and `eventTypes` and one output: 'event'.
|
GenericEventTrigger has 3 configuration paramters: `eventTopic`,`eventSource` and `eventTypes` and one output: 'event'.
|
||||||
|
|
||||||
{
|
{
|
||||||
"uid":"GenericEventTrigger",
|
"uid":"GenericEventTrigger",
|
||||||
|
@ -530,7 +527,6 @@ GenericEventTrigger has 3 configuration paramters: `eventTopic`,` eventSource` a
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
### GenericCompareCondition
|
### GenericCompareCondition
|
||||||
|
|
||||||
This module type is used to compare a value against a configuration property using an operator like `<, >, =`.
|
This module type is used to compare a value against a configuration property using an operator like `<, >, =`.
|
||||||
|
@ -590,7 +586,6 @@ and implement the necessary methods for creation of instances of the supported m
|
||||||
Another way to extend the supported module types is by defining composite module types as an extension of the system module types.
|
Another way to extend the supported module types is by defining composite module types as an extension of the system module types.
|
||||||
The composite module type wraps one or more instances of a system module type and defines new configuration parameters, inputs and outputs.
|
The composite module type wraps one or more instances of a system module type and defines new configuration parameters, inputs and outputs.
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"uid":"ItemStateChangeTrigger",
|
"uid":"ItemStateChangeTrigger",
|
||||||
"label":"Item State Trigger",
|
"label":"Item State Trigger",
|
||||||
|
|
|
@ -133,16 +133,16 @@ This provides the flexibility to present Items in the way desired in your home a
|
||||||
|
|
||||||
**General remarks on parameters:**
|
**General remarks on parameters:**
|
||||||
|
|
||||||
- In the following definitions, parameters in `[square brackets]` are optional.
|
- In the following definitions, parameters in `[square brackets]` are optional.
|
||||||
|
|
||||||
- Parameters must be supplied in the order shown.
|
- Parameters must be supplied in the order shown.
|
||||||
|
|
||||||
- Common parameters, also known from [items definition](items.html#item-syntax):
|
- Common parameters, also known from [items definition](items.html#item-syntax):
|
||||||
- `item` defines the name of the Item you want to present (e.g. `Temperature`), [more details](items.html#item-name).
|
- `item` defines the name of the Item you want to present (e.g. `Temperature`), [more details](items.html#item-name).
|
||||||
- `label` sets the textual description displayed next to the preprocessed Item data (e.g. "`Now [%s °C]`"), [more details](items.html#item-label).
|
- `label` sets the textual description displayed next to the preprocessed Item data (e.g. "`Now [%s °C]`"), [more details](items.html#item-label).
|
||||||
- `icon` chooses the name of the icon file to show next to the element, [more details](items.html#icons).
|
- `icon` chooses the name of the icon file to show next to the element, [more details](items.html#icons).
|
||||||
|
|
||||||
- When an [Item]({{base}}/configuration/items.html) is defined, you have the opportunity to assign a label and/or an icon at that point.
|
- When an [Item]({{base}}/configuration/items.html) is defined, you have the opportunity to assign a label and/or an icon at that point.
|
||||||
If no label or icon are specified in the Sitemap, then the label and/or icon you assigned to the Item will be displayed.
|
If no label or icon are specified in the Sitemap, then the label and/or icon you assigned to the Item will be displayed.
|
||||||
Setting a value for `label` or `icon` of a Sitemap element will override the values defined for the linked Item.
|
Setting a value for `label` or `icon` of a Sitemap element will override the values defined for the linked Item.
|
||||||
|
|
||||||
|
@ -163,9 +163,10 @@ sitemap demo label="My home automation" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
UoM = [Units of Measurment]({{base}}/concepts/units-of-measurement.html)
|
UoM = [Units of Measurment]({{base}}/concepts/units-of-measurement.html)
|
||||||
|
|
||||||
- Additional parameters such as `mappings` and `valuecolor` are described below.
|
- Additional parameters such as `mappings` and `valuecolor` are described below.
|
||||||
|
|
||||||
### Element Type 'Frame'
|
### Element Type 'Frame'
|
||||||
|
|
||||||
|
@ -197,7 +198,6 @@ Default item=<itemname> [label="<labelname>"] [icon="<iconname>"]
|
||||||
Presents an Item using the default UI representation specified by the type of the given Item.
|
Presents an Item using the default UI representation specified by the type of the given Item.
|
||||||
E.g., a `Dimmer` Item will be represented as a [Slider](#element-type-slider) element while a `Player` Item will be rendered with player button controls (Previous/Pause/Play/Next).
|
E.g., a `Dimmer` Item will be represented as a [Slider](#element-type-slider) element while a `Player` Item will be rendered with player button controls (Previous/Pause/Play/Next).
|
||||||
|
|
||||||
|
|
||||||
### Element Type 'Text'
|
### Element Type 'Text'
|
||||||
|
|
||||||
```perl
|
```perl
|
||||||
|
@ -307,16 +307,16 @@ Slider item=<itemname> [label="<labelname>"] [icon="<iconname>"] [sendFrequency=
|
||||||
|
|
||||||
This type presents a value as a user-adjustable control which slides from left (0) to right (100).
|
This type presents a value as a user-adjustable control which slides from left (0) to right (100).
|
||||||
|
|
||||||
- `sendFrequency` is used to distinguish between long and short button presses in the classic (web) frontend.
|
- `sendFrequency` is used to distinguish between long and short button presses in the classic (web) frontend.
|
||||||
This parameter defines the interval in milliseconds for sending increase/decrease requests.
|
This parameter defines the interval in milliseconds for sending increase/decrease requests.
|
||||||
|
|
||||||
- `switchSupport` is a parameter without an assignment.
|
- `switchSupport` is a parameter without an assignment.
|
||||||
- Classic UI: If specified, a short press on the "up" or "down" button switches the item "on" or "off" (0 or 100) respectively.
|
- Classic UI: If specified, a short press on the "up" or "down" button switches the item "on" or "off" (0 or 100) respectively.
|
||||||
- Android app: If specified, a short press on the item row (except the slider itself) switches the item "on" or "off".
|
- Android app: If specified, a short press on the item row (except the slider itself) switches the item "on" or "off".
|
||||||
- This parameter has no effect in other UIs.
|
- This parameter has no effect in other UIs.
|
||||||
|
|
||||||
- `minValue` (defaults to 0) and `maxValue` (defaults to 100) limit the possible range of the value (both included in the range).
|
- `minValue` (defaults to 0) and `maxValue` (defaults to 100) limit the possible range of the value (both included in the range).
|
||||||
- `step` (defaults to 1) defines the distance between two possible/selectable datapoints on the slider.
|
- `step` (defaults to 1) defines the distance between two possible/selectable datapoints on the slider.
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
|
@ -336,7 +336,6 @@ This element is a combined control for something like a rgb or rgbw light where
|
||||||
The down-button decreases brightness to zero and switches the light off. The up-button sets brightness to full but keeps the previous color (hue).
|
The down-button decreases brightness to zero and switches the light off. The up-button sets brightness to full but keeps the previous color (hue).
|
||||||
The middle button opens an overlay to finetune your color. A color wheel let you pick the hue and a slider allows to set the brightness.
|
The middle button opens an overlay to finetune your color. A color wheel let you pick the hue and a slider allows to set the brightness.
|
||||||
|
|
||||||
|
|
||||||
- `sendFrequency` is used to distinguish between long and short button presses in the classic (web) frontend.
|
- `sendFrequency` is used to distinguish between long and short button presses in the classic (web) frontend.
|
||||||
This parameter defines the interval in milliseconds for sending increase/decrease requests.
|
This parameter defines the interval in milliseconds for sending increase/decrease requests.
|
||||||
|
|
||||||
|
@ -393,7 +392,7 @@ Image [item=<itemname>] [icon="<iconname>"] url="<url of image>" [label="<labeln
|
||||||
|
|
||||||
This element type is able to present an image.
|
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.
|
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, https://<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`.
|
- `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.
|
- `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.
|
||||||
|
@ -444,18 +443,18 @@ Chart [item=<itemname>] [icon="<iconname>"] [label="<labelname>"] [refresh=xxxx]
|
||||||
|
|
||||||
Adds a time-series chart object for the display of logged data.
|
Adds a time-series chart object for the display of logged data.
|
||||||
|
|
||||||
- `refresh` defines the refresh period of the Image (in milliseconds).
|
- `refresh` defines the refresh period of the Image (in milliseconds).
|
||||||
|
|
||||||
- `service` sets the persistence service to use.
|
- `service` sets the persistence service to use.
|
||||||
If no service is specified, openHAB will use the first queryable persistence service it finds.
|
If no service is specified, openHAB will use the first queryable persistence service it finds.
|
||||||
Therefore, for an installation with only a single persistence service, this is not required.
|
Therefore, for an installation with only a single persistence service, this is not required.
|
||||||
|
|
||||||
- `period` is the scale of the time axis. Valid values are `h, 4h, 8h, 12h, D, 2D, 3D, W, 2W, M, 2M, 4M or Y`.
|
- `period` is the scale of the time axis. Valid values are `h, 4h, 8h, 12h, D, 2D, 3D, W, 2W, M, 2M, 4M or Y`.
|
||||||
|
|
||||||
- `begin` / `end` sets the beginning and end of the time axis.
|
- `begin` / `end` sets the beginning and end of the time axis.
|
||||||
Valid values are in the format: "yyyyMMddHHmm" (yyyy = year, MM = month, dd = day, HH = hour (0-23), mm = minutes).
|
Valid values are in the format: "yyyyMMddHHmm" (yyyy = year, MM = month, dd = day, HH = hour (0-23), mm = minutes).
|
||||||
|
|
||||||
- `legend` is used to show or to hide the chart legend.
|
- `legend` is used to show or to hide the chart legend.
|
||||||
Valid values are `true` (always show the legend) and `false` (never show the legend).
|
Valid values are `true` (always show the legend) and `false` (never show the legend).
|
||||||
If this parameter is not set, the legend is hidden if there is only one chart series.
|
If this parameter is not set, the legend is hidden if there is only one chart series.
|
||||||
|
|
||||||
|
@ -499,7 +498,6 @@ Its power state is represented by a binary Switch Item.
|
||||||
Its channel number is a discrete number Item that may only be set to one of three states.
|
Its channel number is a discrete number Item that may only be set to one of three states.
|
||||||
By using a Switch or Selection element with a mappings array, you can replace these meaningless values with user-friendly descriptions for display on the user interface.
|
By using a Switch or Selection element with a mappings array, you can replace these meaningless values with user-friendly descriptions for display on the user interface.
|
||||||
|
|
||||||
|
|
||||||
This mapping changes the displayed power state of the TV from "ON" and "OFF" to the more accurate terms, "on" and "standby".
|
This mapping changes the displayed power state of the TV from "ON" and "OFF" to the more accurate terms, "on" and "standby".
|
||||||
Similarly, mapping above changes the numbers "1", "2", and "3" to "DasErste", "BBC One", and "Cartoon Network" respectively.
|
Similarly, mapping above changes the numbers "1", "2", and "3" to "DasErste", "BBC One", and "Cartoon Network" respectively.
|
||||||
|
|
||||||
|
@ -654,34 +652,34 @@ sitemap demo label="My home automation" {
|
||||||
|
|
||||||
Explanation:
|
Explanation:
|
||||||
|
|
||||||
- The Sitemap "demo" with the shown title "My home automation" is defined.
|
- The Sitemap "demo" with the shown title "My home automation" is defined.
|
||||||
|
|
||||||
- One first Frame with a date stamp is shown.
|
- One first Frame with a date stamp is shown.
|
||||||
|
|
||||||
- Another Frame with a visual label "Demo" is presented, containing:
|
- Another Frame with a visual label "Demo" is presented, containing:
|
||||||
|
|
||||||
- A Switch for the Item "Lights"
|
- A Switch for the Item "Lights"
|
||||||
|
|
||||||
- A Text element showing a temperature in a given format
|
- A Text element showing a temperature in a given format
|
||||||
|
|
||||||
- A Group element. Upon clicking the element, a new view containing all "Heating" Items will be shown.
|
- A Group element. Upon clicking the element, a new view containing all "Heating" Items will be shown.
|
||||||
|
|
||||||
- Another Text element showing a "Multimedia" summary, e.g. "Currently playing".
|
- Another Text element showing a "Multimedia" summary, e.g. "Currently playing".
|
||||||
The element is additionally the host for a nested block.
|
The element is additionally the host for a nested block.
|
||||||
By clicking in the element, a new view with two elements is presented:
|
By clicking in the element, a new view with two elements is presented:
|
||||||
- A Selection presenting four options in a modal dialog prompt
|
- A Selection presenting four options in a modal dialog prompt
|
||||||
- A Slider to set the volume (e.g. 0-100%)
|
- A Slider to set the volume (e.g. 0-100%)
|
||||||
|
|
||||||
<!-- Note to author: If you update this example, remember to copy it to the beginning of this article as well! -->
|
<!-- Note to author: If you update this example, remember to copy it to the beginning of this article as well! -->
|
||||||
|
|
||||||
## Further notes and comparison details
|
## Further notes and comparison details
|
||||||
|
|
||||||
- String comparisons are case sensitive, so `==ON` is not the same as `==on`.
|
- String comparisons are case sensitive, so `==ON` is not the same as `==on`.
|
||||||
|
|
||||||
- DateTime comparisons are relative to the current time and specified in seconds.
|
- DateTime comparisons are relative to the current time and specified in seconds.
|
||||||
So the expression `Lights_On_Time > 300` will return true if the DateTime Item is set to a value that's newer than the past 5 minutes (300 seconds).
|
So the expression `Lights_On_Time > 300` will return true if the DateTime Item is set to a value that's newer than the past 5 minutes (300 seconds).
|
||||||
|
|
||||||
- Further examples for defining Sitemaps can be found in our [openHAB-Samples](https://github.com/openhab/openhab/wiki/Samples-Sitemap-Definitions) section.
|
- Further examples for defining Sitemaps can be found in our [openHAB-Samples](https://github.com/openhab/openhab/wiki/Samples-Sitemap-Definitions) section.
|
||||||
|
|
||||||
<!-- Note to author:
|
<!-- Note to author:
|
||||||
- The screenshot were created with chrome mobile developer tools on a page width of 529px
|
- The screenshot were created with chrome mobile developer tools on a page width of 529px
|
||||||
|
@ -695,7 +693,6 @@ Location Demo_Location "Location [48.858377,2.294486,66.0]"
|
||||||
Number Demo_TV_Channel
|
Number Demo_TV_Channel
|
||||||
Color Demo_Color
|
Color Demo_Color
|
||||||
|
|
||||||
|
|
||||||
sitemap demo label="My home automation" {
|
sitemap demo label="My home automation" {
|
||||||
Frame label="Date" {
|
Frame label="Date" {
|
||||||
Text item=Date label="Today [Monday, 01. Aug. 2016]"
|
Text item=Date label="Today [Monday, 01. Aug. 2016]"
|
||||||
|
|
|
@ -84,7 +84,6 @@ To help organizing your things, you also may define a location (`Location` in th
|
||||||
Inside the square brackets configuration parameters of the thing are defined.
|
Inside the square brackets configuration parameters of the thing are defined.
|
||||||
The type of the configuration parameter is determined by the binding and must be specified accordingly in the DSL.
|
The type of the configuration parameter is determined by the binding and must be specified accordingly in the DSL.
|
||||||
|
|
||||||
|
|
||||||
**Examples:**
|
**Examples:**
|
||||||
|
|
||||||
```xtend
|
```xtend
|
||||||
|
@ -110,8 +109,8 @@ Bridges can be defined together with contained things. The following configurati
|
||||||
|
|
||||||
```xtend
|
```xtend
|
||||||
Bridge hue:bridge:mybridge [ ipAddress="192.168.3.123" ] {
|
Bridge hue:bridge:mybridge [ ipAddress="192.168.3.123" ] {
|
||||||
Thing 0210 bulb1 [ lightId="1" ]
|
Thing 0210 bulb1 [ lightId="1" ]
|
||||||
Thing 0210 bulb2 [ lightId="2" ]
|
Thing 0210 bulb2 [ lightId="2" ]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -160,11 +159,11 @@ It is also possible to add additional channels to existing things and for bindin
|
||||||
|
|
||||||
```xtend
|
```xtend
|
||||||
Thing yahooweather:weather:losangeles [ location=2442047, unit="us", refresh=120 ] {
|
Thing yahooweather:weather:losangeles [ location=2442047, unit="us", refresh=120 ] {
|
||||||
Channels:
|
Channels:
|
||||||
State String : customChannel1 "My Custom Channel" [
|
State String : customChannel1 "My Custom Channel" [
|
||||||
configParameter="Value"
|
configParameter="Value"
|
||||||
]
|
]
|
||||||
State Number : customChannel2 []
|
State Number : customChannel2 []
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -176,11 +175,11 @@ As state channels are the default channels, you can omit the `State` keyword, th
|
||||||
|
|
||||||
```xtend
|
```xtend
|
||||||
Thing yahooweather:weather:losangeles [ location=2442047, unit="us", refresh=120 ] {
|
Thing yahooweather:weather:losangeles [ location=2442047, unit="us", refresh=120 ] {
|
||||||
Channels:
|
Channels:
|
||||||
String : customChannel1 "My Custom Channel" [
|
String : customChannel1 "My Custom Channel" [
|
||||||
configParameter="Value"
|
configParameter="Value"
|
||||||
]
|
]
|
||||||
Number : customChannel2 []
|
Number : customChannel2 []
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -190,10 +189,10 @@ You may optionally give the channel a proper label (like “My Custom Channel”
|
||||||
|
|
||||||
```xtend
|
```xtend
|
||||||
Thing yahooweather:weather:losangeles [ location=2442047, unit="us", refresh=120 ] {
|
Thing yahooweather:weather:losangeles [ location=2442047, unit="us", refresh=120 ] {
|
||||||
Channels:
|
Channels:
|
||||||
Trigger String : customChannel1 [
|
Trigger String : customChannel1 [
|
||||||
configParameter="Value"
|
configParameter="Value"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ These must be inside the XML escape sequence - eg.
|
||||||
```<description><![CDATA[ HTML marked up text here ]]></description>```.
|
```<description><![CDATA[ HTML marked up text here ]]></description>```.
|
||||||
|
|
||||||
## XML Structure for Configuration Descriptions
|
## XML Structure for Configuration Descriptions
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<config-description:config-descriptions
|
<config-description:config-descriptions
|
||||||
|
|
|
@ -6,6 +6,7 @@ title: Bindings
|
||||||
{% include base.html %}
|
{% include base.html %}
|
||||||
|
|
||||||
# Developing a Binding
|
# Developing a Binding
|
||||||
|
|
||||||
{:.no_toc}
|
{:.no_toc}
|
||||||
|
|
||||||
A binding is an extension to openHAB that integrates an external system like a software service or a hardware device.
|
A binding is an extension to openHAB that integrates an external system like a software service or a hardware device.
|
||||||
|
@ -19,6 +20,7 @@ It makes sense to briefly read over all sections to make you familiar with what
|
||||||
During development you might come back with specific questions.
|
During development you might come back with specific questions.
|
||||||
|
|
||||||
{::options toc_levels="2,3"/}
|
{::options toc_levels="2,3"/}
|
||||||
|
|
||||||
- TOC
|
- TOC
|
||||||
{:toc}
|
{:toc}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ title: Thing Descriptions
|
||||||
{% include base.html %}
|
{% include base.html %}
|
||||||
|
|
||||||
# Binding Definitions
|
# Binding Definitions
|
||||||
|
|
||||||
{:.no_toc}
|
{:.no_toc}
|
||||||
|
|
||||||
In order to work with *Things* and *Channels*, some meta information about them is needed.
|
In order to work with *Things* and *Channels*, some meta information about them is needed.
|
||||||
|
@ -14,6 +15,7 @@ These are provided through 'ThingType' and 'ChannelType' definitions,
|
||||||
which describe details about their functionality and configuration options.
|
which describe details about their functionality and configuration options.
|
||||||
|
|
||||||
{::options toc_levels="2,3"/}
|
{::options toc_levels="2,3"/}
|
||||||
|
|
||||||
- TOC
|
- TOC
|
||||||
{:toc}
|
{:toc}
|
||||||
|
|
||||||
|
@ -286,6 +288,7 @@ The following XML snippet defines a list of commands:
|
||||||
```
|
```
|
||||||
|
|
||||||
The user interface can use these values to render
|
The user interface can use these values to render
|
||||||
|
|
||||||
- a drop down and also represent the current state or
|
- a drop down and also represent the current state or
|
||||||
- as push buttons to simply send a command to the ThingHandler.
|
- as push buttons to simply send a command to the ThingHandler.
|
||||||
|
|
||||||
|
@ -548,6 +551,7 @@ The label and descriptions for things, channels and config descriptions should f
|
||||||
The label should be short so that for most UIs it does not spread across multiple lines.
|
The label should be short so that for most UIs it does not spread across multiple lines.
|
||||||
Guideline is 2-3 words with up to 25 chars.
|
Guideline is 2-3 words with up to 25 chars.
|
||||||
Labels should be capitalized using the following rules:
|
Labels should be capitalized using the following rules:
|
||||||
|
|
||||||
- Always capitalize the first and the last word.
|
- Always capitalize the first and the last word.
|
||||||
- Lowercase articles, coordinating conjunctions, and prepositions (`a, an, the, and, as, but, by, for, from, in, into, like, near, nor, of, onto, or, out, over, past, so, till, to, up, upon, with, yet`).
|
- Lowercase articles, coordinating conjunctions, and prepositions (`a, an, the, and, as, but, by, for, from, in, into, like, near, nor, of, onto, or, out, over, past, so, till, to, up, upon, with, yet`).
|
||||||
- Capitalize all other words.
|
- Capitalize all other words.
|
||||||
|
|
|
@ -6,6 +6,7 @@ title: Equinox
|
||||||
{% include base.html %}
|
{% include base.html %}
|
||||||
|
|
||||||
# Equinox
|
# Equinox
|
||||||
|
|
||||||
{:.no_toc}
|
{:.no_toc}
|
||||||
|
|
||||||
[Equinox][Equinox] is considered to be a reference implementation of the [OSGi Core Release 7][OSGi-core].
|
[Equinox][Equinox] is considered to be a reference implementation of the [OSGi Core Release 7][OSGi-core].
|
||||||
|
@ -16,6 +17,7 @@ The openHAB bundles are deployed on an Equinox runtime.
|
||||||
Knowledge about how to start the runtime and execute basic commands will help you to speedup the development process.
|
Knowledge about how to start the runtime and execute basic commands will help you to speedup the development process.
|
||||||
|
|
||||||
{::options toc_levels="2,3"/}
|
{::options toc_levels="2,3"/}
|
||||||
|
|
||||||
- TOC
|
- TOC
|
||||||
{:toc}
|
{:toc}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ openHAB is being based on [OSGi][OSGi] and understanding of OSGi modular archite
|
||||||
This page is aimed to help developers, that are going to use OSGi for the first time and contains a basic overview of the OSGi technology.
|
This page is aimed to help developers, that are going to use OSGi for the first time and contains a basic overview of the OSGi technology.
|
||||||
|
|
||||||
{::options toc_levels="2,3"/}
|
{::options toc_levels="2,3"/}
|
||||||
|
|
||||||
- TOC
|
- TOC
|
||||||
{:toc}
|
{:toc}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ title: Event Bus
|
||||||
{% include base.html %}
|
{% include base.html %}
|
||||||
|
|
||||||
# Event Bus
|
# Event Bus
|
||||||
|
|
||||||
{:.no_toc}
|
{:.no_toc}
|
||||||
|
|
||||||
The openHAB framework provides an event bus for inter-component communication.
|
The openHAB framework provides an event bus for inter-component communication.
|
||||||
|
@ -16,6 +17,7 @@ This section introduces the event API and illustrates how to receive such events
|
||||||
Furthermore, the sending of events and the implementation of new event types will be described.
|
Furthermore, the sending of events and the implementation of new event types will be described.
|
||||||
|
|
||||||
{::options toc_levels="2,3"/}
|
{::options toc_levels="2,3"/}
|
||||||
|
|
||||||
- TOC
|
- TOC
|
||||||
{:toc}
|
{:toc}
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,13 @@ title: Internationalization
|
||||||
{% include base.html %}
|
{% include base.html %}
|
||||||
|
|
||||||
# Internationalization
|
# Internationalization
|
||||||
|
|
||||||
{:.no_toc}
|
{:.no_toc}
|
||||||
|
|
||||||
In this chapter the openHAB support for internationalization is described.
|
In this chapter the openHAB support for internationalization is described.
|
||||||
|
|
||||||
{::options toc_levels="2,3"/}
|
{::options toc_levels="2,3"/}
|
||||||
|
|
||||||
- TOC
|
- TOC
|
||||||
{:toc}
|
{:toc}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ title: Getting Started - Introduction
|
||||||
|
|
||||||
{% include base.html %}
|
{% include base.html %}
|
||||||
|
|
||||||
# Welcome!
|
# Welcome
|
||||||
|
|
||||||
Welcome to openHAB.
|
Welcome to openHAB.
|
||||||
We hope that your journey with openHAB is a rewarding one.
|
We hope that your journey with openHAB is a rewarding one.
|
||||||
|
@ -30,7 +30,9 @@ Whilst it is possible to mix the two, for example use the UI for things and file
|
||||||
To help you choose between the two approaches, the following is a summary of the pros & cons for each:
|
To help you choose between the two approaches, the following is a summary of the pros & cons for each:
|
||||||
|
|
||||||
### File-based
|
### File-based
|
||||||
|
|
||||||
Pros:
|
Pros:
|
||||||
|
|
||||||
- File based has been the only really practical way to define most objects (things excluded) in previous versions, so a lot of examples in the docs and the forum will assume that approach. However, as time passes there will be more and more UI driven examples.
|
- File based has been the only really practical way to define most objects (things excluded) in previous versions, so a lot of examples in the docs and the forum will assume that approach. However, as time passes there will be more and more UI driven examples.
|
||||||
- With file based configs it is easier to make bulk changes and bulk updates, to duplicate similar objects, and to separate domains into distinct files.
|
- With file based configs it is easier to make bulk changes and bulk updates, to duplicate similar objects, and to separate domains into distinct files.
|
||||||
- The config files can be treated as source files, easing backups and version control. Though that does not mean that source control, backups, and version control cannot be done with UI driven configs.
|
- The config files can be treated as source files, easing backups and version control. Though that does not mean that source control, backups, and version control cannot be done with UI driven configs.
|
||||||
|
@ -38,13 +40,16 @@ Pros:
|
||||||
- Easier to share configurations between multiple openHAB instances.
|
- Easier to share configurations between multiple openHAB instances.
|
||||||
|
|
||||||
Cons:
|
Cons:
|
||||||
|
|
||||||
- Config files are more prone to errors. The slightest typo leads to a syntax error that could cause the file to become invalid, which will result in everything defined in that file being removed from the system until you fix it.
|
- Config files are more prone to errors. The slightest typo leads to a syntax error that could cause the file to become invalid, which will result in everything defined in that file being removed from the system until you fix it.
|
||||||
- The syntax for the config files can be a little overwhelming for novice users, as you have to learn and understand the syntax in addition to openHAB concepts and home automation technologies.
|
- The syntax for the config files can be a little overwhelming for novice users, as you have to learn and understand the syntax in addition to openHAB concepts and home automation technologies.
|
||||||
- You will see most objects defined in files in the UI but you won't be able to edit them (those objects will have a lock besides their name/label :lock:).
|
- You will see most objects defined in files in the UI but you won't be able to edit them (those objects will have a lock besides their name/label :lock:).
|
||||||
- You need to sit in front of a computer with access to the files to make changes.
|
- You need to sit in front of a computer with access to the files to make changes.
|
||||||
|
|
||||||
### UI-driven
|
### UI-driven
|
||||||
|
|
||||||
Pros:
|
Pros:
|
||||||
|
|
||||||
- Easier to understand for novices. The UI assists you with its built in documents and help. There are fewer opportunities to make mistakes since the syntax is almost impossible to get wrong.
|
- Easier to understand for novices. The UI assists you with its built in documents and help. There are fewer opportunities to make mistakes since the syntax is almost impossible to get wrong.
|
||||||
- All objects can be altered from anywhere the UI can be reached (including on mobile).
|
- All objects can be altered from anywhere the UI can be reached (including on mobile).
|
||||||
- Things can be auto-discovered.
|
- Things can be auto-discovered.
|
||||||
|
@ -53,6 +58,7 @@ Pros:
|
||||||
- A backup of the internal database is created on every change.
|
- A backup of the internal database is created on every change.
|
||||||
|
|
||||||
Cons:
|
Cons:
|
||||||
|
|
||||||
- Can be slower to reach one's goal if you already know what you're doing and if there's a lot of bulk changes or duplicating required.
|
- Can be slower to reach one's goal if you already know what you're doing and if there's a lot of bulk changes or duplicating required.
|
||||||
- Harder to remove obsolete stuff.
|
- Harder to remove obsolete stuff.
|
||||||
- Some things cannot be configured with the UI yet (e.g. persistence).
|
- Some things cannot be configured with the UI yet (e.g. persistence).
|
||||||
|
|
|
@ -169,6 +169,7 @@ Since it's linked to the Color channel of the Hue bulb, the light will reflect t
|
||||||
Finish adding Equipment and Points from your Things.
|
Finish adding Equipment and Points from your Things.
|
||||||
|
|
||||||
## Retrofitting Existing Items to the Model
|
## Retrofitting Existing Items to the Model
|
||||||
|
|
||||||
There may be times where a user needs to add existing Items to their model.
|
There may be times where a user needs to add existing Items to their model.
|
||||||
Perhaps they are migrating from an older version of OH, they did not follow the advice above to start with the model to begin with, or they are following a tutorial or example that doesn't include the model.
|
Perhaps they are migrating from an older version of OH, they did not follow the advice above to start with the model to begin with, or they are following a tutorial or example that doesn't include the model.
|
||||||
In this case all is not lost.
|
In this case all is not lost.
|
||||||
|
@ -178,21 +179,22 @@ Then add the Point as a member of the appropriate Equipment or Location Group.
|
||||||
If the Equipment Group doesn't exist yet, create a Group and use the appropriate Equipment semantic tag first and add the Equipment to the appropriate Location Group.
|
If the Equipment Group doesn't exist yet, create a Group and use the appropriate Equipment semantic tag first and add the Equipment to the appropriate Location Group.
|
||||||
|
|
||||||
## Modifying the Model
|
## Modifying the Model
|
||||||
|
|
||||||
As illustrated here, the model consists mainly of Group membership and tags on Items.
|
As illustrated here, the model consists mainly of Group membership and tags on Items.
|
||||||
To change the location of an equipment or room, simply change the parent Group.
|
To change the location of an equipment or room, simply change the parent Group.
|
||||||
To change the type of an equipment or point, simply edit the tags.
|
To change the type of an equipment or point, simply edit the tags.
|
||||||
Some of these edits are possible from the Model Page itself.
|
Some of these edits are possible from the Model Page itself.
|
||||||
Where that's not supported, you can make the changes through the Item's Page.
|
Where that's not supported, you can make the changes through the Item's Page.
|
||||||
|
|
||||||
## Controls and Sensor types
|
## Controls and Sensor types
|
||||||
|
|
||||||
This is a table descibing the Equipment types and point class and type to enable display of badges and measurements on the location cards.
|
This is a table descibing the Equipment types and point class and type to enable display of badges and measurements on the location cards.
|
||||||
This is based off the sources linked below.
|
This is based off the sources linked below.
|
||||||
|
|
||||||
- https://github.com/openhab/openhab-webui/blob/master/bundles/org.openhab.ui/web/src/components/cards/glance/location/status-badge.vue#L63
|
- <https://github.com/openhab/openhab-webui/blob/master/bundles/org.openhab.ui/web/src/components/cards/glance/location/status-badge.vue#L63>
|
||||||
- https://github.com/openhab/openhab-webui/blob/master/bundles/org.openhab.ui/web/src/components/cards/glance/location/measurement-badge.vue#L48
|
- <https://github.com/openhab/openhab-webui/blob/master/bundles/org.openhab.ui/web/src/components/cards/glance/location/measurement-badge.vue#L48>
|
||||||
|
|
||||||
### Badges
|
### Badges
|
||||||
|
|
||||||
| Type | Equipment | Equipment subtypes allowed | Point Class | Point Type | Point Subtypes allowed |
|
| Type | Equipment | Equipment subtypes allowed | Point Class | Point Type | Point Subtypes allowed |
|
||||||
| ----------- | --- | ---- | ----------- | ---- | ----- |
|
| ----------- | --- | ---- | ----------- | ---- | ----- |
|
||||||
|
@ -215,7 +217,7 @@ This is based off the sources linked below.
|
||||||
| Projectors | Projector | no | Control | Power | yes |
|
| Projectors | Projector | no | Control | Power | yes |
|
||||||
| Alarms | ANY | NA | Alarm | ANY | yes |
|
| Alarms | ANY | NA | Alarm | ANY | yes |
|
||||||
|
|
||||||
### Measurements
|
### Measurements
|
||||||
|
|
||||||
These don't care about equipment and just look at points
|
These don't care about equipment and just look at points
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,10 @@ Note that Persistence only saves Item states.
|
||||||
{:toc}
|
{:toc}
|
||||||
|
|
||||||
## Persistence Concepts
|
## Persistence Concepts
|
||||||
|
|
||||||
As previously mentioned, Persistence saves Item states.
|
As previously mentioned, Persistence saves Item states.
|
||||||
But the question is, when does it save those Item states?
|
But the question is, when does it save those Item states?
|
||||||
|
|
||||||
- Every time the Item changes?
|
- Every time the Item changes?
|
||||||
- Every time the Item is updated (an update does not necessarily result in the Item changing state)?
|
- Every time the Item is updated (an update does not necessarily result in the Item changing state)?
|
||||||
- Only when the Item receives a command?
|
- Only when the Item receives a command?
|
||||||
|
@ -41,6 +43,7 @@ One special persistence strategy is `restoreOnStartup` which will update the Ite
|
||||||
The good news here is that if you don't know what you may want to use persistence for, you can just keep the defaults and move to the next step.
|
The good news here is that if you don't know what you may want to use persistence for, you can just keep the defaults and move to the next step.
|
||||||
|
|
||||||
## Persistence Configuration
|
## Persistence Configuration
|
||||||
|
|
||||||
Each persistence add-on comes with it's own default persistence strategy.
|
Each persistence add-on comes with it's own default persistence strategy.
|
||||||
See the documentation for the specific persistence add-on for what the default strategy is.
|
See the documentation for the specific persistence add-on for what the default strategy is.
|
||||||
This default can be overridden.
|
This default can be overridden.
|
||||||
|
@ -54,12 +57,14 @@ One may not even want to save all their Items, or may want to save different Ite
|
||||||
For example, a common approach would be to use [`MapDB`]({{base}}/addons/persistence/mapdb/) only for those Items that should be restored on startup, [`rrd4j`]({{base}}/addons/persistence/rrd4j) with an `everyChange` and every minute strategy for number and binary (Switch, Contact) type Items that are to be charted, and [`Influxdb`]({{base}}/addons/persistence/influxdb) with an `everyUpdate` strategy for analysis with external tools.
|
For example, a common approach would be to use [`MapDB`]({{base}}/addons/persistence/mapdb/) only for those Items that should be restored on startup, [`rrd4j`]({{base}}/addons/persistence/rrd4j) with an `everyChange` and every minute strategy for number and binary (Switch, Contact) type Items that are to be charted, and [`Influxdb`]({{base}}/addons/persistence/influxdb) with an `everyUpdate` strategy for analysis with external tools.
|
||||||
|
|
||||||
## Default Persistence
|
## Default Persistence
|
||||||
|
|
||||||
openHAB ships with [`rrdj4`]({{base}}/addons/persistence/rrd4j) as the default persistence database and comes with a default persistence strategy of `everyChange`, `everyMinute`, and `restoreOnStartup` for every supported Item.
|
openHAB ships with [`rrdj4`]({{base}}/addons/persistence/rrd4j) as the default persistence database and comes with a default persistence strategy of `everyChange`, `everyMinute`, and `restoreOnStartup` for every supported Item.
|
||||||
The good thing about `rrd4j` is that the database never grows beyond a given size, so you never have to clean it up.
|
The good thing about `rrd4j` is that the database never grows beyond a given size, so you never have to clean it up.
|
||||||
However, the way it achieves this (replacing ten readings with the average of the ten readings as the data gets older) makes the database not work for all Item types.
|
However, the way it achieves this (replacing ten readings with the average of the ten readings as the data gets older) makes the database not work for all Item types.
|
||||||
If you need to `restoreOnStartup` unsupported Item types, `MapDB` might be a better choice for you.
|
If you need to `restoreOnStartup` unsupported Item types, `MapDB` might be a better choice for you.
|
||||||
|
|
||||||
## Why Bother with Persistence?
|
## Why Bother with Persistence?
|
||||||
|
|
||||||
The reason one would set up both the Model discussed in the previous tutorial and Persistence is that it will make creating your user interfaces much easier and much more rich.
|
The reason one would set up both the Model discussed in the previous tutorial and Persistence is that it will make creating your user interfaces much easier and much more rich.
|
||||||
For example, a set of UI pages will be created automatically in MainUI based on the model.
|
For example, a set of UI pages will be created automatically in MainUI based on the model.
|
||||||
And just about anyplace you can interact with an Item in MainUI, there will be an "Analyze" button that will generate a chart based on the data saved in persistence.
|
And just about anyplace you can interact with an Item in MainUI, there will be an "Analyze" button that will generate a chart based on the data saved in persistence.
|
||||||
|
|
|
@ -22,17 +22,20 @@ Instead, it is publishing metrics regularly on a preconfigured MQTT topic in a s
|
||||||
```json
|
```json
|
||||||
{"light": 5424, "moisture": 30, "temperature": 21.4, "conductivity": 1020, "battery": 100}
|
{"light": 5424, "moisture": 30, "temperature": 21.4, "conductivity": 1020, "battery": 100}
|
||||||
```
|
```
|
||||||
|
|
||||||
{::options toc_levels="2..4"/}
|
{::options toc_levels="2..4"/}
|
||||||
|
|
||||||
- TOC
|
- TOC
|
||||||
{:toc}
|
{:toc}
|
||||||
|
|
||||||
## Prerequisites
|
## 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/)
|
- 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)
|
- 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](https://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
|
## 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.
|
This device publishes JSON formatted messages, so we need to install an add-on that can process JSON: the JSONPath Transformation.
|
||||||
A Transformation takes incoming data and transformes is somehow.
|
A Transformation takes incoming data and transformes is somehow.
|
||||||
In this case it will extract certain fields from the JSON.
|
In this case it will extract certain fields from the JSON.
|
||||||
|
@ -52,6 +55,7 @@ Click on it, then click Install.
|
||||||
Wait for it to disappear from the list, then go back twice to return to the main Settings screen.
|
Wait for it to disappear from the list, then go back twice to return to the main Settings screen.
|
||||||
|
|
||||||
## Create the Bridge Thing
|
## Create the Bridge Thing
|
||||||
|
|
||||||
First we need to add the broker, which is a Bridge.
|
First we need to add the broker, which is a Bridge.
|
||||||
Click on Things.
|
Click on Things.
|
||||||
|
|
||||||
|
@ -68,6 +72,7 @@ If you need credentials to connect to the broker, click on "Show advanced" to re
|
||||||

|

|
||||||
|
|
||||||
## Create the Generic MQTT Thing
|
## Create the Generic MQTT Thing
|
||||||
|
|
||||||
Now we have to add the plant sensor itself as a generic Thing.
|
Now we have to add the plant sensor itself as a generic Thing.
|
||||||
|
|
||||||
On the Things page, first verify that the broker is indeed present and online; if so, click on the blue "+" button then on the MQTT Binding.
|
On the Things page, first verify that the broker is indeed present and online; if so, click on the blue "+" button then on the MQTT Binding.
|
||||||
|
|
|
@ -18,6 +18,7 @@ Scenario: you have some Z-Wave devices, including a wall plug and a rollershutte
|
||||||
{:toc}
|
{:toc}
|
||||||
|
|
||||||
## Install the Binding
|
## Install the Binding
|
||||||
|
|
||||||
From Settings, go to Things, then click the blue "+" button.
|
From Settings, go to Things, then click the blue "+" button.
|
||||||
|
|
||||||
We need to install the Z-Wave binding.
|
We need to install the Z-Wave binding.
|
||||||
|
@ -34,6 +35,7 @@ Wait for it to disappear from the list, then go back.
|
||||||

|

|
||||||
|
|
||||||
## Create the Bridge Thing
|
## Create the Bridge Thing
|
||||||
|
|
||||||
Click on the new option: Z-Wave Binding.
|
Click on the new option: Z-Wave Binding.
|
||||||
|
|
||||||
Click on Z-Wave Serial Controller to add the controller.
|
Click on Z-Wave Serial Controller to add the controller.
|
||||||
|
@ -48,6 +50,7 @@ In certain cases, depending on your system, you will be provided with a list of
|
||||||
Choose the correct port, alter the name and/or ID of the controller Thing, then click Add in the top-right corner.
|
Choose the correct port, alter the name and/or ID of the controller Thing, then click Add in the top-right corner.
|
||||||
|
|
||||||
## Discover Things
|
## Discover Things
|
||||||
|
|
||||||
Once back on the Things screen, click on the "+" button then on Z-Wave Binding again.
|
Once back on the Things screen, click on the "+" button then on Z-Wave Binding again.
|
||||||
Click scan and all the devices already paired with the Zwave controller will be discovered and appear in the Inbox.
|
Click scan and all the devices already paired with the Zwave controller will be discovered and appear in the Inbox.
|
||||||
To pair a new device, while on this screen, perform the procedure specific to the device to include it in your network.
|
To pair a new device, while on this screen, perform the procedure specific to the device to include it in your network.
|
||||||
|
|
|
@ -27,7 +27,6 @@ In this case, the Hue binding supports auto-discovery of both the bridge and the
|
||||||
- TOC
|
- TOC
|
||||||
{:toc}
|
{:toc}
|
||||||
|
|
||||||
|
|
||||||
## Install the Binding
|
## Install the Binding
|
||||||
|
|
||||||
After logging in as an administrator, click on `Settings` from the sidebar, then click on `Things`.
|
After logging in as an administrator, click on `Settings` from the sidebar, then click on `Things`.
|
||||||
|
@ -112,6 +111,7 @@ You can either click on an individual thing to see actions related to it, or you
|
||||||

|

|
||||||
|
|
||||||
These actions are:
|
These actions are:
|
||||||
|
|
||||||
- Approve: To promote the candidate from the Inbox to a Thing.
|
- Approve: To promote the candidate from the Inbox to a Thing.
|
||||||
- Ignore: To hide the candidate from the list (you will be able to see it again and un-ignore it by clicking on "Show ignored" above the list).
|
- Ignore: To hide the candidate from the list (you will be able to see it again and un-ignore it by clicking on "Show ignored" above the list).
|
||||||
- Remove: To remove the candidate from the Inbox (it might be detected again later).
|
- Remove: To remove the candidate from the Inbox (it might be detected again later).
|
||||||
|
|
Loading…
Reference in New Issue