Merge commit '31306459472cd365ebb13b2c60762d5f6f8bad48' into HEAD
|
@ -204,6 +204,7 @@ This section explains only the blocks that have been added to the standard block
|
|||
[
|
||||
](rules-blockly-standard-ext.html)[
|
||||
](rules-blockly-standard-ext.html)[
|
||||

|
||||
](rules-blockly-standard-ext.html)
|
||||
|
||||
See [openHAB Extensions to the standard](rules-blockly-standard-ext.html) section.
|
||||
|
|
|
@ -80,6 +80,8 @@ Type: _ZonedDateTime_
|
|||
This block will return the date as _ZonedDateTime_ based on the given String.
|
||||
The String may be one of the following formats (since 3.3) the following formats are supported)
|
||||
|
||||
- HH:mm
|
||||
- HH:mm:ss
|
||||
- yyyy-MM-dd
|
||||
- yyyy-MM-dd HH:mm
|
||||
- yyyy-MM-dd HH:mm:ss
|
||||
|
@ -93,7 +95,11 @@ The String may be one of the following formats (since 3.3) the following formats
|
|||
The input String may also be provided via variable-block or a date from an item state.
|
||||
In case parts of the date are not provided due to shorter pattern, the others are set to 0
|
||||
|
||||
Tip: if you want to create a datetime with your time zone use the "copy of"-block and overwrite its values
|
||||
:::tip
|
||||
|
||||
if you want to create a datetime with your time zone use the "copy of"-block and overwrite its values
|
||||
|
||||
:::
|
||||
|
||||
More about that topic can be viewed at  [Creating Datetimes and other datetime blocks](https://youtu.be/KwhYKy1_qVk?t=2010)
|
||||
|
||||
|
@ -112,7 +118,11 @@ Creates a ZonedDateTime by providing all necessary six values
|
|||
- minute of time
|
||||
- second of time
|
||||
|
||||
Tip: if you want to create a datetime with your time zone use the "copy of"-block and overwrite its values
|
||||
:::tip
|
||||
|
||||
if you want to create a datetime with your time zone use the "copy of"-block and overwrite its values
|
||||
|
||||
:::
|
||||
|
||||
### Create Datetime based on a specific date ("Copy Of")
|
||||
|
||||
|
|
|
@ -42,8 +42,13 @@ See a video introduction at 
|
|||
|
||||
Function: Retrieves a specific **Item** or **Group** for use in other item related functions.
|
||||
|
||||
- **Tip:** never use this block alone as it only returns the items name which alone does not make sense.
|
||||
:::tip
|
||||
|
||||
never use this block alone as it only returns the items name which alone does not make sense.
|
||||
Instead use the get-Item-Block below.
|
||||
|
||||
:::
|
||||
|
||||
- Clicking 'MyItem' displays a list of **Items** to pick from
|
||||
- Technically this block returns the _name_ of the item as a String.
|
||||
- As a result, this block can be used wherever the item name is required as a String.
|
||||
|
@ -76,7 +81,11 @@ Function: Get the current state of an **Item** or **Group**
|
|||
|
||||
Note that most of the states can and will be directly **converted automatically to a String** but be careful that some of the **more complex states may instead return a complex object instead**.
|
||||
|
||||
**Tip:** it is recommended in this case to assign this to a variable and use the "String-Append-Text" with an empty "" to convert it into a String for further processing.
|
||||
:::tip
|
||||
|
||||
it is recommended in this case to assign this to a variable and use the "String-Append-Text" with an empty "" to convert it into a String for further processing.
|
||||
|
||||
:::
|
||||
|
||||
See the [Item-State documentation](https://www.openhab.org/docs/configuration/items.html#state) for more information
|
||||
|
||||
|
@ -102,6 +111,22 @@ The following example depicts the above possibilities:
|
|||
|
||||

|
||||
|
||||
### Get Items with Tag
|
||||
|
||||

|
||||
|
||||
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
|
||||
- if multiple tags are given, the item must have all of the tags ("and"-condition)
|
||||
|
||||
:::tip
|
||||
|
||||
If you need an item that has one of multiple tags, then you need to use one block of each and then use the ["concatenate list block"](https://www.openhab.org/docs/configuration/blockly/rules-blockly-standard-ext.html#concatenate-list) to combine the results.
|
||||
|
||||
:::
|
||||
|
||||
### Get particular attributes of an item
|
||||
|
||||

|
||||
|
|
|
@ -46,7 +46,22 @@ 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
|
||||
|
||||
Note: in case no or 0 values are retrieved, make sure that the item in question is actually persisted.
|
||||
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:
|
||||
|
||||

|
||||
|
||||
- previous state value: Gets the previous state with option to skip to different value as current
|
||||
- previous state value time: Gets the time when previous state last occurred with option to skip to different value as current
|
||||
|
||||
The skip option set to true allows to search for first state that is different from the current state.
|
||||
|
||||
_Important:_ This option is not supported by all persistence databases and may throw an error in that case (for example the standard rrd4j does _not_ support it while influxdb does support it).
|
||||
|
||||
Notes: in case no or 0 values are retrieved, make sure that the item in question is actually persisted.
|
||||
|
||||
**Previous State Example**
|
||||
|
||||

|
||||
|
||||
### Check item change / update since a point in time
|
||||
|
||||
|
|
|
@ -27,8 +27,6 @@ More about that topic can be viewed at 
|
||||
|
@ -39,6 +37,17 @@ _Function:_ return a newline character to be added to a string.
|
|||
|
||||

|
||||
|
||||
### Text Replace
|
||||
|
||||

|
||||
|
||||
_Function:_ Allows to replace something that is defined by the _pattern_ in the _origin_-text with what is provided in _replacement_.
|
||||
Note that the pattern can be just a text or also regex expression.
|
||||
|
||||
**Example:**
|
||||
|
||||

|
||||
|
||||
## Colors
|
||||
|
||||
More about that topic can be viewed at  [Using Color-Blocks and HSB-Conversion](https://youtu.be/EdllUlJ7p6k?t=1366)
|
||||
|
@ -77,7 +86,11 @@ _Function:_ Returns a color by mixing the given values in a range from 0 - 255 f
|
|||
|
||||
_Function:_ Blends two colors chosen via a color picker into one color by the given ratio.
|
||||
|
||||
Tip: this could be used for example with a loop that changes the ratio from 0 to 1 to blend the first color into a second
|
||||
:::tip
|
||||
|
||||
this could be used for example with a loop that changes the ratio from 0 to 1 to blend the first color into a second
|
||||
|
||||
:::
|
||||
|
||||
### Create HSB-color from RGB color (openHAB)
|
||||
|
||||
|
@ -97,13 +110,14 @@ _Function:_ This a special openHAB block that converts a hexadecimal color code
|
|||
|
||||
- use that block and connect one of the above blocks into that one to be able to retrieve the HSB value of that block.
|
||||
|
||||
**Example:**
|
||||
Example
|
||||
|
||||

|
||||
|
||||
## Lists
|
||||
|
||||

|
||||

|
||||
|
||||
### Dictionary for managing key / value pairs
|
||||
|
||||
|
@ -115,7 +129,7 @@ Then drag the key block on the upper left into the key/value bracket on the righ
|
|||
|
||||
Rename the keys as required and then add any value block type to the related key:
|
||||
|
||||
Example:
|
||||
**Example:**
|
||||
|
||||

|
||||
|
||||
|
@ -125,10 +139,20 @@ Example:
|
|||
|
||||
_Function:_ Retrieves the value of the key in the given directory
|
||||
|
||||
Example:
|
||||
**Example:**
|
||||
|
||||

|
||||
|
||||
### Concatenate lists
|
||||
|
||||

|
||||
|
||||
_Function:_ adds the second list to the first list and returns a new list
|
||||
|
||||
Example:
|
||||
|
||||

|
||||
|
||||
## Loops
|
||||
|
||||
Even though there a no specialized openHAB blocks provided, loops are used rather often.
|
||||
|
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 264 KiB After Width: | Height: | Size: 304 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 229 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 26 KiB |