Merge commit '0fee8ff11cb8adcc41d97cf46b336566d80aae07' into HEAD
commit
47490455a9
|
@ -27,7 +27,7 @@ When the result of the commandString is to change the state of an Item without c
|
|||
|
||||
As a general rule, is better to call `MyItem.sendCommand(command)` and `MyItem.postUpdate(command)` where possible because the Item methods are able to handle a wider variety of commands appropriately. The Actions are best reserved for use in cases where the Item's name is determined at runtime.
|
||||
|
||||
- `Map<Item, State> storeStates(Item item1, Item item2, ... Item itemn)`: Returns a `Map<Item, State>` with the current state of each Item. All members of Groups are put into the Map but not the Group's state itself.
|
||||
- `Map<Item, State> storeStates(Item item1, Item item2, ... Item item<n>)`: Returns a `Map<Item, State>` with the current state of each Item. All members of Groups are put into the Map but not the Group's state itself.
|
||||
- `restoreStates(Map<Item, State> statesMap)`: Restores the items' states from the map. If the saved state can be interpreted as a command (ON/OFF/etc.), a command is sent to the Item. Otherwise an update is sent to the Item.
|
||||
|
||||
### Audio & Voice Actions
|
||||
|
|
|
@ -6,7 +6,7 @@ title: Transformations
|
|||
# Transformations
|
||||
|
||||
Transformations are used to translate data from a cluttered or technical raw value to a processed or human-readable representation.
|
||||
They are often useful, to **interpret received Item values**, like sensor readings or state variables, and to translate them into a human-readable or better processible format.
|
||||
They are often useful, to **interpret received Item values**, like sensor readings or state variables, and to translate them into a human-readable or better processable format.
|
||||
|
||||
**Examples:**
|
||||
|
||||
|
|
|
@ -19,36 +19,36 @@ User interfaces can parse this category to get an idea how to render this Thing.
|
|||
A Binding can classify each Thing into one of the existing categories.
|
||||
The list of all predefined categories can be found in our categories overview:
|
||||
|
||||
| Category | Description | Icon Example |
|
||||
|------------------|------------------------------------------------------------------------------------------------------|-----------------|
|
||||
| Battery | Batteries, Energy Storages |  |
|
||||
| Blinds | Roller shutters, window blinds, etc. |  |
|
||||
| Camera | All kinds of cameras |  |
|
||||
| Car | Smart Cars | |
|
||||
| CleaningRobot | Vacuum robots, mopping robots, etc. | |
|
||||
| Door | Door |  |
|
||||
| FrontDoor | Front Door |  |
|
||||
| GarageDoor | Garage Door |  |
|
||||
| HVAC | Air condition devices, Fans | |
|
||||
| Inverter | Power inverter, such as solar inverters etc. | |
|
||||
| LawnMower | Lawn mowing robots, etc. |  |
|
||||
| Lightbulb | Devices that illuminate something, such as bulbs, etc. |  |
|
||||
| Lock | Devices whose primary pupose is locking something |  |
|
||||
| MotionDetector | Motion sensors/detectors | |
|
||||
| NetworkAppliance | Bridges/Gateway need to access other devices like used by Philips Hue for example, Routers, Switches | |
|
||||
| Category | Description | Icon Example |
|
||||
| ---------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
|
||||
| Battery | Batteries, Energy Storages |  |
|
||||
| Blinds | Roller shutters, window blinds, etc. |  |
|
||||
| Camera | All kinds of cameras |  |
|
||||
| Car | Smart Cars | |
|
||||
| CleaningRobot | Vacuum robots, mopping robots, etc. | |
|
||||
| Door | Door |  |
|
||||
| FrontDoor | Front Door |  |
|
||||
| GarageDoor | Garage Door |  |
|
||||
| HVAC | Air condition devices, Fans | |
|
||||
| Inverter | Power inverter, such as solar inverters etc. | |
|
||||
| LawnMower | Lawn mowing robots, etc. |  |
|
||||
| Lightbulb | Devices that illuminate something, such as bulbs, etc. |  |
|
||||
| Lock | Devices whose primary purpose is locking something |  |
|
||||
| MotionDetector | Motion sensors/detectors | |
|
||||
| NetworkAppliance | Bridges/Gateway need to access other devices like used by Philips Hue for example, Routers, Switches | |
|
||||
| PowerOutlet | Small devices to be plugged into a power socket in a wall which stick there |  |
|
||||
| Projector | Devices that project a picture somewhere |  |
|
||||
| RadiatorControl | Controls on radiators used to heat up rooms | |
|
||||
| Receiver | Audio/Video receivers, i.e. radio receivers, satelite or cable receivers, recorders, etc. |  |
|
||||
| Screen | Devices that are able to show a picture |  |
|
||||
| Sensor | Device used to measure something | |
|
||||
| Siren | Siren used by Alarm systems |  |
|
||||
| SmokeDetector | Smoke detectors | |
|
||||
| Speaker | Devices that are able to play sounds | |
|
||||
| WallSwitch | Any device attached to the wall that controls a binary status of something, for ex. a light switch |  |
|
||||
| WebService | Account with credentials for a website | |
|
||||
| Window | Window |  |
|
||||
| WhiteGood | Devices that look like Waschingmachines, Dishwashers, Dryers, Fridges, Ovens, etc. |  |
|
||||
| Projector | Devices that project a picture somewhere |  |
|
||||
| RadiatorControl | Controls on radiators used to heat up rooms | |
|
||||
| Receiver | Audio/Video receivers, i.e. radio receivers, satelite or cable receivers, recorders, etc. |  |
|
||||
| Screen | Devices that are able to show a picture |  |
|
||||
| Sensor | Device used to measure something | |
|
||||
| Siren | Siren used by Alarm systems |  |
|
||||
| SmokeDetector | Smoke detectors | |
|
||||
| Speaker | Devices that are able to play sounds | |
|
||||
| WallSwitch | Any device attached to the wall that controls a binary status of something, for ex. a light switch |  |
|
||||
| WebService | Account with credentials for a website | |
|
||||
| Window | Window |  |
|
||||
| WhiteGood | Devices that look like Waschingmachines, Dishwashers, Dryers, Fridges, Ovens, etc. |  |
|
||||
|
||||
### Channel Group Categories
|
||||
|
||||
|
@ -62,70 +62,70 @@ There are different types of categories for Channels, which are listed below.
|
|||
|
||||
### Widgets
|
||||
|
||||
| Category | Icon Example |
|
||||
|---------------|------------------------------------------|
|
||||
| Colorpicker |  |
|
||||
| Number |  |
|
||||
| Category | Icon Example |
|
||||
| ------------- | ----------------------------------------------------- |
|
||||
| Colorpicker |  |
|
||||
| Number |  |
|
||||
| Rollershutter |  |
|
||||
| Slider |  |
|
||||
| Switch |  |
|
||||
| Text |  |
|
||||
| Group |  |
|
||||
| Slider |  |
|
||||
| Switch |  |
|
||||
| Text |  |
|
||||
| Group |  |
|
||||
|
||||
#### Weather
|
||||
|
||||
| Category | Icon Example |
|
||||
|-------------|----------------------------------------|
|
||||
| Sun |  |
|
||||
| Moon |  |
|
||||
| Clouds |  |
|
||||
| Sun_Clouds |  |
|
||||
| Rain |  |
|
||||
| Snow |  |
|
||||
| Wind |  |
|
||||
| Humidity |  |
|
||||
| Category | Icon Example |
|
||||
| ----------- | ------------------------------------------------- |
|
||||
| Sun |  |
|
||||
| Moon |  |
|
||||
| Clouds |  |
|
||||
| Sun_Clouds |  |
|
||||
| Rain |  |
|
||||
| Snow |  |
|
||||
| Wind |  |
|
||||
| Humidity |  |
|
||||
| Temperature |  |
|
||||
|
||||
#### Properties
|
||||
|
||||
| Category | Icon Example |
|
||||
|------------------|---------------------------------------------|
|
||||
| BatteryLevel |  |
|
||||
| LowBattery |  |
|
||||
| CarbonDioxide |  |
|
||||
| Energy |  |
|
||||
| Gas |  |
|
||||
| Oil |  |
|
||||
| Water |  |
|
||||
| Light |  |
|
||||
| ColorLight |  |
|
||||
| Temperature |  |
|
||||
| Smoke |  |
|
||||
| SoundVolume |  |
|
||||
| Pressure |  |
|
||||
| Fire |  |
|
||||
| Motion |  |
|
||||
| Category | Icon Example |
|
||||
| ---------------- | ----------------------------------------------------------- |
|
||||
| BatteryLevel |  |
|
||||
| LowBattery |  |
|
||||
| CarbonDioxide |  |
|
||||
| Energy |  |
|
||||
| Gas |  |
|
||||
| Oil |  |
|
||||
| Water |  |
|
||||
| Light |  |
|
||||
| ColorLight |  |
|
||||
| Temperature |  |
|
||||
| Smoke |  |
|
||||
| SoundVolume |  |
|
||||
| Pressure |  |
|
||||
| Fire |  |
|
||||
| Motion |  |
|
||||
| QualityOfService |  |
|
||||
| Moisture |  |
|
||||
| Noise |  |
|
||||
| Flow |  |
|
||||
| Price |  |
|
||||
| Time |  |
|
||||
| Moisture |  |
|
||||
| Noise |  |
|
||||
| Flow |  |
|
||||
| Price |  |
|
||||
| Time |  |
|
||||
|
||||
#### Control
|
||||
|
||||
| Category | Icon Example |
|
||||
|--------------|-----------------------------------------|
|
||||
| Heating |  |
|
||||
| Category | Icon Example |
|
||||
| ------------ | --------------------------------------------------- |
|
||||
| Heating |  |
|
||||
| MediaControl |  |
|
||||
| MoveControl |  |
|
||||
| Zoom |  |
|
||||
| MoveControl |  |
|
||||
| Zoom |  |
|
||||
|
||||
#### Purpose
|
||||
|
||||
| Category | Icon Example |
|
||||
|----------|-------------------------------------|
|
||||
| Alarm |  |
|
||||
| Category | Icon Example |
|
||||
| -------- | ------------------------------------------- |
|
||||
| Alarm |  |
|
||||
| Presence |  |
|
||||
| Vacation |  |
|
||||
| Party |  |
|
||||
| Party |  |
|
||||
|
|
|
@ -6,7 +6,7 @@ openHAB is about home automation, but to create home automation we need to defin
|
|||
|
||||
## What Are Rules
|
||||
|
||||
You can think of rules as routines or behaviours for your smart home.
|
||||
You can think of rules as routines or behaviors for your smart home.
|
||||
|
||||
Many people have a routine when they wake up in the morning: make the bed, make coffee, make and eat breakfast, brush their teeth, etc.
|
||||
Similarly your smart home can have a routine: when the sun rises raise the blinds and adjust the temperature.
|
||||
|
@ -30,8 +30,8 @@ Note that both \_\_t\_\_ and \_\_c\_\_ can be optional.
|
|||
|
||||
To work with the _When \_\_t\_\_ happens, if \_\_c\_\_ then do \_\_a\_\__ principle, openHAB rules consist of three parts:
|
||||
|
||||
| Name | Rule Part | Purpose |
|
||||
|-------------|----------------------|----------------------------------------------------------|
|
||||
| Name | Rule Part | Purpose |
|
||||
| ----------- | ------------------------ | -------------------------------------------------------- |
|
||||
| `Trigger` | _When \_\_t\_\_ happens_ | Causes the rule run when the defined event happens. |
|
||||
| `Condition` | _if \_\_c\_\__ | Which condition has to be met that the rule really runs? |
|
||||
| `Action` | _then do \_\_a\_\__ | What should be done when the rule runs? |
|
||||
|
@ -56,7 +56,7 @@ Triggers define those events that, when they occur, causes the rule to run.
|
|||
These are the categories of rules that can be used to trigger a rule:
|
||||
|
||||
| Event | Description |
|
||||
|-------------|------------------------------------------------------------------------------------------------------------------------------|
|
||||
| ----------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Items** | Commands, updates, and changes on an individual Item's state. |
|
||||
| **Groups** | Groups are special Items that have other Items as members. Rules can be triggered on any Item event from any of its members. |
|
||||
| **Time** | Rules can trigger based on specific times. |
|
||||
|
@ -112,14 +112,14 @@ Therefore, if the rule needs to know what the command was, there is an [Availabl
|
|||
Time Triggers are provided as described in the table below, support may vary on the used rule language:
|
||||
|
||||
| Trigger | Description |
|
||||
|------------------|-------------------------------------------------------------------------------------------------------------------------------|
|
||||
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
||||
| cron expressions | cron allows you to create nearly any schedule you can think of, e.g. every second sunday in November and December at 04:05 h. |
|
||||
| Time is Item | It is a date and a time specified in a DateTime Item. |
|
||||
| Time is Item | It is a date and a time specified in a DateTime Item. |
|
||||
| Time of Day | It is a fixed time of the day, e.g. 09:00 h. |
|
||||
|
||||
Time triggers do not provide any information in the [Available Values](#available-values).
|
||||
|
||||
Please be aware that openHAB is using the [Quartz Scheduler](https://www.quartz-scheduler.org/documentation/quartz-2.2.2/), which is using a slighly different form than the Unix cron scheduler, for [cron expressions](https://www.quartz-scheduler.org/documentation/quartz-2.2.2/tutorials/tutorial-lesson-06.html).
|
||||
Please be aware that openHAB is using the [Quartz Scheduler](https://www.quartz-scheduler.org/documentation/quartz-2.2.2/), which is using a slightly different form than the Unix cron scheduler, for [cron expressions](https://www.quartz-scheduler.org/documentation/quartz-2.2.2/tutorials/tutorial-lesson-06.html).
|
||||
A Quartz cron expression takes the form of six or optionally seven fields:
|
||||
|
||||
1. Seconds
|
||||
|
@ -169,7 +169,7 @@ You may wish to use some start level to initialize values at startup if they are
|
|||
You can then execute a rule on the next startup level which depends on the value set by the initialization rule.
|
||||
|
||||
| Start level | Meaning |
|
||||
|-------------|----------------------------------------------------------------------------------------------------------------|
|
||||
| ----------- | -------------------------------------------------------------------------------------------------------------- |
|
||||
| 00 | OSGi framework has been started. |
|
||||
| 10 | OSGi application start level has been reached, i.e. bundles are activated. |
|
||||
| 20 | Model entities (Items, Things, channel links, persist config) have been loaded, both from DB as well as files. |
|
||||
|
@ -229,7 +229,7 @@ Text based rules will typically allow only a single script action to be defined
|
|||
When a rule is triggered, some information about the event that triggered the rule is provided to the rule.
|
||||
There are many cases in which it is useful to know what triggered your rule, e.g. you have an Item group as trigger and you need to know which Group member triggered the rule.
|
||||
|
||||
The availablity of those values depends on the rule engine, but you can generally expect at least the following information (depending on the trigger):
|
||||
The availability of those values depends on the rule engine, but you can generally expect at least the following information (depending on the trigger):
|
||||
|
||||
- The name of triggering Item.
|
||||
- The command that the triggering Item received.
|
||||
|
@ -255,7 +255,7 @@ To instantiate a rule template, navigate to _Rules_ and click the blue `+` icon.
|
|||
Fill out the rule's metadata as usual and select an installed rule template from the _Create from Template_ section.
|
||||
Choose the rule template, and fill out the template configuration.
|
||||
|
||||
Once a rule is created, it is seperated from its template and can be further customized.
|
||||
Once a rule is created, it is separated from its template and can be further customized.
|
||||
To update a rule template, return to the Automation menu in MainUI, select the rule template, remove it and then readd it.
|
||||
Then to update a rule from the template, delete the rule(s) that were instantiated from the template and recreate them.
|
||||
Note, when clicking on the "Code" tab of the rule, the properties used when instantiating the rule are preserved in the configuration section.
|
||||
|
@ -566,7 +566,7 @@ rules.JSRule({
|
|||
|
||||

|
||||
|
||||
The script action in detail (for the scipt see the YAML):
|
||||
The script action in detail (for the script see the YAML):
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ After saving the file, the add-on will be installed.
|
|||
## Through manually provided add-ons
|
||||
|
||||
::: warning Attention
|
||||
This option is adressed to advanced users.
|
||||
This option is addressed to advanced users.
|
||||
Installing add-on's with a `.jar`file can lead to problems, because add-on dependencies may not be installed.
|
||||
Please make sure to use this option only in special cases (like add-on testing for an upcoming version) or when you know what you are doing.
|
||||
:::
|
||||
|
|
|
@ -197,7 +197,7 @@ You can achieve the exact same result with the following but it looks more bulky
|
|||
This block also provides a temporal value to the main block but it contains an additional indirection for the value of the temporal block.
|
||||
While the first block only takes a constant, this block allows and even requires the value to be provided by another block which in the standard case is a number block.
|
||||
|
||||
Using just the number would be the same like providing a constant value but instead, any number-returning block can be used, hence any math operation can be applied like depicted inte following image:
|
||||
Using just the number would be the same like providing a constant value but instead, any number-returning block can be used, hence any math operation can be applied like depicted into following image:
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ The ephemeris category provides blocks with calendar functionality.
|
|||
The blocks can be used to determine what type of day today is, or a number of days before or after today is.
|
||||
For example, a way to determine if today is a weekend, a bank holiday, someone’s birthday, trash day, etc.
|
||||
|
||||
Definition of holidays can be customised through the _ephemeris.cfg_ file.
|
||||
Definition of holidays can be customized through the _ephemeris.cfg_ file.
|
||||
See the [Ephemeris configuration page](https://www.openhab.org/docs/configuration/actions.html#configuration) for more information.
|
||||
|
||||
[[toc]]
|
||||
|
|
|
@ -118,7 +118,7 @@ The following example depicts the above possibilities:
|
|||
Function: Gets all items with the given tags which you can iterate over via a loop
|
||||
|
||||
- returns a collection of items which have the given tags
|
||||
- multiple tags can be provided which then need to be separared with a comma
|
||||
- multiple tags can be provided which then need to be separated with a comma
|
||||
- if multiple tags are given, the item must have all of the tags ("and"-condition)
|
||||
|
||||
:::tip
|
||||
|
|
|
@ -46,7 +46,7 @@ This method uses a time-weighted average calculation
|
|||
- maximum: gets the maximum value of the State of the given Item since a certain point in time
|
||||
- maximum: gets the sum of the State of the given Item since a certain point in time
|
||||
|
||||
In the case of the following two functions the block changes its appearence by replacing the time with an option to chose if the equal value should be skipped or not:
|
||||
In the case of the following two functions the block changes its appearance by replacing the time with an option to chose if the equal value should be skipped or not:
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ _Example_
|
|||
|
||||
The following simple example uses a loop to implement a blinking light with a 1 second delay, looping three times:
|
||||
|
||||

|
||||

|
||||
|
||||
More about that topic can be viewed at  [Waiting in Rules](https://youtu.be/EdllUlJ7p6k?t=1600)
|
||||
|
||||
|
@ -126,7 +126,7 @@ The retrigger timer-block inserts an additional `else{}` branch into the generat
|
|||
- the timer already exists and
|
||||
- the timer has not yet finished (it's still ticking)
|
||||
|
||||
In the case of _do nothing_ the `else{}` branch is empty (which turns to be almost equals to the simle-timer).
|
||||
In the case of _do nothing_ the `else{}` branch is empty (which turns to be almost equals to the simple-timer).
|
||||
|
||||
```javascript
|
||||
if (typeof this.timers['nothingTimerBlock'] === 'undefined' || this.timers['nothingTimerBlock'].hasTerminated()) {
|
||||
|
|
|
@ -35,7 +35,7 @@ You can find it in the [Microsoft Visual Studio Marketplace](https://marketplace
|
|||

|
||||
1. Search for openHAB and install the extension.
|
||||
|
||||
[Visit the Extensions GitHub Page for further Informations](https://github.com/openhab/openhab-vscode/blob/main/README.md "GitHub Repo for the VS Code Extension")
|
||||
[Visit the Extensions GitHub Page for further Information](https://github.com/openhab/openhab-vscode/blob/main/README.md "GitHub Repo for the VS Code Extension")
|
||||
|
||||
### Rule Validation
|
||||
|
||||
|
@ -76,7 +76,7 @@ You can find the syntax file and installation instructions on [openhab-syntax-te
|
|||
|
||||
### BBEdit
|
||||
|
||||
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 official successor of TextWrangler.
|
||||
You can find the syntax file and installation instructions on [BBEdit-openHAB-language](https://github.com/mjmeijer/BBEdit-openHAB-language).
|
||||
|
||||
### Emacs
|
||||
|
|
|
@ -139,7 +139,7 @@ _Note there is an option in Main UI to bulk create Items where you can copy'n'pa
|
|||
|
||||
Don't confuse admin UI and user UI.
|
||||
Happens to many people as you can access both from the common UI entry point running on port 8080.
|
||||
User UI is what can be providedd to users of your home so they can interactively command the house.
|
||||
User UI is what can be provided to users of your home so they can interactively command the house.
|
||||
It's the equivalent of sitemaps in older OH versions.
|
||||
This docs section is all about admin UI to create Things and Items, it does not cover building user interfaces.
|
||||
See [User Interfaces](/docs/ui/) for that.
|
||||
|
|
|
@ -92,7 +92,7 @@ This optimization is reflected in the data and command types.
|
|||
Available Item types are:
|
||||
|
||||
| Item Name | Description | Command Types |
|
||||
|--------------------|--------------------------------------------------------------------|-----------------------------------------------------|
|
||||
| ------------------ | ------------------------------------------------------------------ | --------------------------------------------------- |
|
||||
| Call | Identify phone calls | Refresh |
|
||||
| Color | Color information (RGB) | OnOff, IncreaseDecrease, Percent, HSB, Refresh |
|
||||
| Contact | Item storing status of e.g. door/window contacts | OpenClosed, Refresh |
|
||||
|
@ -170,10 +170,10 @@ The following naming style guide is recommended:
|
|||
Examples:
|
||||
|
||||
| Item Name | Interpretation (assumed Item type, example value) |
|
||||
|-----------------------------------|---------------------------------------------------------------------------------------------------------|
|
||||
| --------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
||||
| "`Livingroom_CeilingLight`" | Living room light (Switch, e.g. ON) |
|
||||
| "`Livingroom_CeilingLight_Color`" | Living room light color (Color, e.g. warm white) |
|
||||
| "`GF_BR_WashingMachine_Power`" | Electric power consumed by the washing machine located in the ground floor bathroom (Number, e.g. 100W) |
|
||||
| "`GF_BR_WashingMachine_Power`" | Electric power consumed by the washing machine located in the ground floor bathroom (Number, e.g. 100W) |
|
||||
| "`Lighting_Scene`" | Overall lighting scene of the house (String, e.g. Party) |
|
||||
| "`Presence_John_Smartphone`" | An Item indicating if John is home or not, based on smartphone detection (Switch, e.g. Offline) |
|
||||
|
||||
|
@ -186,7 +186,7 @@ Two naming schemes are established in the community for Group names:
|
|||
1. Prepend a lowercase "g" to the name (e.g. gBattery)
|
||||
|
||||
| Group Name | Interpretation |
|
||||
|-------------------------------------------|-----------------------------------------------------------------------|
|
||||
| ----------------------------------------- | --------------------------------------------------------------------- |
|
||||
| "`Batteries`" or "`gBattery`" | Group combining the states of all battery Items |
|
||||
| "`Maintenance_Group`" or "`gMaintenance`" | Group containing all maintenance-related Items |
|
||||
| "`Livingroom_Lights`" or "`gLR_Light`" | Group containing all light Items belonging to the living room |
|
||||
|
@ -361,13 +361,13 @@ String Livingroom_Light_Connection "Livingroom Ceiling Light [MAP(error.map):%s]
|
|||
On the filesystem, the following icon files are provided by the user:
|
||||
|
||||
| File name | Description |
|
||||
|--------------------|------------------------------------------------------------------|
|
||||
| ------------------ | ---------------------------------------------------------------- |
|
||||
| `myswitch-off.svg` | Matches `OFF` or "off" state |
|
||||
| `myswitch-on.svg` | Matches `ON` or "on" state |
|
||||
| `myswitch.svg` | Default icon, used when no matching icon is found (e.g. `UNDEF`) |
|
||||
|
||||
| File name | Description |
|
||||
|------------------------|--------------------------------------------------------------------|
|
||||
| ---------------------- | ------------------------------------------------------------------ |
|
||||
| `myerror-no_fault.svg` | Matches `NO_FAULT` state |
|
||||
| `myerror.svg` | Default icon, used when Item in other state (e.g. `CONNECT_ERROR`) |
|
||||
|
||||
|
@ -380,7 +380,7 @@ Dimmer type Items work in the same way, being limited to 0-100 anyway.
|
|||
|
||||
For a dimmable light (0-100%), you might provide icons as in the example:
|
||||
| File name | Description |
|
||||
|-------------------|------------------------------------------------------|
|
||||
| ----------------- | ---------------------------------------------------- |
|
||||
| `mydimmer.svg` | Default icon (used in undefined states) |
|
||||
| `mydimmer-0.svg` | Matches the turned off light (0%) |
|
||||
| `mydimmer-1.svg` | Matches any dimmed light between 1% up to 74% |
|
||||
|
@ -456,13 +456,13 @@ Group[:itemtype[:function]] groupname ["labeltext"] [<iconname>] [(group1, group
|
|||
|
||||
Group state aggregation functions can be any of the following:
|
||||
|
||||
| | Function | Parameters | Base Item | Description | |
|
||||
|---|----------------------------|-------------------------------|---------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
|
||||
| | `EQUALITY` | - | \<all\> | Default if no function is specified. Sets the state of the members if all have equal state. Otherwise `UNDEF` is set. In the Item DSL `EQUALITY` is the default and may be omitted. | |
|
||||
| | `AND`, `OR`, `NAND`, `NOR` | <activeState>, <passiveState> | \<all\> (must match active & passive state) | [Boolean](https://en.wikipedia.org/wiki/Boolean_algebra) operation. Sets the \<activeState\>, if the members state \<activeState\> evaluates to `true` under the boolean term. Otherwise the \<passiveState\> is set. | |
|
||||
| | `SUM`, `AVG`, `MIN`, `MAX` | - | Number | [Arithmetic](https://en.wikipedia.org/wiki/Arithmetic) operation. Sets the state according to the arithmetic function over all members states. | |
|
||||
| | `COUNT` | <regular expression> | Number | Sets the state to the number of members matching the given regular expression with their states. | |
|
||||
| | `LATEST`, `EARLIEST` | - | DateTime | Sets the state to the latest/earliest date from all members states | |
|
||||
| | Function | Parameters | Base Item | Description | |
|
||||
| --- | -------------------------- | ----------------------------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- |
|
||||
| | `EQUALITY` | - | \<all\> | Default if no function is specified. Sets the state of the members if all have equal state. Otherwise `UNDEF` is set. In the Item DSL `EQUALITY` is the default and may be omitted. | |
|
||||
| | `AND`, `OR`, `NAND`, `NOR` | <activeState>, <passiveState> | \<all\> (must match active & passive state) | [Boolean](https://en.wikipedia.org/wiki/Boolean_algebra) operation. Sets the \<activeState\>, if the members state \<activeState\> evaluates to `true` under the boolean term. Otherwise the \<passiveState\> is set. | |
|
||||
| | `SUM`, `AVG`, `MIN`, `MAX` | - | Number | [Arithmetic](https://en.wikipedia.org/wiki/Arithmetic) operation. Sets the state according to the arithmetic function over all members states. | |
|
||||
| | `COUNT` | <regular expression> | Number | Sets the state to the number of members matching the given regular expression with their states. | |
|
||||
| | `LATEST`, `EARLIEST` | - | DateTime | Sets the state to the latest/earliest date from all members states | |
|
||||
|
||||
Boolean group state functions additionally return a number representing the count of member Items of value 'value1' (see example below).
|
||||
|
||||
|
@ -664,7 +664,7 @@ Some Bindings may offer additional Profiles for Binding-specific use cases.
|
|||
If this is the case, you will find those within the documentation of the Binding.
|
||||
|
||||
| Profile ID | Type | Supported Item Types | Description |
|
||||
|-----------------------------------------------------------------------------------------------|---------|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| --------------------------------------------------------------------------------------------- | ------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `default` | State | All | If you don't specify any Profile, this Profile will be used. For State Channels, this means that states and commands are just propagated from the Channel to the Item and vice versa without any changes. For Trigger Channels, the Default Profile won't change anything on the Item. |
|
||||
| `follow` | State | All | If one device should "follow" the actions of another device, this can be used. The term "follow" in this case means that any state that is sent to an Item will be forwarded from this Item to any linked Channel with the `follow` Profile. It takes state updates on an Item and sends them as a command onto the Channel. In the direction from the ThingHandler towards the Item, this Profile ignores state updates. |
|
||||
| `hysteresis` | State | Switch | The `hysteresis` Profile can be configured via three parameters: `lower` (**mandatory**) `QuantityType` or `DecimalType`, `upper` (optional) `QuantityType` or `DecimalType`, `inverted` (optional) `boolean`. This Profile can be used to trigger alarms when number values exceed a given `lower` bound - sends `ON` to the Switch Item. By defining an additional `upper` bound it can provide kind of anti-flapping. The `inverted` parameter negates the resulting State of the Switch. |
|
||||
|
@ -727,7 +727,7 @@ So with Profiles, you can significantly reduce the amount of Rules you need for
|
|||
Number:Temperature Outdoor_Temperature { channel="openweathermap:weather-and-forecast:api:local:current#temperature" }
|
||||
// Triggers a temperature high alarm (Switch = ON) as of 30 °c and stays ON until temperature drops below 29 °C
|
||||
Switch Outdoor_Temperature_High_Alert { channel="openweathermap:weather-and-forecast:api:local:current#temperature" [profile="system:hysteresis", lower="29 °C", upper="30 °C"] }
|
||||
// Temperture low alert below 0 °C
|
||||
// Temperature low alert below 0 °C
|
||||
Switch Outdoor_Temperature_Low_Alert { channel="openweathermap:weather-and-forecast:api:local:current#temperature" [profile="system:hysteresis", lower="0 °C", inverted="true"] }
|
||||
|
||||
/** Battery Level Profile **/
|
||||
|
|
|
@ -221,7 +221,7 @@ Note that prior to openHAB 3, script ordering was performed alphanumerically bas
|
|||
|
||||
### `ScriptExtension` Objects (all JSR223 languages)
|
||||
|
||||
To faciliate JSR223 scripting, several openHAB-related variables are automatically predefined within `ScriptExtension` presets.
|
||||
To facilitate JSR223 scripting, several openHAB-related variables are automatically predefined within `ScriptExtension` presets.
|
||||
They can be loaded into the script context using `scriptExtension.importPreset(String preset)`, e.g. `scriptExtension.importPreset("RuleSimple")`.
|
||||
The `default` preset is preloaded, so it does not require importing.
|
||||
|
||||
|
@ -232,67 +232,67 @@ The `default` preset is preloaded, so it does not require importing.
|
|||
|
||||
#### Default Preset (`importPreset` not required)
|
||||
|
||||
| Variable | Description |
|
||||
| ----------------------- | --------------------------------------------------------------------------------------- |
|
||||
| `State` | `org.openhab.core.types.State` |
|
||||
| `Command` | `org.openhab.core.types.Command` |
|
||||
| `URLEncoder` | `java.net.URLEncoder` |
|
||||
| `File` | `java.io.File` |
|
||||
| `Files` | `java.nio.file.Files` |
|
||||
| `Path` | `java.nio.file.Path` |
|
||||
| `Paths` | `java.nio.file.Paths` |
|
||||
| `IncreaseDecreaseType` | `org.openhab.core.library.types.IncreaseDecreaseType` |
|
||||
| `DECREASE` | `IncreaseDecreaseType` enum item |
|
||||
| `INCREASE` | `IncreaseDecreaseType` enum item |
|
||||
| `OnOffType` | `org.openhab.core.library.types.OnOffType` |
|
||||
| `ON` | `OnOffType` enum item |
|
||||
| `OFF` | `OnOffType` enum item |
|
||||
| `OpenClosedType` | `org.openhab.core.library.types.OpenClosedType` |
|
||||
| `OPEN` | `OpenClosedType` enum item |
|
||||
| `CLOSED` | `OpenClosedType` enum item |
|
||||
| `StopMoveType` | `org.openhab.core.library.types.StopMoveType` |
|
||||
| `STOP` | `StopMoveType` enum item |
|
||||
| `MOVE` | `StopMoveType` enum item |
|
||||
| `UpDownType` | `org.openhab.core.library.types.UpDownType` |
|
||||
| `UP` | `UpDownType` enum item |
|
||||
| `DOWN` | `UpDownType` enum item |
|
||||
| `UnDefType` | `org.openhab.core.library.types.UnDefType` |
|
||||
| `NULL` | `UnDefType` enum item |
|
||||
| `UNDEF` | `UnDefType` enum item |
|
||||
| `RefreshType` | `org.openhab.core.library.types.RefreshType` |
|
||||
| `REFRESH` | `RefreshType` enum item |
|
||||
| `NextPreviousType` | `org.openhab.core.library.types.NextPreviusType` |
|
||||
| `NEXT` | `NextPreviousType` enum item |
|
||||
| `PREVIOUS` | `NextPreviousType` enum item |
|
||||
| `PlayPauseType` | `org.openhab.core.library.types.PlayPauseType` |
|
||||
| `PLAY` | `PlayPauseType` enum item |
|
||||
| `PAUSE` | `PlayPauseType` enum item |
|
||||
| `RewindFastforwardType` | `org.openhab.core.library.types.RewindFastforwardType` |
|
||||
| `REWIND` | `RewindFastforwardType` enum item |
|
||||
| `FASTFORWARD` | `RewindFastforwardType` enum item |
|
||||
| `QuantityType` | `org.openhab.core.library.types.QuantityType` |
|
||||
| `StringListType` | `org.openhab.core.library.types.StringListType` |
|
||||
| `RawType` | `org.openhab.core.library.types.RawType` |
|
||||
| `DateTimeType` | `org.openhab.core.library.types.DateTimeType` |
|
||||
| `DecimalType` | `org.openhab.core.library.types.DecimalType` |
|
||||
| `HSBType` | `org.openhab.core.library.types.HSBType` |
|
||||
| `PercentType` | `org.openhab.core.library.types.PercentType` |
|
||||
| `PointType` | `org.openhab.core.library.types.PointType` |
|
||||
| `StringType` | `org.openhab.core.library.types.StringType` |
|
||||
| `SIUnits` | `org.openhab.core.library.unit.SIUnits` |
|
||||
| `ImperialUnits` | `org.openhab.core.library.unit.ImperialUnits` |
|
||||
| `MetricPrefix` | `org.openhab.core.library.unit.MetricPrefix` |
|
||||
| `Units` | `org.openhab.core.library.unit.Units` |
|
||||
| `BinaryPrefix` | `org.openhab.core.library.unit.BinaryPrefix` |
|
||||
| `items` | Instance of `java.util.Map<String, State>` |
|
||||
| `ir` | Alias for `itemRegistry` |
|
||||
| `itemRegistry` | Instance of `org.openhab.core.items.ItemRegistry` |
|
||||
| `things` | Instance of `org.openhab.core.thing.ThingRegistry` |
|
||||
| `rules` | Instance of `org.openhab.core.automation.RuleRegistry` |
|
||||
| Variable | Description |
|
||||
| ----------------------- | ---------------------------------------------------------------------------------------- |
|
||||
| `State` | `org.openhab.core.types.State` |
|
||||
| `Command` | `org.openhab.core.types.Command` |
|
||||
| `URLEncoder` | `java.net.URLEncoder` |
|
||||
| `File` | `java.io.File` |
|
||||
| `Files` | `java.nio.file.Files` |
|
||||
| `Path` | `java.nio.file.Path` |
|
||||
| `Paths` | `java.nio.file.Paths` |
|
||||
| `IncreaseDecreaseType` | `org.openhab.core.library.types.IncreaseDecreaseType` |
|
||||
| `DECREASE` | `IncreaseDecreaseType` enum item |
|
||||
| `INCREASE` | `IncreaseDecreaseType` enum item |
|
||||
| `OnOffType` | `org.openhab.core.library.types.OnOffType` |
|
||||
| `ON` | `OnOffType` enum item |
|
||||
| `OFF` | `OnOffType` enum item |
|
||||
| `OpenClosedType` | `org.openhab.core.library.types.OpenClosedType` |
|
||||
| `OPEN` | `OpenClosedType` enum item |
|
||||
| `CLOSED` | `OpenClosedType` enum item |
|
||||
| `StopMoveType` | `org.openhab.core.library.types.StopMoveType` |
|
||||
| `STOP` | `StopMoveType` enum item |
|
||||
| `MOVE` | `StopMoveType` enum item |
|
||||
| `UpDownType` | `org.openhab.core.library.types.UpDownType` |
|
||||
| `UP` | `UpDownType` enum item |
|
||||
| `DOWN` | `UpDownType` enum item |
|
||||
| `UnDefType` | `org.openhab.core.library.types.UnDefType` |
|
||||
| `NULL` | `UnDefType` enum item |
|
||||
| `UNDEF` | `UnDefType` enum item |
|
||||
| `RefreshType` | `org.openhab.core.library.types.RefreshType` |
|
||||
| `REFRESH` | `RefreshType` enum item |
|
||||
| `NextPreviousType` | `org.openhab.core.library.types.NextPreviousType` |
|
||||
| `NEXT` | `NextPreviousType` enum item |
|
||||
| `PREVIOUS` | `NextPreviousType` enum item |
|
||||
| `PlayPauseType` | `org.openhab.core.library.types.PlayPauseType` |
|
||||
| `PLAY` | `PlayPauseType` enum item |
|
||||
| `PAUSE` | `PlayPauseType` enum item |
|
||||
| `RewindFastforwardType` | `org.openhab.core.library.types.RewindFastforwardType` |
|
||||
| `REWIND` | `RewindFastforwardType` enum item |
|
||||
| `FASTFORWARD` | `RewindFastforwardType` enum item |
|
||||
| `QuantityType` | `org.openhab.core.library.types.QuantityType` |
|
||||
| `StringListType` | `org.openhab.core.library.types.StringListType` |
|
||||
| `RawType` | `org.openhab.core.library.types.RawType` |
|
||||
| `DateTimeType` | `org.openhab.core.library.types.DateTimeType` |
|
||||
| `DecimalType` | `org.openhab.core.library.types.DecimalType` |
|
||||
| `HSBType` | `org.openhab.core.library.types.HSBType` |
|
||||
| `PercentType` | `org.openhab.core.library.types.PercentType` |
|
||||
| `PointType` | `org.openhab.core.library.types.PointType` |
|
||||
| `StringType` | `org.openhab.core.library.types.StringType` |
|
||||
| `SIUnits` | `org.openhab.core.library.unit.SIUnits` |
|
||||
| `ImperialUnits` | `org.openhab.core.library.unit.ImperialUnits` |
|
||||
| `MetricPrefix` | `org.openhab.core.library.unit.MetricPrefix` |
|
||||
| `Units` | `org.openhab.core.library.unit.Units` |
|
||||
| `BinaryPrefix` | `org.openhab.core.library.unit.BinaryPrefix` |
|
||||
| `items` | Instance of `java.util.Map<String, State>` |
|
||||
| `ir` | Alias for `itemRegistry` |
|
||||
| `itemRegistry` | Instance of `org.openhab.core.items.ItemRegistry` |
|
||||
| `things` | Instance of `org.openhab.core.thing.ThingRegistry` |
|
||||
| `rules` | Instance of `org.openhab.core.automation.RuleRegistry` |
|
||||
| `events` | (internal) Used to send events, post commands, etc. [Details](#events-operations) below] |
|
||||
| `actions` | Instance of `org.openhab.core.thing.binding.ThingActions` |
|
||||
| `scriptExtension` | (internal) For loading script presets. |
|
||||
| `se` | Alias for `scriptExtension` |
|
||||
| `actions` | Instance of `org.openhab.core.thing.binding.ThingActions` |
|
||||
| `scriptExtension` | (internal) For loading script presets. |
|
||||
| `se` | Alias for `scriptExtension` |
|
||||
|
||||
##### `events` operations
|
||||
|
||||
|
@ -445,9 +445,9 @@ All parameters are Strings.
|
|||
Read the JSR223 language specific documentation for examples of using these `TriggerType` objects.
|
||||
|
||||
::: details timer.DateTimeTrigger
|
||||
| Parameter | Description |
|
||||
| ---------- | ------------------------ |
|
||||
| `itemName` | The name of the `Item` |
|
||||
| Parameter | Description |
|
||||
| ---------- | ---------------------- |
|
||||
| `itemName` | The name of the `Item` |
|
||||
:::
|
||||
|
||||
::: details timer.GenericCronTrigger
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
layout: documentation
|
||||
title: Migration from openHAB 2
|
||||
description: Description of Beaking Changes and needed steps for a proper Migration from openHAB 2
|
||||
description: Description of Breaking Changes and needed steps for a proper Migration from openHAB 2
|
||||
---
|
||||
|
||||
# Migrating from openHAB 2
|
||||
|
@ -15,7 +15,7 @@ Since this is a major version release you have to pay attention to some **Breaki
|
|||
|
||||
Please read them carefully and check if you are affected by some of the changes, like the changes to some rules namespaces and the handling of time functions.
|
||||
|
||||
Below you can find some general informations for the technical upgrade process from openHAB 2.
|
||||
Below you can find some general information for the technical upgrade process from openHAB 2.
|
||||
Please be aware of possible changes needed for your specific environment in case of the breaking changes after upgrading.
|
||||
|
||||
## Upgrade Process for different installation variants
|
||||
|
|
|
@ -62,7 +62,7 @@ The commands above have been copied from the REST API documentation for illustra
|
|||
|
||||
## Rest Api Explorer
|
||||
|
||||
You can try and validate rest api calles from within the openHAB UI.
|
||||
You can try and validate rest api calls from within the openHAB UI.
|
||||
Just log in with an admin user, navigate to `Developer Tools -> API Explorer` and start exploring.
|
||||
|
||||
## Authentication
|
||||
|
|
|
@ -194,8 +194,8 @@ When using an item and you want to ignore the date-portion of that item the `tim
|
|||
|
||||
System-based triggers are provided as described in the table below:
|
||||
|
||||
| Trigger | Description |
|
||||
|------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Trigger | Description |
|
||||
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| System started | `System started` is triggered upon openHAB startup. In openHAB version 2, `System started` is also triggered after the rule file containing the System started trigger is modified, or after item(s) are modified in a .items file. |
|
||||
| System reached start level <level> | `System reached start level <level>` is triggered when openHAB reaches a specific start level. A list of possible start levels is available below. Please note that only levels 40 and higher are useful as the rule engine needs to be ready first. |
|
||||
|
||||
|
@ -336,7 +336,7 @@ In relation to [event-based rule triggers]({{base}}/configuration/rules-dsl.html
|
|||
The following table summarizes the impact of the two manipulator commands on the rule execution due to the used trigger:
|
||||
|
||||
| Command \ Rule Trigger | `received update` | `received command` | `changed` |
|
||||
|--------------------------|-------------------|--------------------|-----------|
|
||||
| ------------------------ | ----------------- | ------------------ | --------- |
|
||||
| postUpdate | ⚡ rule fires | ❌ | (depends) |
|
||||
| sendCommand | (❌) see below | ⚡ rule fires | (depends) |
|
||||
| _Change through Binding_ | ⚡ rule fires | ⚡ rule fires | (depends) |
|
||||
|
@ -363,9 +363,9 @@ An upper case letter data type after a `val` and `var` statement, for example `v
|
|||
Objects are more complex than primitives.
|
||||
|
||||
Objects have special methods that can perform many necessary type conversions automatically.
|
||||
Using `Myitem.sendCommand(new_state)` or `Myitem.postUpdate(new_state)` will, in most cases, convert `new_state` into a type that Object `myItem` can apply.
|
||||
Using `MyItem.sendCommand(new_state)` or `MyItem.postUpdate(new_state)` will, in most cases, convert `new_state` into a type that Object `myItem` can apply.
|
||||
|
||||
The Action `sendCommand(MyItem, new_state)` does not provide the same flexibilty.
|
||||
The Action `sendCommand(MyItem, new_state)` does not provide the same flexibility.
|
||||
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)~~.
|
||||
|
@ -444,7 +444,7 @@ The following code can be used to send an RGB value to a Color Item.
|
|||
import java.awt.Color
|
||||
|
||||
// Create item
|
||||
val newColor = new Color(red, blue, green) // where red, blue, and green are ints between 0 and 255
|
||||
val newColor = new Color(red, blue, green) // where red, blue, and green are integers between 0 and 255
|
||||
|
||||
//Saving to an Item
|
||||
MyColorItem.sendCommand(new HSBType(newColor))
|
||||
|
@ -656,7 +656,7 @@ The Player item allows to control players (e.g. audio players) with commands suc
|
|||
The Player Item carries three types with predefined commands
|
||||
|
||||
| State Type | Commands |
|
||||
|---------------------------|---------------------|
|
||||
| ------------------------- | ------------------- |
|
||||
| **PlayPauseType** | PLAY, PAUSE |
|
||||
| **RewindFastforwardType** | REWIND, FASTFORWARD |
|
||||
| **NextPreviousType** | NEXT, PREVIOUS |
|
||||
|
@ -730,7 +730,7 @@ As a consequence, the use of `sendCommand(MyItem, primitive)`, using a primitive
|
|||
The different syntax for the generic and the objective-specific differs and is given in the table below:
|
||||
|
||||
| Generic (Action) | Specific (Method) |
|
||||
|----------------------------------|---------------------------------|
|
||||
| -------------------------------- | ------------------------------- |
|
||||
| `postUpdate(MyItem, new_state)` | `MyItem.postUpdate(new_state)` |
|
||||
| `sendCommand(MyItem, new_state)` | `MyItem.sendCommand(new_state)` |
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ name
|
|||
type - one of the following "text", "integer", "decimal", "boolean"
|
||||
label - localizable text
|
||||
description - localizable text
|
||||
required - boolean flag indicating if this configuration property can be optional and thus it can be ommited in the rule, by default required is false
|
||||
required - boolean flag indicating if this configuration property can be optional and thus it can be omitted in the rule, by default required is false
|
||||
defaultValue - default value for the configuration property when not specified in the rule
|
||||
```
|
||||
|
||||
|
@ -484,7 +484,7 @@ The above example uses two rule configuration properties:
|
|||
|
||||
### GenericEventTrigger
|
||||
|
||||
GenericEventTrigger has 3 configuration paramters: `eventTopic`,`eventSource` and `eventTypes` and one output: 'event'.
|
||||
GenericEventTrigger has 3 configuration parameters: `eventTopic`,`eventSource` and `eventTypes` and one output: 'event'.
|
||||
|
||||
```json
|
||||
{
|
||||
|
@ -630,5 +630,5 @@ The composite module type wraps one or more instances of a system module type an
|
|||
|
||||
This example demonstrates a new module type _ItemStateChangeTrigger_ which wraps the system module type _GenericEventTrigger_.
|
||||
It defines the new configuration property `itemName` which is used as the `eventSource` property of the _GenericEventTrigger_.
|
||||
The other config parameters `eventTopic` and `eventTypes` are staticly defined.
|
||||
The other config parameters `eventTopic` and `eventTypes` are statically defined.
|
||||
The composite module type can also have inputs and outputs and can use a reference to map them to inputs and outputs of the nested system module type(s).
|
||||
|
|
|
@ -184,7 +184,7 @@ You may optionally give the channel a proper label (like “My Custom Channel”
|
|||
```xtend
|
||||
Thing yahooweather:weather:losangeles [ location=2442047, unit="us", refresh=120 ] {
|
||||
Channels:
|
||||
Trigger String : customChannel1 [
|
||||
Trigger String : customChannel1 -[
|
||||
configParameter="Value"
|
||||
]
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ Many bindings provide standalone channel type definitions like this:
|
|||
<channel-type id="temperature">
|
||||
<item-type>Number</item-type>
|
||||
<label>Temperature</label>
|
||||
<description>Current temperature in degrees celsius</description>
|
||||
<description>Current temperature in degrees Celsius</description>
|
||||
<category>Temperature</category>
|
||||
<state readOnly="true" pattern="%.1f °C">
|
||||
</state>
|
||||
|
|
|
@ -6,7 +6,7 @@ title: Transformations Configuration
|
|||
# Transformations Configuration
|
||||
|
||||
Transformations are used to translate data from a cluttered or technical raw value to a processed or human-readable representation.
|
||||
They are often useful, to **interpret received Item values**, like sensor readings or state variables, and to translate them into a human-readable or better processible format.
|
||||
They are often useful, to **interpret received Item values**, like sensor readings or state variables, and to translate them into a human-readable or better processable format.
|
||||
|
||||
Details about the usage of Transformations and the available Transformation services can be found in the [main Transformation services article](/addons/#transform).
|
||||
|
||||
|
|
|
@ -42,12 +42,12 @@ If the add-on consists of more than one bundle, only one `addon.xml` is allowed
|
|||
```
|
||||
|
||||
| Property | Description | |
|
||||
|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|
|
||||
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
|
||||
| addon.id | An identifier for the add-on | mandatory |
|
||||
| type | Either `automation`, `binding`, `misc`, `persistence`, `transform`, `ui` or `voice` | mandatory |
|
||||
| name | A human-readable name for the add-on | mandatory |
|
||||
| description | A human-readable description for the add-on | optional |
|
||||
| author | In general be the organisation maintaining this add-on (e.g. openHAB), not an individual's name | optional |
|
||||
| author | In general be the organization maintaining this add-on (e.g. openHAB), not an individual's name | optional |
|
||||
| connection | `local` for add-ons that only interact locally, `cloud` for add-ons that require a cloud connection, `cloudDiscovery` for add-ons that require a cloud connection for set-up | optional |
|
||||
| countries | List of two-letter ISO country codes that are supported (all countries if empty) | optional |
|
||||
| service-id | The ID (service.pid or component.name) of the main binding service, which can be configured through OSGi configuration admin service. Should only be used in combination with a config description definition | optional |
|
||||
|
|
|
@ -63,7 +63,7 @@ You can upload a logo to display it on the openhab.org start page, the addon sea
|
|||
|
||||
These are the requirements for logos:
|
||||
|
||||
- PNG (transparancy is preferred)
|
||||
- PNG (transparency is preferred)
|
||||
- 512x512 pixels or smaller in one dimension, if it's not a square logo
|
||||
- Less than 30kB
|
||||
|
||||
|
|
|
@ -83,11 +83,11 @@ Nevertheless if there are reasons why you can not use the base class, the bindin
|
|||
|
||||
The communication between the framework and the ThingHandler is bidirectional.
|
||||
|
||||
If the framework wants the binding to do something or just notfiy it about changes,
|
||||
If the framework wants the binding to do something or just notify it about changes,
|
||||
it calls methods like `handleCommand`, `handleUpdate` or `thingUpdated`.
|
||||
|
||||
If the ThingHandler wants to inform the framework about changes, it uses a callback
|
||||
The `BaseThingHandler` provides convience methods like `updateState`, `updateStatus` `updateThing` or `triggerChannel`, that can be used to inform the framework about changes.
|
||||
The `BaseThingHandler` provides convenience methods like `updateState`, `updateStatus` `updateThing` or `triggerChannel`, that can be used to inform the framework about changes.
|
||||
|
||||
The overall structure looks like this:
|
||||
|
||||
|
@ -336,7 +336,7 @@ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR,
|
|||
```
|
||||
|
||||
After the thing is created, the framework calls the `initialize` method of the handler.
|
||||
At this time the state of the thing is _INTIALIZING_ as long as the binding sets it to something else.
|
||||
At this time the state of the thing is _INITIALIZING_ as long as the binding sets it to something else.
|
||||
Because of this the default implementation of the `initialize()` method in the `BaseThingHandler` just changes the status to _ONLINE_.
|
||||
|
||||
::: tip Note
|
||||
|
@ -454,7 +454,7 @@ The Hue gateway is an IP device with an HTTP API, which communicates over the Zi
|
|||
In the openHAB model the Hue gateway is represented as a _Bridge_ with connected _Things_, that represent the Hue bulbs.
|
||||
_Bridge_ inherits from _Thing_, so that it also has _Channels_ and all other features of a thing, with the addition that it also holds a list of things.
|
||||
|
||||
We have a FAQ, dicussing [Thing, Bridge and Channel modelling](faq.html#structuring-things-and-thing-types).
|
||||
We have a FAQ, discussing [Thing, Bridge and Channel modelling](faq.html#structuring-things-and-thing-types).
|
||||
|
||||
When implementing a binding with _Bridges_, the logic to communicate with the external system is often shared between the different `ThingHandler` implementations.
|
||||
In that case it makes sense to implement a handler for the _Bridge_ and delegate the actual command execution from the _ThingHandler_ to the _BridgeHandler_.
|
||||
|
@ -646,14 +646,14 @@ There must still be the ability to configure the binding via text files (`.thing
|
|||
A discovery service provides discovery results.
|
||||
The following table gives an overview about the main parts of a `DiscoveryResult`:
|
||||
|
||||
| Field | Description |
|
||||
|-------|-------------|
|
||||
| `thingUID` | The `thingUID` is the unique identifier of the specific discovered thing (e.g. a device's serial number). It _must not_ be constructed out of properties, that can change (e.g. IP addresses). A typical `thingUID` could look like this: `hue:bridge:001788141f1a`
|
||||
| `thingTypeUID` | Contrary to the `thingUID` is the `thingTypeUID` that specifies the type the discovered thing belongs to. It could be constructed from e.g. a product number. A typical `thingTypeUID` could be the following: `hue:bridge`.
|
||||
| `bridgeUID` | If the discovered thing belongs to a bridge, the `bridgeUID` contains the UID of that bridge.
|
||||
| `properties` | The `properties` of a `DiscoveryResult` contain the configuration for the newly created thing.
|
||||
| `label` | The human readable representation of the discovery result. Do not put IP/MAC addresses or similar into the label but use the special `representationProperty` instead. |
|
||||
| `representationProperty` | The name of one of the properties or configuration parameters, which best discriminates the result from other results of the same type. See chapter [Representation Property](#representation-property) below. |
|
||||
| Field | Description |
|
||||
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `thingUID` | The `thingUID` is the unique identifier of the specific discovered thing (e.g. a device's serial number). It _must not_ be constructed out of properties, that can change (e.g. IP addresses). A typical `thingUID` could look like this: `hue:bridge:001788141f1a` |
|
||||
| `thingTypeUID` | Contrary to the `thingUID` is the `thingTypeUID` that specifies the type the discovered thing belongs to. It could be constructed from e.g. a product number. A typical `thingTypeUID` could be the following: `hue:bridge`. |
|
||||
| `bridgeUID` | If the discovered thing belongs to a bridge, the `bridgeUID` contains the UID of that bridge. |
|
||||
| `properties` | The `properties` of a `DiscoveryResult` contain the configuration for the newly created thing. |
|
||||
| `label` | The human readable representation of the discovery result. Do not put IP/MAC addresses or similar into the label but use the special `representationProperty` instead. |
|
||||
| `representationProperty` | The name of one of the properties or configuration parameters, which best discriminates the result from other results of the same type. See chapter [Representation Property](#representation-property) below. |
|
||||
|
||||
To simplify the implementation of custom discovery services, an abstract base class `AbstractDiscoveryService` implements the `DiscoveryService` and just needs to be extended.
|
||||
Subclasses of `AbstractDiscoveryService` do not need to handle the `DiscoveryListeners` themselves, they can use the methods `thingDiscovered` and `thingRemoved` to notify the registered listeners.
|
||||
|
@ -837,7 +837,7 @@ See [i18n](../utils/i18n.html#discovery) for more information.
|
|||
::: tip Hint!
|
||||
To make it work you have to inject references to the `LocaleProvider` and the `TranslationProvider` services into your implementation.
|
||||
The `AbstractDiscoveryService` already provides `protected` properties, which are not yet linked to a service.
|
||||
The devoloper has to take care about that.
|
||||
The developer has to take care about that.
|
||||
|
||||
```java
|
||||
protected @NonNullByDefault({}) TranslationProvider i18nProvider;
|
||||
|
|
|
@ -7,7 +7,7 @@ title: Build System
|
|||
|
||||
The buildsystem is based on Maven.
|
||||
A very common tool for Java development.
|
||||
Maven is a convention centric, declarative system that is extensible via addional plugins.
|
||||
Maven is a convention centric, declarative system that is extensible via additional plugins.
|
||||
That means if you stick 100% to Mavens idea of a java project, your buildsystem instruction file is not longer than 10 lines.
|
||||
|
||||
openHAB has a few extra requirements and we use about 10 additional plugins,
|
||||
|
@ -107,7 +107,7 @@ Two cases need to be treated differently:
|
|||
### Multi-Bundle Features / Sub-Bundles
|
||||
|
||||
In some cases a binding consists of several bundles (e.g. `mqtt`).
|
||||
The `feature.xml` of the sub-bundle (e.g. `mqtt.homie`) needs to add all bundles from the parent-bundle to make sure that the feature verification suceeds:
|
||||
The `feature.xml` of the sub-bundle (e.g. `mqtt.homie`) needs to add all bundles from the parent-bundle to make sure that the feature verification succeeds:
|
||||
|
||||
```xml
|
||||
<feature>openhab-transport-mqtt</feature>
|
||||
|
|
|
@ -23,7 +23,7 @@ openHAB is a meritocracy. The more that somebody contributes, the more responsib
|
|||
## Structure
|
||||
|
||||
The openHAB project is a big ecosystem of different components.
|
||||
While people often think of the runtime + addons when talking about openHAB, there are other parts like openHAB Cloud, the mobile apps, the voice skills, etc. - all in all, there are well over [40 different repos](https://github.com/openhab) under the openHAB GitHub organisation.
|
||||
While people often think of the runtime + addons when talking about openHAB, there are other parts like openHAB Cloud, the mobile apps, the voice skills, etc. - all in all, there are well over [40 different repos](https://github.com/openhab) under the openHAB GitHub organization.
|
||||
|
||||
The different components are mostly maintained independently of each other. Many have their own release cycles and a dedicated maintainer team.
|
||||
|
||||
|
@ -48,7 +48,7 @@ Maintainers take care of the respective repository, i.e. they
|
|||
- sync with other maintainer teams wrt cross-team changes
|
||||
- announce important news in the community
|
||||
|
||||
In general, a maintainer team is free to define its own rules of how the work in the team is organised, e.g. what is required for a PR to be accepted. Those rules should be written down as a pinned discussion on the GitHub team page, see [this one](https://github.com/orgs/openhab/teams/2-x-add-ons-maintainers) as an example.
|
||||
In general, a maintainer team is free to define its own rules of how the work in the team is organized, e.g. what is required for a PR to be accepted. Those rules should be written down as a pinned discussion on the GitHub team page, see [this one](https://github.com/orgs/openhab/teams/2-x-add-ons-maintainers) as an example.
|
||||
|
||||
A [couple of rules](https://github.com/orgs/openhab/teams/maintainers/discussions/1) must be followed by all maintainer teams, they ensure that there's some consistency in the workflows across the different repositories.
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ Code styles files are located in here: <https://github.com/openhab/static-code-a
|
|||
|
||||
#### Java Code
|
||||
|
||||
The rules are defined using the Eclipse Java Formatter definitions. There are plugins available for several IDEs that support these definitons.
|
||||
The rules are defined using the Eclipse Java Formatter definitions. There are plugins available for several IDEs that support these definitions.
|
||||
|
||||
- Official [openHAB Eclipse IDE setup](ide/eclipse.html) is preconfigured
|
||||
- Eclipse standalone installation
|
||||
|
@ -81,7 +81,7 @@ The rules are defined at <https://github.com/openhab/static-code-analysis/tree/m
|
|||
|
||||
### Java Coding Style
|
||||
|
||||
- The [Java naming conventions](https://java.about.com/od/javasyntax/a/nameconventions.htm) should always be used and are descibed in detail at the link, a quick summary is:
|
||||
- The [Java naming conventions](https://java.about.com/od/javasyntax/a/nameconventions.htm) should always be used and are described in detail at the link, a quick summary is:
|
||||
- Channel IDs: `lowerCamelCase`
|
||||
- Variables: `lowerCamelCase`
|
||||
- Constants: `ALL_UPPER_CASE`
|
||||
|
@ -95,7 +95,7 @@ public static <T> boolean isEqual(GenericsType<T> g1, GenericsType<T> g2){
|
|||
|
||||
- Code MUST not show any warnings.
|
||||
Warnings that cannot be circumvented should be suppressed by using the `@SuppressWarnings` annotation.
|
||||
- Your classes are generally organised within an internal package
|
||||
- Your classes are generally organized within an internal package
|
||||
|
||||
```java
|
||||
org.openhab.binding.coolbinding.internal
|
||||
|
@ -195,9 +195,9 @@ void myFun() {
|
|||
|
||||
```java
|
||||
void myFun() {
|
||||
logger.trace("Enter myfun"); // DONT, DONT, really DONT do that
|
||||
logger.trace("Enter myfun"); // DON'T, DON'T, really DON'T do that
|
||||
doSomething();
|
||||
logger.trace("Leave myfun"); // DONT, DONT, really DONT do that
|
||||
logger.trace("Leave myfun"); // DON'T, DON'T, really DON'T do that
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -205,7 +205,7 @@ void myFun() {
|
|||
|
||||
```java
|
||||
void myFun() {
|
||||
logger.debug("And now the thing goes online"); // DONT, DONT, really DONT do that
|
||||
logger.debug("And now the thing goes online"); // DON'T, DON'T, really DON'T do that
|
||||
updateState(ThingState.ONLINE);
|
||||
}
|
||||
```
|
||||
|
@ -269,7 +269,7 @@ You will receive detailed information (path to the file, line and message) listi
|
|||
|
||||
[Null annotations](https://wiki.eclipse.org/JDT_Core/Null_Analysis) are used from the Eclipse JDT project.
|
||||
|
||||
Those annotations help the compiler and our static code analyser to figure out if a potential null pointer access would happen in your code.
|
||||
Those annotations help the compiler and our static code analyzer to figure out if a potential null pointer access would happen in your code.
|
||||
|
||||
Classes (except data transfer objects (DTO)) must be annotated with `@NonNullByDefault`:
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ If you already have Eclipse installed it is recommended to perform a separate Ec
|
|||

|
||||
|
||||
| Selection | Install if |
|
||||
|-------------------------|---------------------------------------|
|
||||
| ----------------------- | ------------------------------------- |
|
||||
| **openHAB Development** | **Debug/Demo Environment (Required)** |
|
||||
| openHAB Add-ons | Add-ons Development |
|
||||
| openHAB ZigBee Binding | ZigBee Binding Development |
|
||||
|
@ -64,7 +64,7 @@ If you already have Eclipse installed it is recommended to perform a separate Ec
|
|||
|
||||
1. Click `Next>` and `Finish` to start installation.
|
||||
|
||||
During install accept licence agreement, "Unsigned Content" for Bndtools, and Eclipse Foundation certificates when requested to complete IDE installation.
|
||||
During install accept license agreement, "Unsigned Content" for Bndtools, and Eclipse Foundation certificates when requested to complete IDE installation.
|
||||
|
||||
1. At this point the Eclipse installer is finished and the Eclipse IDE is automatically launched to continue the installation process.
|
||||
|
||||
|
@ -147,7 +147,7 @@ The following files are of interest for the execution environment:
|
|||
|
||||
::: tip
|
||||
Depending on the amount of code you want to debug, especially when you're debugging not only add-ons, but also openHAB Core and UI's,
|
||||
start-up procces may gets very slow and/or you get a `java.lang.OutOfMemoryError: Java heap space` exception.
|
||||
start-up process may gets very slow and/or you get a `java.lang.OutOfMemoryError: Java heap space` exception.
|
||||
In case this happens, you could increase the maximum heap space by adding e.g. `-Xmx8G` (for a maximum of 8 gigabyte) to
|
||||
`Runtime Properties > JVM arguments` (bottem left of the `app.bndrun` window).
|
||||
Afterwards, you have to save `app.bndrun` file again.
|
||||
|
|
|
@ -5,7 +5,7 @@ title: IntelliJ
|
|||
|
||||
# IntelliJ IDE
|
||||
|
||||
## Prerequisities
|
||||
## Prerequisites
|
||||
|
||||
- git, Maven, IntelliJ and Java 17 are installed
|
||||
|
||||
|
@ -18,7 +18,7 @@ This article refers to the directory where you installed the distribution as `<D
|
|||
|
||||
## Build the addons repository
|
||||
|
||||
1. Fork and clone the [openhab addons repository](https://www.github.com/openhab/openhab-addons) into a new directory (Reference `<ADDON_DIR>` from now on for this arcticle) with `git clone https://github.com/<yourgitusername>/openhab-addons` (replace git user name accordingly)
|
||||
1. Fork and clone the [openhab addons repository](https://www.github.com/openhab/openhab-addons) into a new directory (Reference `<ADDON_DIR>` from now on for this article) with `git clone https://github.com/<yourgitusername>/openhab-addons` (replace git user name accordingly)
|
||||
|
||||
1. Open IntelliJ and create a new project from existing sources (File | New | Project from existing sources) and pick `<ADDON_DIR>`/pom.xml
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ The following steps will show you how to setup a specific bundle for development
|
|||
1. Shutdown any instances of openHAB
|
||||
1. Press `CTRL-SHIFT-P -> Tasks: Run Task -> Start openHAB (Debug)` to start an openHAB instance in debug mode. You should see openHAB startup in a new VSCode terminal.
|
||||
1. Press F5 (or bring up debug in VSCode and choose the "Debug (Attach) - openHAB" configuration) and the following should occur in the VSCode terminal
|
||||
1. The Maven compile occuring (successfully)
|
||||
1. The Maven compile occurring (successfully)
|
||||
1. The resulting JAR is copied to the openHAB addons directory (`openhab_addons`)
|
||||
1. Connecting to the openHAB instance (the debug call stack should show a bunch of openHAB type threads running)
|
||||
|
||||
|
@ -87,8 +87,8 @@ You can now make changes, set breakpoints, etc.
|
|||
|
||||
## Notes
|
||||
|
||||
1. May take openHAB a few seconds to realize there is a new bundle and to reinitilize it after it's been copied. Be a little bit patient.
|
||||
1. You must run the `mvn Compile (Online)` task atleast once to allow the offline compile to occur. You should use the `mvn Compile (Offline)` task for most of your development as it's quicker since it uses the cache files. When you are ready to commit (or release a test bundle) - you should run the `mvn Compile (Release)` task to include code checks (and resolve them).
|
||||
1. May take openHAB a few seconds to realize there is a new bundle and to reinitialize it after it's been copied. Be a little bit patient.
|
||||
1. You must run the `mvn Compile (Online)` task at least once to allow the offline compile to occur. You should use the `mvn Compile (Offline)` task for most of your development as it's quicker since it uses the cache files. When you are ready to commit (or release a test bundle) - you should run the `mvn Compile (Release)` task to include code checks (and resolve them).
|
||||
1. Win10+ allows forward slashes as part of its path. If you use backward slashes instead - you will need to double up on them since tasks.json uses a backward slash as a delimiter. Example: `c:\\\\openhab`
|
||||
|
||||
## Tasks
|
||||
|
@ -98,7 +98,7 @@ The [tasks.json](examples/vscode/tasks.json) defines the following tasks that yo
|
|||
1. **Start openHAB (Debug)** - this task will start a new instance of openHAB in debug mode (allowing VSCode to connect to it). Please shut down any other instances of openHAB prior to running this (see next task). This will open a **new** terminal for openHAB to run in. Formally, this will call `start.bat debug` (or `start.sh debug` on macOS/Linux) in the `openhab_home` directory.
|
||||
1. **Stop openHAB** - this task will stop any running instance. Please note this will stop an instance started outside of VSCode as well on the same machine. Formally, this will call `stop.bat` (or `stop.sh` on macOS/Linux) in the `openhab_runtime/bin` directory.
|
||||
1. **mvn Compile (Online)** - this task will run an online Maven compile skipping code checks. Formally, will run `mvn clean install -DskipChecks`
|
||||
1. **mvn Compile (Offline)** - this task will run an offline Maven compile skipping code checks (assumes you have run an online compile atleast once). Formally, will run `mvn -o clean install -DskipChecks`
|
||||
1. **mvn Compile (Offline)** - this task will run an offline Maven compile skipping code checks (assumes you have run an online compile at least once). Formally, will run `mvn -o clean install -DskipChecks`
|
||||
1. **mvn Compile (Release)** - this task will run an online Maven compile with code checks. Formally, will run `mvn clean install`
|
||||
1. **Copy Distribution to Addons** - this task will run the 'mvn Compile (Offline)' task and then copy the resulting target file (as defined by `dist`) to your openHAB addons directory (defined by `openhab_addons`)
|
||||
1. **Build** - this is an alias for `Copy Distribution to Addons` task.
|
||||
|
|
|
@ -118,7 +118,7 @@ Follow these steps to generate your binding:
|
|||
- `-Dspotless.check.skip=true` : Skips the spotless file formatting checks
|
||||
- `-Dohc.version=3.0.2` : The version of openhab you are building for
|
||||
|
||||
1. To start your new binding it's a good practise to commit your code on a new git branch:
|
||||
1. To start your new binding it's a good practice to commit your code on a new git branch:
|
||||
|
||||
```bash
|
||||
git checkout -b <mynewbranch>
|
||||
|
|
|
@ -80,7 +80,7 @@ The above factory is exposing all three _Module Types_ that we need for our scen
|
|||
We do not need to care about the `ProviderChangeListener` methods here, because our types are rather static.
|
||||
If module types change over time in your factory, you need to notify the automation engine.
|
||||
|
||||
It is common practise to define the unique ID (UID) within the type class itself.
|
||||
It is common practice to define the unique ID (UID) within the type class itself.
|
||||
|
||||
Let's have a look at all of our type classes:
|
||||
|
||||
|
@ -189,10 +189,10 @@ public class AirConditionerActionType extends ActionType {
|
|||
public static ActionType initialize() {
|
||||
final ConfigDescriptionParameter temp1 = ConfigDescriptionParameterBuilder.create(CONFIG_LEVEL1_MIN_TEMP, Type.INTEGER)
|
||||
.withRequired(true).withReadOnly(true).withMultiple(false).withLabel("Temperature for level 1")
|
||||
.withDescription("Level 1 on the given temperature in celsius").build();
|
||||
.withDescription("Level 1 on the given temperature in Celsius").build();
|
||||
final ConfigDescriptionParameter temp2 = ConfigDescriptionParameterBuilder.create(CONFIG_LEVEL2_MIN_TEMP, Type.INTEGER)
|
||||
.withRequired(true).withReadOnly(true).withMultiple(false).withLabel("Temperature for level 2")
|
||||
.withDescription("Level 2 on the given temperature in celsius").build();
|
||||
.withDescription("Level 2 on the given temperature in Celsius").build();
|
||||
List<ConfigDescriptionParameter> config = new ArrayList<ConfigDescriptionParameter>();
|
||||
config.add(temp1);
|
||||
config.add(temp2);
|
||||
|
@ -299,14 +299,14 @@ For our scenario we go with one file:
|
|||
"name":"level1_min_temp",
|
||||
"type":"INTEGER",
|
||||
"label":"Temperature for level 1",
|
||||
"description":"Level 1 on the given temperature in celsius",
|
||||
"description":"Level 1 on the given temperature in Celsius",
|
||||
"required":true
|
||||
},
|
||||
{
|
||||
"name":"level2_min_temp",
|
||||
"type":"INTEGER",
|
||||
"label":"Temperature for level 2",
|
||||
"description":"Level 2 on the given temperature in celsius",
|
||||
"description":"Level 2 on the given temperature in Celsius",
|
||||
"required":true
|
||||
}
|
||||
],
|
||||
|
@ -594,9 +594,9 @@ public class MyRuleRegistrationComponent {
|
|||
}
|
||||
```
|
||||
|
||||
### Define constant / non-changable rules
|
||||
### Define constant / non-changeable rules
|
||||
|
||||
We have seen how to define rules via json files as well as programatically.
|
||||
We have seen how to define rules via json files as well as programmatically.
|
||||
A third way is to inject rules via an own `RuleProvider`.
|
||||
|
||||
Those rules are compiled into the bundle and cannot be changed later on, which might be desired.
|
||||
|
|
|
@ -57,7 +57,7 @@ public class LogEventHandler implements EventHandler {
|
|||
|
||||
@Override
|
||||
public void handleEvent(Event event) {
|
||||
logger.info(" Recevied event with topic: {}", event.getTopic());
|
||||
logger.info(" Received event with topic: {}", event.getTopic());
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
|
@ -105,7 +105,7 @@ This `Profile` receives the `State` of the `Item` and the `Event` that has been
|
|||
|
||||
## ProfileTypeProvider
|
||||
|
||||
Custom `ProfileType`s have to be annouced by a `ProfileTypeProvider` to the framework via an OSGi service:
|
||||
Custom `ProfileType`s have to be announced by a `ProfileTypeProvider` to the framework via an OSGi service:
|
||||
|
||||
```java
|
||||
@Component(service = { ProfileTypeProvider.class })
|
||||
|
|
|
@ -45,7 +45,7 @@ The event source is optional and represents the name of the source identifying t
|
|||
#### Item Events
|
||||
|
||||
| Event | Description | Topic |
|
||||
|----------------------------|---------------------------------------------------------|----------------------------------------------------|
|
||||
| -------------------------- | ------------------------------------------------------- | -------------------------------------------------- |
|
||||
| ItemAddedEvent | An item has been added to the item registry. | openhab/items/{itemName}/added |
|
||||
| ItemRemovedEvent | An item has been removed from the item registry. | openhab/items/{itemName}/removed |
|
||||
| ItemUpdatedEvent | An item has been updated in the item registry. | openhab/items/{itemName}/updated |
|
||||
|
@ -67,7 +67,7 @@ It contains the old and the new state of the group item as well as the member.
|
|||
#### Thing Events
|
||||
|
||||
| Event | Description | Topic |
|
||||
|-----------------------------|---------------------------------------------------|-----------------------------------------|
|
||||
| --------------------------- | ------------------------------------------------- | --------------------------------------- |
|
||||
| ThingAddedEvent | A thing has been added to the thing registry. | openhab/things/{thingUID}/added |
|
||||
| ThingRemovedEvent | A thing has been removed from the thing registry. | openhab/things/{thingUID}/removed |
|
||||
| ThingUpdatedEvent | A thing has been updated in the thing registry. | openhab/things/{thingUID}/updated |
|
||||
|
@ -82,25 +82,25 @@ It contains the old and the new status of the thing.
|
|||
|
||||
#### Inbox Events
|
||||
|
||||
| Event | Description | Topic |
|
||||
|-----------------------|-----------------------------------------------------|----------------------------------|
|
||||
| InboxAddedEvent | A discovery result has been added to the inbox. | openhab/inbox/{thingUID}/added |
|
||||
| InboxRemovedEvent | A discovery result has been removed from the inbox. | openhab/inbox/{thingUID}/removed |
|
||||
| InboxUpdateEvent | A discovery result has been updated in the inbox. | openhab/inbox/{thingUID}/updated |
|
||||
| Event | Description | Topic |
|
||||
| ----------------- | --------------------------------------------------- | -------------------------------- |
|
||||
| InboxAddedEvent | A discovery result has been added to the inbox. | openhab/inbox/{thingUID}/added |
|
||||
| InboxRemovedEvent | A discovery result has been removed from the inbox. | openhab/inbox/{thingUID}/removed |
|
||||
| InboxUpdateEvent | A discovery result has been updated in the inbox. | openhab/inbox/{thingUID}/updated |
|
||||
|
||||
#### Link Events
|
||||
|
||||
| Event | Description | Topic |
|
||||
|-----------------------------|----------------------------------------------------------|-----------------------------------------------|
|
||||
| --------------------------- | -------------------------------------------------------- | --------------------------------------------- |
|
||||
| ItemChannelLinkAddedEvent | An item channel link has been added to the registry. | openhab/links/{itemName}-{channelUID}/added |
|
||||
| ItemChannelLinkRemovedEvent | An item channel link has been removed from the registry. | openhab/links/{itemName}-{channelUID}/removed |
|
||||
|
||||
#### Channel Events
|
||||
|
||||
| Event | Description | Topic |
|
||||
|--------------------------------|---------------------------------------------------------------|--------------------------------------------------|
|
||||
| Event | Description | Topic |
|
||||
| ------------------------------ | ----------------------------------------------------------------- | ------------------------------------------------ |
|
||||
| ChannelDescriptionChangedEvent | A dynamic `CommandDescription` or `StateDescription` has changed. | openhab/channels/{channelUID}/descriptionchanged |
|
||||
| ChannelTriggeredEvent | A channel has been triggered. | openhab/channels/{channelUID}/triggered |
|
||||
| ChannelTriggeredEvent | A channel has been triggered. | openhab/channels/{channelUID}/triggered |
|
||||
|
||||
The `ChannelDescriptionChangedEvent` will be delivered automatically through the openHAB event bus if the binding implements a `BaseDynamicStateDescriptionProvider` or `BaseDynamicCommandDescriptionProvider` (see [Dynamic State / Command Description section](../bindings/thing-xml.html#dynamic-state-command-description)).
|
||||
|
||||
|
@ -116,7 +116,7 @@ Therefore, the `EventSubscriber` interface must be implemented.
|
|||
public class SomeItemEventSubscriber implements EventSubscriber {
|
||||
|
||||
private final Set<String> subscribedEventTypes = Set.of(ItemStateEvent.TYPE, ItemCommandEvent.TYPE);
|
||||
private final EventFilter eventFiter = new TopicEventFilter("openhab/items/ItemX/.*");
|
||||
private final EventFilter eventFilter = new TopicEventFilter("openhab/items/ItemX/.*");
|
||||
|
||||
@Override
|
||||
public Set<String> getSubscribedEventTypes() {
|
||||
|
@ -192,7 +192,7 @@ The class `org.openhab.core.items.events.AbstractItemEventSubscriber` provides t
|
|||
```java
|
||||
public class SomeItemEventSubscriber extends AbstractItemEventSubscriber {
|
||||
|
||||
private final EventFilter eventFiter = new TopicEventFilter("openhab/items/ItemX/.*");
|
||||
private final EventFilter eventFilter = new TopicEventFilter("openhab/items/ItemX/.*");
|
||||
|
||||
@Override
|
||||
public EventFilter getEventFilter() {
|
||||
|
|
|
@ -99,7 +99,7 @@ XML file (`thing-types.xml`):
|
|||
<channel id="temperature" typeId="temperature" />
|
||||
<channel id="minTemperature" typeId="temperature">
|
||||
<label>Min. Temperature</label>
|
||||
<description>Minimum temperature in degrees celsius (metric) or fahrenheit (imperial).</description>
|
||||
<description>Minimum temperature in degrees Celsius (metric) or Fahrenheit (imperial).</description>
|
||||
</channel>
|
||||
</channels>
|
||||
<config-description>
|
||||
|
@ -125,7 +125,7 @@ XML file (`thing-types.xml`):
|
|||
<channel-type id="temperature">
|
||||
<item-type>Number</item-type>
|
||||
<label>Temperature</label>
|
||||
<description>Current temperature in degrees celsius (metric) or fahrenheit (imperial).</description>
|
||||
<description>Current temperature in degrees Celsius (metric) or Fahrenheit (imperial).</description>
|
||||
<state readOnly="true" pattern="%d Value" />
|
||||
<config-description>
|
||||
<parameter name="unit" type="text" required="true">
|
||||
|
|
|
@ -54,7 +54,7 @@ If you deal with network calls, consider the asynchronously reloading cache impl
|
|||
## Expiring and asynchronously reloading cache
|
||||
|
||||
If we refreshed a value of the internal state in a `ThingHandler` just recently, we can return it immediately via the usual `updateState(channel, state)` method in response to a "RefreshType" command.
|
||||
If the state is too old, we need to fetch it first and this may involve network calls, interprocess operations or anything else that will would block for a considerable amout of time.
|
||||
If the state is too old, we need to fetch it first and this may involve network calls, interprocess operations or anything else that will would block for a considerable amount of time.
|
||||
|
||||
A common usage case of the `ExpiringCacheAsync` cache type is in a `ThingHandler` to encapsulate one value of an internal state and attach an expire time on that value.
|
||||
|
||||
|
@ -77,7 +77,7 @@ The interesting part is the `updater`.
|
|||
If the value is not yet expired, the returned CompletableFuture will complete immediately and the given code is executed.
|
||||
If the value is expired, the updater will be used to request a refreshed value.
|
||||
|
||||
An updater can be any class or lambda that implements the funtional interface of `Supplier<CompletableFuture<VALUE_TYPE>>`.
|
||||
An updater can be any class or lambda that implements the functional interface of `Supplier<CompletableFuture<VALUE_TYPE>>`.
|
||||
|
||||
In the following example the method `CompletableFuture<VALUE_TYPE> get()` is accordingly implemented.
|
||||
The example assumes that we deal
|
||||
|
|
|
@ -10,10 +10,10 @@ title: Armbian
|
|||
Armbian is a base operating system platform for single board computers.
|
||||
|
||||
- comes in desktop, minimal or server variant,
|
||||
- has clean and highly optimised user space,
|
||||
- has clean and highly optimized user space,
|
||||
- is Ubuntu and Debian compatible,
|
||||
- is supported with vibrant community,
|
||||
- comes with a powerful SDK which allows reproduction and customisation,
|
||||
- comes with a powerful SDK which allows reproduction and customization,
|
||||
- supports many 3rd party wireless drivers with advanced functionalities,
|
||||
- supports Docker, disk encryption, Wireguard VPN any many other features.
|
||||
|
||||
|
|
|
@ -449,7 +449,7 @@ sudo adduser --system --no-create-home --group --disabled-login openhab
|
|||
:::tip note
|
||||
The needed command syntax may vary based on the distribution you are using.
|
||||
|
||||
Below there is an example for fedora besed systems:
|
||||
Below there is an example for fedora based systems:
|
||||
|
||||
```shell
|
||||
sudo adduser --system --no-create-home --user-group --disabled-login openhab
|
||||
|
@ -465,7 +465,7 @@ As openHAB is still in an evolving state, the snapshot may be the **preferred ch
|
|||
|
||||
- **Official Release**
|
||||
|
||||
Download and extract the latest offical stable version of openHAB from [our downloadpage](https://www.openhab.org/download/) to your host:
|
||||
Download and extract the latest official stable version of openHAB from [our downloadpage](https://www.openhab.org/download/) to your host:
|
||||
|
||||
```shell
|
||||
cd /tmp
|
||||
|
@ -625,14 +625,14 @@ sudo systemctl daemon-reload
|
|||
|
||||
### File Locations
|
||||
|
||||
| | Repository Installation | Manual Installation (according to [guide](#manual-installation)) |
|
||||
|:-----------------------------:|------------------------------|------------------------------------------------------------------|
|
||||
| openHAB application | `/usr/share/openhab` | `/opt/openhab` |
|
||||
| Additional add-on files | `/usr/share/openhab/addons` | `/opt/openhab/addons` |
|
||||
| Site configuration | `/etc/openhab` | `/opt/openhab/conf` |
|
||||
| Log files | `/var/log/openhab` | `/opt/openhab/userdata/logs` |
|
||||
| Userdata like rrd4j databases | `/var/lib/openhab` | `/opt/openhab/userdata` |
|
||||
| Backups folder | `/var/lib/openhab/backups` | `/opt/openhab/backups` |
|
||||
| | Repository Installation | Manual Installation (according to [guide](#manual-installation)) |
|
||||
| :---------------------------: | --------------------------- | ---------------------------------------------------------------- |
|
||||
| openHAB application | `/usr/share/openhab` | `/opt/openhab` |
|
||||
| Additional add-on files | `/usr/share/openhab/addons` | `/opt/openhab/addons` |
|
||||
| Site configuration | `/etc/openhab` | `/opt/openhab/conf` |
|
||||
| Log files | `/var/log/openhab` | `/opt/openhab/userdata/logs` |
|
||||
| Userdata like rrd4j databases | `/var/lib/openhab` | `/opt/openhab/userdata` |
|
||||
| Backups folder | `/var/lib/openhab/backups` | `/opt/openhab/backups` |
|
||||
| Service configuration | `/etc/default/openhab` | (not preconfigured) |
|
||||
|
||||
## Backup and Restore
|
||||
|
|
|
@ -15,7 +15,7 @@ If you're unfamiliar with using the macOS terminal, then feel free to follow the
|
|||
|
||||
## Installation
|
||||
|
||||
openHAB is packaged as a platform independent `zip` archive. Installation is as simple as unziping it into a unique folder.
|
||||
openHAB is packaged as a platform independent `zip` archive. Installation is as simple as unzipping it into a unique folder.
|
||||
First, make sure that your system meets the [prerequisites](index.html#prerequisites).
|
||||
When you are running macOS BigSur or higher, make sure
|
||||
that you select the right platform depending on your hardware (x86 or ARM 64-bit).
|
||||
|
|
|
@ -112,7 +112,7 @@ Open the configuration file and **add** the following lines underneath the proxy
|
|||
|
||||
### Add authorization and cookie directives in NGINX Configuration
|
||||
|
||||
This is an important new requirment in openHAB 3.0 and later versions.
|
||||
This is an important new requirement in openHAB 3.0 and later versions.
|
||||
This is not required prior to openHAB 3.0. You must add the following two directives underneath the `add_header` (in the `server` block) and `proxy_set_header` (in the `location /` block) items respectively:
|
||||
|
||||
```text
|
||||
|
@ -163,11 +163,11 @@ If you have setup a password following the previous section, then the rest will
|
|||
|
||||
To generate a trusted certificate, you need to own a domain. To acquire your own domain, you can use one of the following methods:
|
||||
|
||||
| Method | Example Links | Note |
|
||||
|:-------------------------------- |:------------- |:---- |
|
||||
| Purchasing a domain name | [GoDaddy](https://www.godaddy.com), [Namecheap](https://www.namecheap.com), [Enom](https://www.enom.com), [Register](https://www.register.com) | You should have an IP adress that doesn't change (i.e. fixed), or changes rarely, and then update the DNS _A record_ so that your domain/subdomain to point towards your IP. |
|
||||
| Obtaining a free domain | [FreeNom](https://www.freenom.com) | Setup is the same as above. |
|
||||
| Using a "Dynamic DNS" sevice | [No-IP](https://www.noip.com), [Dyn](https://www.dyn.com/dns), [FreeDNS](https://freedns.afraid.org) | Uses a client to automatically update your IP to a domain of you choice, some Dynamic DNS services (like FreeDNS) offer a free domain too. |
|
||||
| Method | Example Links | Note |
|
||||
| :---------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Purchasing a domain name | [GoDaddy](https://www.godaddy.com), [Namecheap](https://www.namecheap.com), [Enom](https://www.enom.com), [Register](https://www.register.com) | You should have an IP address that doesn't change (i.e. fixed), or changes rarely, and then update the DNS _A record_ so that your domain/subdomain to point towards your IP. |
|
||||
| Obtaining a free domain | [FreeNom](https://www.freenom.com) | Setup is the same as above. |
|
||||
| Using a "Dynamic DNS" service | [No-IP](https://www.noip.com), [Dyn](https://www.dyn.com/dns), [FreeDNS](https://freedns.afraid.org) | Uses a client to automatically update your IP to a domain of you choice, some Dynamic DNS services (like FreeDNS) offer a free domain too. |
|
||||
|
||||
## Enabling HTTPS
|
||||
|
||||
|
@ -370,31 +370,31 @@ The HTTP one can be disabled later if desired (not at all essential if you will
|
|||
|
||||
Create two reverse proxies as follows:
|
||||
|
||||
| Parameter | Value |
|
||||
|:------------------------- |:--------------- |
|
||||
|Description: |openHAB HTTPS |
|
||||
|Source Protocol: |HTTPS |
|
||||
|Source Hostname: |your-hostname.com|
|
||||
|Source Port: |443 |
|
||||
|Enable HSTS |Unchecked |
|
||||
|Enable HTTP/2 |Unchecked |
|
||||
|Enable access control |Unchecked |
|
||||
|Destination Protocol: |HTTPS |
|
||||
|Destination Hostname: |localhost |
|
||||
|Destination Port: |8443 (or whichever HTTPS port your openHAB instance is on)|
|
||||
| Parameter | Value |
|
||||
| :-------------------- | :--------------------------------------------------------- |
|
||||
| Description: | openHAB HTTPS |
|
||||
| Source Protocol: | HTTPS |
|
||||
| Source Hostname: | your-hostname.com |
|
||||
| Source Port: | 443 |
|
||||
| Enable HSTS | Unchecked |
|
||||
| Enable HTTP/2 | Unchecked |
|
||||
| Enable access control | Unchecked |
|
||||
| Destination Protocol: | HTTPS |
|
||||
| Destination Hostname: | localhost |
|
||||
| Destination Port: | 8443 (or whichever HTTPS port your openHAB instance is on) |
|
||||
|
||||
| Parameter | Value |
|
||||
|:------------------------- |:--------------- |
|
||||
|Description: |openHAB HTTP |
|
||||
|Source Protocol: |HTTP |
|
||||
|Source Hostname: |your-hostname.com|
|
||||
|Source Port: |80 |
|
||||
|Enable HSTS |Unchecked |
|
||||
|Enable HTTP/2 |Unchecked |
|
||||
|Enable access control |Unchecked |
|
||||
|Destination Protocol: |HTTP |
|
||||
|Destination Hostname: |localhost |
|
||||
|Destination Port: |8080 (or whichever HTTP port your openHAB instance is on)|
|
||||
| Parameter | Value |
|
||||
| :-------------------- | :-------------------------------------------------------- |
|
||||
| Description: | openHAB HTTP |
|
||||
| Source Protocol: | HTTP |
|
||||
| Source Hostname: | your-hostname.com |
|
||||
| Source Port: | 80 |
|
||||
| Enable HSTS | Unchecked |
|
||||
| Enable HTTP/2 | Unchecked |
|
||||
| Enable access control | Unchecked |
|
||||
| Destination Protocol: | HTTP |
|
||||
| Destination Hostname: | localhost |
|
||||
| Destination Port: | 8080 (or whichever HTTP port your openHAB instance is on) |
|
||||
|
||||
Verify that the reverse proxy is working as expected - try <http://your-hostname.com> and <https://your-hostname.com> - you should end up at the openHAB landing page in both cases, but will get a security warning for the https site.
|
||||
|
||||
|
@ -411,19 +411,19 @@ Click Apply, and wait a few minutes - your certificate is done!
|
|||
|
||||
::: tip Note
|
||||
Sometimes you may receive an error at the end of the certificate wizard - the first time this happens, click on 'cancel and see if you have a certificate anyway.
|
||||
If the certifcate has been generated, you are good to go.
|
||||
If the certificate has been generated, you are good to go.
|
||||
:::
|
||||
|
||||
Select the certificate that has just been created, and click on 'Configure'.
|
||||
Ensure that the new certificate is listed next to your-hostname.com in the table - something like the below.
|
||||
If it's not selected, update it.
|
||||
|
||||
| Services | Certificate |
|
||||
|:------------------------- |:--------------- |
|
||||
|your-hostname.com |your-hostname.com|
|
||||
|FTPS |synology.com |
|
||||
|Cloud Station Server |synology.com |
|
||||
|etc etc |synology.com |
|
||||
| Services | Certificate |
|
||||
| :------------------- | :---------------- |
|
||||
| your-hostname.com | your-hostname.com |
|
||||
| FTPS | synology.com |
|
||||
| Cloud Station Server | synology.com |
|
||||
| etc etc | synology.com |
|
||||
|
||||
Once this is done, update the CAA record for your-hostname.com with your registrar (exact process will vary by registrar).
|
||||
Within an hour or so, you should not receive the security warning for <https://your-hostname.com>.
|
||||
|
@ -497,13 +497,13 @@ As above, the first part of the file redirects any HTTP queries to HTTPS directl
|
|||
If you don't get any errors, update the reverse proxy settings in the DSM GUI to point to these new endpoints.
|
||||
Back in the GUI, go to Control Panel > Application Portal > Reverse Proxy, make the updates below:
|
||||
|
||||
| Parameter | Value |
|
||||
|:------------------------- |:--------------- |
|
||||
|Destination Port: |7443 (or whatever you set it to in the openHAB-auth file)|
|
||||
| Parameter | Value |
|
||||
| :---------------- | :-------------------------------------------------------- |
|
||||
| Destination Port: | 7443 (or whatever you set it to in the openHAB-auth file) |
|
||||
|
||||
| Parameter | Value |
|
||||
|:------------------------- |:--------------- |
|
||||
|Destination Port: |2020 (or whatever you set it to in the openHAB-auth file)|
|
||||
| Parameter | Value |
|
||||
| :---------------- | :-------------------------------------------------------- |
|
||||
| Destination Port: | 2020 (or whatever you set it to in the openHAB-auth file) |
|
||||
|
||||
::: tip Note
|
||||
We do this 'double' redirect to take advantage of the GUI certificate handling in DSM - this is the equivalent of CertBot for a Linux installation.
|
||||
|
@ -521,7 +521,7 @@ This log will update in real-time, so do whatever it was that you were having is
|
|||
|
||||
## Additional HTTPS Security
|
||||
|
||||
To test your security settings [SSL Labs](https://www.ssllabs.com/ssltest/) provides a tool for testing your domain against ideal settings (Make sure you check "Do not show the results on the boards" if you dont want your domain seen).
|
||||
To test your security settings [SSL Labs](https://www.ssllabs.com/ssltest/) provides a tool for testing your domain against ideal settings (Make sure you check "Do not show the results on the boards" if you don't want your domain seen).
|
||||
|
||||
This optional section is for those who would like to strengthen the HTTPS security on openHAB, it can be applied regardless of which HTTPS method you used [above](#enabling-https), **but you need to follow at least one of them first**.
|
||||
|
||||
|
@ -537,7 +537,7 @@ openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
|
|||
```
|
||||
|
||||
Now we can configure NGINX to use this key, as well as telling the client to use specific cyphers and SSL settings, just add the following under your `ssl_certificate **` settings but above ``location *``.
|
||||
All of these settings are customisable, but make sure you [read up on](https://nginx.org/en/docs/http/configuring_https_servers.html) what these do first before changing them:
|
||||
All of these settings are customizable, but make sure you [read up on](https://nginx.org/en/docs/http/configuring_https_servers.html) what these do first before changing them:
|
||||
|
||||
```text
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
|
|
|
@ -59,12 +59,12 @@ In this case we need the 1032 as the user and the 65539 as the group. Write them
|
|||
DSM 7 does not longer support Java 11 directly.
|
||||
You either have to run openHAB in a Docker container or have to take care of a properly installed Java 11 runtime on your own.
|
||||
|
||||
The following poart shows the Docker based installation.
|
||||
The following part shows the Docker based installation.
|
||||
You may also get Java 11 via [community package](https://synocommunity.com/package/java-11-openjdk) and go own with the manual for [older DSM Versions](#older-synology-diskstations-till-dsm-6).
|
||||
:::
|
||||
|
||||
And that also makes the installation easier to maintain.
|
||||
It works out of the box a bit different then the normal Docker installation as described in de openHAB documententation.
|
||||
It works out of the box a bit different then the normal Docker installation as described in de openHAB documentation.
|
||||
Docker is a containerization platform and is used to run lightweight containers.
|
||||
These containers require a very little amount of memory and system resources to run.
|
||||
Synology NAS has official support for Docker.
|
||||
|
@ -203,7 +203,7 @@ For certain Synology models the `public` folder is created automatically during
|
|||
The administrator can also create a public shared folder if desired.
|
||||
|
||||
Synology does not document which models will automatically create a public folder.
|
||||
Refer to the Synology knowlegde base article on [Shared Folder](https://www.synology.com/en-us/knowledgebase/DSM/help/DSM/AdminCenter/file_share_desc) to learn more.
|
||||
Refer to the Synology knowledge base article on [Shared Folder](https://www.synology.com/en-us/knowledgebase/DSM/help/DSM/AdminCenter/file_share_desc) to learn more.
|
||||
|
||||
## Logging
|
||||
|
||||
|
|
|
@ -173,14 +173,14 @@ By installing the openHAB process as a service in Windows, you can:
|
|||
|
||||
Assuming a successful install, you will now have various folders inside `C:\openHAB`:
|
||||
|
||||
| | Windows Installation |
|
||||
|:--------------------------------:|:-----------------------------|
|
||||
| openHAB application | `C:\openHAB\runtime` |
|
||||
| Additional add-on files | `C:\openHAB\addons` |
|
||||
| Site configuration | `C:\openHAB\conf` |
|
||||
| Log files | `C:\openHAB\userdata\logs` |
|
||||
| Userdata like rrd4j databases | `C:\openHAB\userdata` |
|
||||
| Service configuration | `C:\openHAB\userdata\etc` |
|
||||
| | Windows Installation |
|
||||
| :---------------------------: | :------------------------- |
|
||||
| openHAB application | `C:\openHAB\runtime` |
|
||||
| Additional add-on files | `C:\openHAB\addons` |
|
||||
| Site configuration | `C:\openHAB\conf` |
|
||||
| Log files | `C:\openHAB\userdata\logs` |
|
||||
| Userdata like rrd4j databases | `C:\openHAB\userdata` |
|
||||
| Service configuration | `C:\openHAB\userdata\etc` |
|
||||
|
||||
## What next?
|
||||
|
||||
|
@ -213,7 +213,7 @@ Now that openHAB has updated, you only need to run the above commands again for
|
|||
NB: Due to an issue with long file paths sometimes the update script may fail after the 'Copying files...' stage.
|
||||
This can be resolved by deleting the c:\openHAB\userdata\tmp folder.
|
||||
|
||||
### Uninstallation
|
||||
### Deinstallation
|
||||
|
||||
- perform a backup as described above
|
||||
- uninstall openHAB as a Windows service: run PowerShell as an administrator and use the following commands
|
||||
|
|
|
@ -45,7 +45,7 @@ This section allows to have different appearance settings _per_ device.
|
|||
- Auto: tries to detect the client type
|
||||
- Android
|
||||
- iOS
|
||||
- Destktop
|
||||
- Desktop
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ title: Automation
|
|||
|
||||
# Settings - Automation
|
||||
|
||||
This is the section to automate openHAB which provides rules, script and a scheduling sectiom.
|
||||
This is the section to automate openHAB which provides rules, script and a scheduling section.
|
||||
See [What's the Difference Between a Rule, Script, and Schedule?](/docs/tutorial/rules_introduction.html#what-s-the-difference-between-a-rule-script-and-schedule)
|
||||
|
||||
[[toc]]
|
||||
|
@ -38,7 +38,7 @@ After selecting one or multiple rules three options appear in the footer to allo
|
|||
these rules.
|
||||
Press "Done" to return back to the normal list view.
|
||||
|
||||
To add a rule press thre plus icon on the lower right corner:  and follow the [rules tutorial](/docs/tutorial/rules_basic.html#create-the-rule).
|
||||
To add a rule press the plus icon on the lower right corner:  and follow the [rules tutorial](/docs/tutorial/rules_basic.html#create-the-rule).
|
||||
|
||||
## Scripts
|
||||
|
||||
|
@ -78,7 +78,7 @@ and it will appear in the schedule view:
|
|||

|
||||
|
||||
A rule that is schedule repeatedly like everyday at 8:00 in the morning will therefore be shown on every day of the calendar view.
|
||||
The way openHAB handles this, is that a rule will get a tag "schedule", so if you create a rule with the help of the  at the bottom right corner, openHAB autoamtically adds that tag (that is also true if you create a rule with a time trigger via the normal rule page).
|
||||
The way openHAB handles this, is that a rule will get a tag "schedule", so if you create a rule with the help of the  at the bottom right corner, openHAB automatically adds that tag (that is also true if you create a rule with a time trigger via the normal rule page).
|
||||
In case you have timed that trigger that repeats very often and which would "pollute" the schedule view with far too many entries, you can just delete the tag "schedule" in the edit mode of that rule (it can always be added later again).
|
||||
|
||||
The page has a searchable list which allows to filter by the name of the rule.
|
||||
|
|
|
@ -22,7 +22,7 @@ The general explanation on how to **configure things** via things-files is descr
|
|||
|
||||
Adding Things via the user interface as part of the _settings section_ is described comprehensively in the tutorial section
|
||||
|
||||
- [Addings Things - Simple](/docs/tutorial/things_simple.html)
|
||||
- [Adding Things - Simple](/docs/tutorial/things_simple.html)
|
||||
- [Adding Things - Intermediate](/docs/tutorial/things_intermediate.html): Things that are dealing with a binding where the bridge-Thing cannot be automatically discovered.
|
||||
- [Adding Things - Advanced](/docs/things_advanced.html): Things that do not support automatic discovery
|
||||
|
||||
|
@ -55,5 +55,5 @@ Within this section the following page types can be created:
|
|||
- [Tabbed Pages](/docs/ui/tabbed-pages.html): Tabbed Pages are composite Pages which are able to display other Pages in tabs.
|
||||
- [Charts](/docs/ui/chart-pages.html): Chart Pages can display historical values in a full-screenchart component.
|
||||
- [Floor Plans](/docs/ui/floorplan-pages.html): Floorplan Pages can display markers or other elements over a custom image.
|
||||
- [Map Views](/docs/ui/map-pages.html): Map Pages can display either fixed markers or markers representating items of type Location, on a map.
|
||||
- [Map Views](/docs/ui/map-pages.html): Map Pages can display either fixed markers or markers representing items of type Location, on a map.
|
||||
- [Sitemap](/docs/ui/sitemaps.html): Sitemaps have existed since the first versions of openHAB and were used as an easy way display items. Keep in mind that the main UI is not currently able to display them, though the mobile apps still are.
|
||||
|
|
|
@ -172,7 +172,7 @@ is the same as
|
|||
footer: =items['Switch1'].displayState || items['Switch1'].state
|
||||
```
|
||||
|
||||
Similary, `@@` can be used as a shortcut for just the item state.
|
||||
Similarly, `@@` can be used as a shortcut for just the item state.
|
||||
|
||||
Expressions are particularly useful in cases where one wants to combine the states of more than one Item, or use the state of more than one Item in a single widget element.
|
||||
For example, the icon of an Item can be based on the state of a different Item.
|
||||
|
@ -222,21 +222,21 @@ Configuring the action type reveal more options in the action sheet:
|
|||
|
||||
### Types of Actions
|
||||
|
||||
Action | What it does
|
||||
-|-
|
||||
Navigate to page | Opens a different Page with an optional transition.
|
||||
Send command | Issues a command to an Item.
|
||||
Toggle Item | Alternate an item between two states by sending commands (regular command if the item's state is different, or an alternative command if the state is equal to the regular command). Typically used with ON/OFF.
|
||||
Command options | Issues a command to the configured Item based on a comma-separated locally-defined list of options, or on the Item's State Description.
|
||||
Run rule | Trigger a rule directly.
|
||||
Open popup | Open a Page or personal widget in a popup which will be displayed fullscreen on phones and in a 630x630-pixel modal dialog on larger screens.
|
||||
Open popover | Open a Page or personal widget in a small "callout" comic-like bubble
|
||||
Open sheet | Open a Page or personal widget in a drawer appearing from the bottom of the screen.
|
||||
Open photo browser | Displays a full screen interface to view one of several images
|
||||
Group details | Used with Group items to open a popup with an automatically-generated list of the members of the group, represented by their default list item widget. For Groups with a base type like Switch, a standard card widget will also be shown for the Group itself.
|
||||
Analyze Item(s) | Opens the Analyzer window for the specified item(s) and period
|
||||
External URL | Open an external web page
|
||||
Set Variable | Set a variable that you can use in other parts of the page or widget.
|
||||
| Action | What it does |
|
||||
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Navigate to page | Opens a different Page with an optional transition. |
|
||||
| Send command | Issues a command to an Item. |
|
||||
| Toggle Item | Alternate an item between two states by sending commands (regular command if the item's state is different, or an alternative command if the state is equal to the regular command). Typically used with ON/OFF. |
|
||||
| Command options | Issues a command to the configured Item based on a comma-separated locally-defined list of options, or on the Item's State Description. |
|
||||
| Run rule | Trigger a rule directly. |
|
||||
| Open popup | Open a Page or personal widget in a popup which will be displayed fullscreen on phones and in a 630x630-pixel modal dialog on larger screens. |
|
||||
| Open popover | Open a Page or personal widget in a small "callout" comic-like bubble |
|
||||
| Open sheet | Open a Page or personal widget in a drawer appearing from the bottom of the screen. |
|
||||
| Open photo browser | Displays a full screen interface to view one of several images |
|
||||
| Group details | Used with Group items to open a popup with an automatically-generated list of the members of the group, represented by their default list item widget. For Groups with a base type like Switch, a standard card widget will also be shown for the Group itself. |
|
||||
| Analyze Item(s) | Opens the Analyzer window for the specified item(s) and period |
|
||||
| External URL | Open an external web page |
|
||||
| Set Variable | Set a variable that you can use in other parts of the page or widget. |
|
||||
|
||||
::: tip
|
||||
|
||||
|
@ -266,10 +266,10 @@ If you name the parameter group `action` there won't be a prefix anymore so the
|
|||
|
||||
Examples:
|
||||
|
||||
| Group Name | Prop Name Examples |
|
||||
|------------|--------------------|
|
||||
| action | `action, actionItem, actionCommand, actionCommandAlt` |
|
||||
| tapAction | `tap_action, tap_actionItem, tap_actionCommand, tap_actionCommandAlt` |
|
||||
| Group Name | Prop Name Examples |
|
||||
| ---------- | ----------------------------------------------------------------------------------------- |
|
||||
| action | `action, actionItem, actionCommand, actionCommandAlt` |
|
||||
| tapAction | `tap_action, tap_actionItem, tap_actionCommand, tap_actionCommandAlt` |
|
||||
| sceneOne | `sceneOne_action, sceneOne_actionItem, sceneOne_actionCommand, sceneOne_actionCommandAlt` |
|
||||
|
||||
You can dump the `props` objects in JSON to verify the names like in the following example (or just use `=JSON.stringify(props)` wherever you can display text in your widget):
|
||||
|
@ -312,7 +312,7 @@ slots:
|
|||
|
||||
## Variables
|
||||
|
||||
Varibles are a way to allow more complex scenarios in pages & personal widget development.
|
||||
Variables are a way to allow more complex scenarios in pages & personal widget development.
|
||||
|
||||
Variables can be used using several methods:
|
||||
|
||||
|
@ -400,7 +400,7 @@ These resources will help you with Flexbox and Grid:
|
|||
|
||||
### Dynamic Styling & Positioning using CSS `calc()`
|
||||
|
||||
You can dynamically style and position elements by calculating their CSS porperties with the `calc()` function.
|
||||
You can dynamically style and position elements by calculating their CSS properties with the `calc()` function.
|
||||
The `calc()` function is able to perform math (`+`, `-`, `*` & `/`) on multiple CSS values, which can even have different units.
|
||||
|
||||
For example, to set the height of a component to the current page's maximum content height (without scrolling), use the following `calc()` statement:
|
||||
|
|
|
@ -4,7 +4,7 @@ title: Map Pages
|
|||
|
||||
# Map Pages
|
||||
|
||||
Map Pages can display either fixed markers or markers representating items of type Location, on a map.
|
||||
Map Pages can display either fixed markers or markers representing items of type Location, on a map.
|
||||
|
||||

|
||||
|
||||
|
@ -14,7 +14,7 @@ Map pages have some configuration properties that you mostly can define in the D
|
|||
You can also add two types of markers in the Markers area.
|
||||
|
||||
- A Marker is an icon that will represent a position; you can define an icon, a label, and either a fixed position or a Location item. You can also define an action that will be performed with the marker is clicked.
|
||||
- A Circle Marker is a marker that will be represented as a circle on the map; it's useful for representing ranges. Instead of definining an icon, you can define a fixed radius in meters, or use the state of an item to control this radius. You can alter the look of the circle marker in the `markerConfig` YAML-only config property; it will be forwarded to the [LCircle](https://vue2-leaflet.netlify.app/components/LCircle.html#demo) component as props.
|
||||
- A Circle Marker is a marker that will be represented as a circle on the map; it's useful for representing ranges. Instead of defining an icon, you can define a fixed radius in meters, or use the state of an item to control this radius. You can alter the look of the circle marker in the `markerConfig` YAML-only config property; it will be forwarded to the [LCircle](https://vue2-leaflet.netlify.app/components/LCircle.html#demo) component as props.
|
||||
|
||||
## Building a Map Page
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ For basic widgets this information is only sometimes relevant, but when creating
|
|||
### Component config
|
||||
|
||||
Nearly every component will have some aspect that needs to be specified or modified to suit a specific need.
|
||||
This is accompished by adding a `config` section to the component's YAML.
|
||||
This is accomplished by adding a `config` section to the component's YAML.
|
||||
|
||||
```yaml
|
||||
- component: oh-toggle
|
||||
|
@ -102,15 +102,15 @@ There are several subsets of OH components, each with different uses and strengt
|
|||
In addition to being the basis for the OH components, the F7 components themselves are available as options in the widget editor.
|
||||
As a general rule, the F7 components will have more configuration and style flexibility than their OH counterparts.
|
||||
So, their use is recommended when there is something about the component that needs to be configured in a way different than what is set in the OH version.
|
||||
Of course, the F7 components do not have the OH specific functions available, so while they can have values based on Items using the epxression system, they cannot easily be used to trigger rules, update Items or variables, etc.
|
||||
Of course, the F7 components do not have the OH specific functions available, so while they can have values based on Items using the expression system, they cannot easily be used to trigger rules, update Items or variables, etc.
|
||||
|
||||
The most commonly used F7 components will likely be `f7-block`, `f7-row`, and `f7-col`.
|
||||
These all generate a simple `<div>` element with one base F7 class (`block`, `row`, and `col` respectively).
|
||||
These components are therefore useful as fundamental building-blocks of widget or page.
|
||||
The list components `f7-list-item` and `f7-list-item-row` can often be useful as well given the flexibility they provide for complex structure inside a list.
|
||||
|
||||
Any of the OH components that allow [wiget actions](building-pages.html#actions) include easy configuration for using some other widget as a popup or popover.
|
||||
If, however, there is need for the popup or popover to be built-in with a single widget (e.g., to add a widget to the [marketplace](https://community.openhab.org/c/marketplace/ui-widgets/75) that includes a popup or popover), the `f7-popup` and `f7-popover` component can be used and the open or closed status of that modal object controled by the `popupOpen`, `popupClose`, `popoverOpen`, and `popoverClose` properties available in many of the other f7 components and their OH derivaties.
|
||||
Any of the OH components that allow [widget actions](building-pages.html#actions) include easy configuration for using some other widget as a popup or popover.
|
||||
If, however, there is need for the popup or popover to be built-in with a single widget (e.g., to add a widget to the [marketplace](https://community.openhab.org/c/marketplace/ui-widgets/75) that includes a popup or popover), the `f7-popup` and `f7-popover` component can be used and the open or closed status of that modal object controlled by the `popupOpen`, `popupClose`, `popoverOpen`, and `popoverClose` properties available in many of the other f7 components and their OH derivates.
|
||||
|
||||
#### Popup example
|
||||
|
||||
|
@ -192,8 +192,8 @@ With no container, there is no possibility to add `class` or `style` configurati
|
|||
|
||||
The custom widget system can also be used to build HTML more directly.
|
||||
The `component` property can also be set to any recognized HTML tag.
|
||||
When used in this manner, the component accepts any configuration paramaters that can be passed to the tag as HTML attributes (inlcuding, of course, `class` and `style`).
|
||||
There is an additional configuration parameter, `content` which allows for content text to be inlcuded in the tag.
|
||||
When used in this manner, the component accepts any configuration paramaters that can be passed to the tag as HTML attributes (including, of course, `class` and `style`).
|
||||
There is an additional configuration parameter, `content` which allows for content text to be included in the tag.
|
||||
|
||||
HTML components also accept a `default` slot which will render a child component inside the tag.
|
||||
|
||||
|
@ -252,7 +252,7 @@ In order to remain light-weight and responsive, this is not a complete JavaScrip
|
|||
#### Arrow functions
|
||||
|
||||
Many standard JavaScript methods take a function as a parameter.
|
||||
The expression parser can parse arrow functions as the paramters of these methods.
|
||||
The expression parser can parse arrow functions as the parameters of these methods.
|
||||
|
||||
Here an arrow function is used in conjunction with the `.find()` method to locate the item object in an array of items (such as is returned by a `oh-repeater`) with a particular name.
|
||||
The label of the found item is then used as the title of a component.
|
||||
|
@ -288,7 +288,7 @@ label: =props.item.match(/_(.*)_/)[1]
|
|||
|
||||
The variable action allows components in widgets to pass information back and forth when there is user interaction.
|
||||
Often this informtation is simple, such as a single string or input value.
|
||||
Sometimes, however, it is helpul to add more information to a variable and for these instances JavaScript opjects are useful.
|
||||
Sometimes, however, it is helpful to add more information to a variable and for these instances JavaScript objects are useful.
|
||||
The widget system can create objects in two different ways.
|
||||
|
||||
Objects can be defined within the expression system using the standard JavaScript syntax: `{'key1':'value1','key2':'value2'}`.
|
||||
|
|
|
@ -143,7 +143,7 @@ Xtext Domain Specific Language and the sitemap file model can be found [here](ht
|
|||
The following element types may be used in a Sitemap definition file.
|
||||
|
||||
| Element | Description |
|
||||
|------------------------------------------|-------------------------------------------------------------------------------------------|
|
||||
| ---------------------------------------- | ----------------------------------------------------------------------------------------- |
|
||||
| [Chart](#element-type-chart) | Adds a time-series chart object for [persisted](persistence.html) data. |
|
||||
| [Colorpicker](#element-type-colorpicker) | Allows the user to choose a color from a color wheel. |
|
||||
| [Default](#element-type-default) | Renders an Item in the default UI representation specified by the type of the given Item. |
|
||||
|
@ -199,7 +199,7 @@ sitemap demo label="My home automation" {
|
|||
}
|
||||
```
|
||||
|
||||
UoM = [Units of Measurment]({{base}}/concepts/units-of-measurement.html)
|
||||
UoM = [Units of Measurement]({{base}}/concepts/units-of-measurement.html)
|
||||
|
||||
- Additional parameters such as `mappings` and `valuecolor` are described below.
|
||||
|
||||
|
@ -624,32 +624,32 @@ Text item=Temperature valuecolor=[Last_Update=="Uninitialized"="gray",
|
|||
```
|
||||
|
||||
Note that expressions are evaluated from left to right; the first matching expression determines the color.
|
||||
If the order of the expressions was reversed, the color assignment would not work projavay.
|
||||
If the order of the expressions was reversed, the color assignment would not work.
|
||||
Note also, the effect of omitting `Temperature` and the comparison operator in the expression `0="white"` (as compared to `==0="white"`).
|
||||
|
||||
Below is a list of standard colors and their respective RGB color codes.
|
||||
|
||||
| Color Name | Preview | RGB Color Code |
|
||||
|------------|-----------------------------------------------|----------------|
|
||||
| maroon | <div style="color: #800000;">⬤</div> | `#800000` |
|
||||
| red | <div style="color: #ff0000;">⬤</div> | `#ff0000` |
|
||||
| orange | <div style="color: #ffa500;">⬤</div> | `#ffa500` |
|
||||
| olive | <div style="color: #808000;">⬤</div> | `#808000` |
|
||||
| yellow | <div style="color: #ffff00;">⬤</div> | `#ffff00` |
|
||||
| purple | <div style="color: #800080;">⬤</div> | `#800080` |
|
||||
| fuchsia | <div style="color: #ff00ff;">⬤</div> | `#ff00ff` |
|
||||
| pink | <div style="color: #ffc0cb;">⬤</div> | `#ffc0cb` |
|
||||
| white | <div style="color: #ffffff;">⬤</div> | `#ffffff` |
|
||||
| lime | <div style="color: #00ff00;">⬤</div> | `#00ff00` |
|
||||
| green | <div style="color: #008000;">⬤</div> | `#008000` |
|
||||
| navy | <div style="color: #000080;">⬤</div> | `#000080` |
|
||||
| blue | <div style="color: #0000ff;">⬤</div> | `#0000ff` |
|
||||
| teal | <div style="color: #008080;">⬤</div> | `#008080` |
|
||||
| aqua | <div style="color: #00ffff;">⬤</div> | `#00ffff` |
|
||||
| black | <div style="color: #000000;">⬤</div> | `#000000` |
|
||||
| silver | <div style="color: #c0c0c0;">⬤</div> | `#c0c0c0` |
|
||||
| gray | <div style="color: #808080;">⬤</div> | `#808080` |
|
||||
| gold | <div style="color: #ffd700;">⬤</div> | `#ffd700` |
|
||||
| Color Name | Preview | RGB Color Code |
|
||||
| ---------- | ------------------------------------------- | -------------- |
|
||||
| maroon | <div style="color: #800000;">⬤</div> | `#800000` |
|
||||
| red | <div style="color: #ff0000;">⬤</div> | `#ff0000` |
|
||||
| orange | <div style="color: #ffa500;">⬤</div> | `#ffa500` |
|
||||
| olive | <div style="color: #808000;">⬤</div> | `#808000` |
|
||||
| yellow | <div style="color: #ffff00;">⬤</div> | `#ffff00` |
|
||||
| purple | <div style="color: #800080;">⬤</div> | `#800080` |
|
||||
| fuchsia | <div style="color: #ff00ff;">⬤</div> | `#ff00ff` |
|
||||
| pink | <div style="color: #ffc0cb;">⬤</div> | `#ffc0cb` |
|
||||
| white | <div style="color: #ffffff;">⬤</div> | `#ffffff` |
|
||||
| lime | <div style="color: #00ff00;">⬤</div> | `#00ff00` |
|
||||
| green | <div style="color: #008000;">⬤</div> | `#008000` |
|
||||
| navy | <div style="color: #000080;">⬤</div> | `#000080` |
|
||||
| blue | <div style="color: #0000ff;">⬤</div> | `#0000ff` |
|
||||
| teal | <div style="color: #008080;">⬤</div> | `#008080` |
|
||||
| aqua | <div style="color: #00ffff;">⬤</div> | `#00ffff` |
|
||||
| black | <div style="color: #000000;">⬤</div> | `#000000` |
|
||||
| silver | <div style="color: #c0c0c0;">⬤</div> | `#c0c0c0` |
|
||||
| gray | <div style="color: #808080;">⬤</div> | `#808080` |
|
||||
| gold | <div style="color: #ffd700;">⬤</div> | `#ffd700` |
|
||||
|
||||
Please take note that colors other than those listed in the list above may be used.
|
||||
Generally, you can expected that valid HTML colors will be accepted (e.g. `green`, `lightgrey`, `#334455`), but note that a UI may only accept internally defined colors, or work with a special theme.
|
||||
|
|
Loading…
Reference in New Issue