Skip to content

Commit

Permalink
Merge branch '2.5.x' into 2.5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Confectrician committed Jul 5, 2020
2 parents a7f8fff + e2b7574 commit fea2e7b
Show file tree
Hide file tree
Showing 26 changed files with 217 additions and 157 deletions.
1 change: 0 additions & 1 deletion .vuepress/docs-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module.exports = [
['installation/macos', 'macOS'],
'installation/openhabian',
'installation/rasppi',
'installation/pine',
'installation/armbian',
'installation/docker',
'installation/synology',
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ will help you to get it right.

We use them to bring together all relevant articles or to archive versioned content.
Mostly those branches will get updated automatically through our continuous integration builds.
You can read a bit more below about our external ressources and how we get them.
You can read a bit more below about our external resources and how we get them.

### Automatically Generated Parts

Expand Down
19 changes: 19 additions & 0 deletions addons/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,25 @@ You can place these XML files anywhere on your file system that openHAB has perm
In the calls to the Actions, use the fully qualified path.
We recommend placing these custom files somewhere inside your `$OH_CONF` folder, such as `$OH_CONF/services`.

#### Localisation

Ephemeris supports translation of holidays into many languages. Localization support files can be found in the [GitHub repo](https://github.com/svendiedrichsen/jollyday/tree/master/src/main/resources/descriptions). Currently these language supports are available:

1. [Dutch](https://github.com/svendiedrichsen/jollyday/blob/master/src/main/resources/descriptions/holiday_descriptions_nl.properties)
1. [English](https://github.com/svendiedrichsen/jollyday/blob/master/src/main/resources/descriptions/holiday_descriptions_en.properties)
1. [French](https://github.com/svendiedrichsen/jollyday/blob/master/src/main/resources/descriptions/holiday_descriptions_fr.properties)
1. [German](https://github.com/svendiedrichsen/jollyday/blob/master/src/main/resources/descriptions/holiday_descriptions_de.properties)
1. [Portuguese](https://github.com/svendiedrichsen/jollyday/blob/master/src/main/resources/descriptions/holiday_descriptions_pt.properties)
1. [Swedish](https://github.com/svendiedrichsen/jollyday/blob/master/src/main/resources/descriptions/holiday_descriptions_sv.properties)

Feel free to extent this list by providing additional language support files.

To enable localization,

* copy the file for your language to your OH setup.
* again a folder in `$OH_CONF` folder, such as `$OH_CONF/services` is proposed.
* use function 'Ephemeris.getHolidayDescription' to convert the name according to your localization file.

## Installable Actions

The following actions are available as installable add-ons.
Expand Down
26 changes: 26 additions & 0 deletions administration/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,38 @@ The levels build a hierarchy with **ERROR** logging critical messages only and *
**ALL** includes every log level from weight 100 to 600.
Setting the log level to **DEFAULT** will log to the level defined in the package.subpackage (in most cases a binding).

If the name of `package.subpackage` is not known, the name can be found out in the console:
```text
list -s
```
returns a list of all modules and the last column contains the information about the symbolic name of the bundle:
```text
openhab> list -s
START LEVEL 100 , List Threshold: 50
ID │ State │ Lvl │ Version │ Symbolic name
────┼────────┼─────┼─────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
19 │ Active │ 80 │ 5.3.1.201602281253 │ com.eclipsesource.jaxrs.publisher
20 │ Active │ 80 │ 2.8.2.v20180104-1110 │ com.google.gson
21 │ Active │ 80 │ 18.0.0 │ com.google.guava
22 │ Active │ 80 │ 27.1.0.jre │ com.google.guava
23 │ Active │ 80 │ 1.0.1 │ com.google.guava.failureaccess
24 │ Active │ 80 │ 3.0.0.v201312141243 │ com.google.inject
```
The list can be also filtered with grep. To find out the Z-Wave binding the following command can be used
```Text
openhab> list -s | grep zwave
253 x Active x 80 x 2.5.5 x org.openhab.binding.zwave
```

Following example sets the logging for the Z-Wave binding to **DEBUG**

```text
log:set DEBUG org.openhab.binding.zwave
```


Note that the log levels set using the `log:set` commands are persistent and will be applied upon restart.
To modify the stored log levels, use the console or edit the [configuration file](#config-file).

Expand Down
20 changes: 2 additions & 18 deletions concepts/items.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,9 @@ Example for a Group Item as a simple collection of other Items:
Group Items can derive their own state from their member Items.
To derive a state the Group Item must be constructed using a base Item and a Group function.
When calculating the state, Group functions recursively traverse the Group's members and also take members of subgroups into account.
If a subgroup however defines a state on its own (having base Item & Group function set) traversal stops and the state of the subgroup member is taken.
If a subgroup however defines a state on its own (having base Item & Group function set) traversal stops and the state of the subgroup member is taken.

Available Group functions:

| Function | Parameters | Base Item | Description |
|--------------------|-------------------------------|---------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| EQUALITY | - | \<all\> | 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) | Sets the \<activeState\>, if the member state \<activeState\> evaluates to `true` under the boolean term. Otherwise the \<passiveState\> is set. |
| SUM, AVG, MIN, MAX | - | Number | Sets the state according to the arithmetic function over all member 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 member states |

Examples for derived states on Group Items when declared in the Item DSL:

- `Group:Number:COUNT(".*")` counts all members of the Group matching the given regular expression, here any character or state (simply count all members).
- `Group:Number:AVG` calculates the average value over all member states which can be interpreted as `DecimalTypes`.
- `Group:Switch:OR(ON,OFF)` sets the Group state to `ON` if any of its members has the state `ON`, `OFF` if all are off.
- `Group:Switch:AND(ON,OFF)` sets the Group state to `ON` if all of its members have the state `ON`, `OFF` if any of the Group members has a different state than `ON`.
- `Group:DateTime:LATEST` sets the Group state to the latest date from all its members states.
For available Group functions and examples see [Configuration Guide](../configuration/items.html#group-type).

## State and Command Type Formatting

Expand Down
46 changes: 27 additions & 19 deletions configuration/items.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ More details about all of the available Item types and their commands are availa
[Item Types Overview]({{base}}/concepts/items.html)

To learn about the technical internals of the individual Item types, please refer to:
[Javadoc on Generic Item and its subclasses](https://eclipse.org/smarthome/documentation/javadoc/org/eclipse/smarthome/core/items/GenericItem.html)
[Javadoc on Generic Item and its subclasses](https://www.openhab.org/javadoc/v2.5/org/openhab/core/items/genericitem)

<!-- TODO: Random content. Doesn't make sense here. Might be changed to be a more general example for diverse Items
Expand Down Expand Up @@ -457,7 +457,7 @@ Because of the hierarchical structure of your group items, the rule will be clea
Additionally, the rule will not need to be modified when a new Item is added to the `Temperatures` group.

{: #group-type}
#### Group Type and State
### Derive Group State from Member Items

As you are now aware, an Item can have a state (e.g. "ON", "OFF").
A Group Item can also have a state.
Expand All @@ -474,17 +474,13 @@ Group[:itemtype[:function]] groupname ["labeltext"] [<iconname>] [(group1, group

Group state aggregation functions can be any of the following:

| Function | Description |
|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `EQUALITY` | Default if no function is specified. If ALL members have state X the group state will be X, otherwise the group state will be `UNDEF`. |
| `AND(value1,value2)` | [Boolean](https://en.wikipedia.org/wiki/Boolean_algebra) AND operation. If all item states are 'value1', 'value1' is returned, otherwise 'value2' is returned. |
| `OR(value1,value2)` | [Boolean](https://en.wikipedia.org/wiki/Boolean_algebra) OR operation. If at least one item state is of 'value1', 'value1' is returned, otherwise 'value2' is returned. |
| `NAND(value1,value2)` | [Boolean](https://en.wikipedia.org/wiki/Boolean_algebra) NAND (not AND) operation. Returns the opposite of the AND operation. |
| `NOR(value1,value2)` | [Boolean](https://en.wikipedia.org/wiki/Boolean_algebra) NOR (not OR) operation. Returns the opposite of the OR operation. |
| `AVG` | Calculates the numeric average over all Item states of decimal type. |
| `MAX` | Calculates the maximum value of all Item states of decimal type. |
| `MIN` | Calculates the minimum value of all Item states of decimal type. |
| `SUM` | Calculates the sum of all Item states in the Group. |
| 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).

Expand All @@ -495,21 +491,33 @@ Incompatible Item types within a Group may result in the invalid aggregation res

**Examples:**

Examples for derived states on Group Items when declared in the Item DSL:

```java
Group:Number Lights "Active Lights [%d]" // e.g. "2"
Group:Switch:OR(ON,OFF) Lights "Active Lights [%d]" // e.g. ON and "2"
Group:Number:AVG Temperatures "All Room Temperatures [%.1f °C]" // e.g. "21.3 °C"
Group:Number Lights "Active Lights [%d]" // e.g. "2"
Group:Switch:OR(ON,OFF) Lights "Active Lights [%d]" // e.g. ON and "2"
Group:Switch:AND(ON,OFF) Lights "Active Lights [%d]" // e.g. ON and "2"
Group:Number:AVG Temperatures "All Room Temperatures [%.1f °C]" // e.g. "21.3 °C"
Group:DateTime:EARLIEST LatestUpdate "Latest Update [%1$tY.%1$tm.%1$tY %1$tH:%1$tM:%1$tS]"
Group:DateTime:LATEST LastSeen "Last Seen [%1$tY.%1$tm.%1$tY %1$tH:%1$tM:%1$tS]"
Group:String:COUNT("OFFLINE") OfflineDevices "Offline Devices [%d]" // e.g. "2"
```

The first two examples above compute the number of active lights and store them as group state.
However, the second group is of type switch and has an aggregation function of OR.
The first three examples above compute the number of active lights and store them as group state.
However, the second group is of type switch and has an aggregation function of `OR`.
This means that the state of the group will be `ON` as soon as any of the member lights are turned on.
The third uses `AND` and sets the Group state to `ON` if all of its members have the state `ON`, `OFF` if any of the Group members has a different state than `ON`.

Groups do not only aggregate information from individual member Items, they can also accept commands.
Sending a command to a Group causes the command to be sent to all Group members.
An example of this is shown by the second group above; sending a single `ON` or `OFF` command to that group turns all lights in the group on or off.

The third example computes the average temperature of all room temperature Items in the group.
The fourth example computes the average temperature of all room temperature Items in the group.

Assuming we have a Group containing three timestamps: `now().minusDays(10)`, `now()` and `now().plusSeconds(30)`.
The `EARLIEST` function returns `now().minusDays(10)`, the `LATEST` function returns `now().plusSeconds(30)`.

The last Group counts all members of it matching the given regular expression, here any character or state (simply counts all members).

{: #tags}
### Tags
Expand Down
8 changes: 4 additions & 4 deletions configuration/multimedia.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: Multimedia

## Volume

The framework supports some base [functions](https://www.eclipse.org/smarthome/documentation/javadoc/org/eclipse/smarthome/model/script/actions/Audio.html#getMasterVolume--) to control the audio sinks' volume.
The framework supports some base [functions](https://www.openhab.org/javadoc/v2.5/org/eclipse/smarthome/model/script/actions/audio#method.summary) to control the audio sinks' volume.

### Actions

Expand Down Expand Up @@ -58,7 +58,7 @@ openhab> smarthome:audio stream example.com

### Actions

Alternatively the [`playSound()`](https://www.eclipse.org/smarthome/documentation/javadoc/org/eclipse/smarthome/model/script/actions/Audio.html#playSound-java.lang.String-) or [`playStream()`](https://www.eclipse.org/smarthome/documentation/javadoc/org/eclipse/smarthome/model/script/actions/Audio.html#playStream-java.lang.String-) functions can be used in DSL rules:
Alternatively the [`playSound()`](https://www.openhab.org/javadoc/v2.5/org/eclipse/smarthome/model/script/actions/audio#playSound(java.lang.String)) or [`playStream()`](https://www.openhab.org/javadoc/v2.5/org/eclipse/smarthome/model/script/actions/audio#playStream(java.lang.String)) functions can be used in DSL rules:

- `playSound(String filename)` : plays a sound from the sounds folder to the default sink
- `playSound(String filename, PercentType volume)` : plays a sound with the given volume from the sounds folder to the default sink
Expand Down Expand Up @@ -109,7 +109,7 @@ openhab> smarthome:voice say Hello world!

### Actions

Alternatively you can execute such commands within DSL rules by using the [`say()`](https://www.eclipse.org/smarthome/documentation/javadoc/org/eclipse/smarthome/core/voice/VoiceManager.html#say-java.lang.String-) function:
Alternatively you can execute such commands within DSL rules by using the [`say()`](https://www.openhab.org/javadoc/v2.5/org/eclipse/smarthome/core/voice/voicemanager#say(java.lang.String)) function:

```java
say("Hello world!")
Expand Down Expand Up @@ -151,7 +151,7 @@ openhab> smarthome:voice interpret turn on the light
The default human language interpreter will be used.
In case of interpretation error, the error message will be said using the default voice and default audio sink.

Again, such a command can also be entered within DSL rules (using the [`interpret()`](https://www.eclipse.org/smarthome/documentation/javadoc/org/eclipse/smarthome/core/voice/VoiceManager.html#interpret-java.lang.String-) function)
Again, such a command can also be entered within DSL rules (using the [`interpret()`](https://www.openhab.org/javadoc/v2.5/org/eclipse/smarthome/core/voice/voicemanager#interpret(java.lang.String)) function)

```java
interpret("turn on the light")
Expand Down
2 changes: 1 addition & 1 deletion configuration/persistence.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The following strategies are defined internally and may be used in place of `str
- `restoreOnStartup`: load and initialize the last persisted state of the Item on openHAB startup (if the Item state is undefined (`UNDEF`)).

#### Cron Persistence Triggers
openHAB uses [Quartz](http://www.quartz-scheduler.org/documentation/quartz-2.1.x/quick-start.html) for time-related cron events.
openHAB uses [Quartz](https://www.quartz-scheduler.org/documentation) for time-related cron events.
See the [Rules article]({{base}}/configuration/rules-dsl.html#time-based-triggers) for more information.

### Items
Expand Down
Loading

0 comments on commit fea2e7b

Please sign in to comment.