[blockly] finalize blockly docs for M3.3 (#1843)
* [blockly] finalize blockly docs for M3.3 Signed-off-by: Stefan Höhn <mail@stefanhoehn.com> * [blockly docs] remove MD025 check Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>pull/1856/head
|
@ -4,7 +4,7 @@ title: Rules Blockly
|
|||
---
|
||||
<!-- markdownlint-disable MD036 -->
|
||||
|
||||
# Blockly Reference 33
|
||||
# Blockly Reference
|
||||
|
||||
One of the core feature that OpenHAB provides is writing rules to allow specific behaviour with the home automation system.
|
||||
The usual way of developing rules is by coding them like described in the [Textual Rules](/docs/configuration/rules-dsl.html).
|
||||
|
@ -32,22 +32,25 @@ All of these provide general functionality that is not specific to openHAB itsel
|
|||
However, to leverage the full capabilities more than *50 specific blocks* have been provided that are tailored for easy access of openHAB's capabilities.
|
||||
|
||||
This section provides a detailed description of the specific blocks and provides examples on how to use them. Note that some of the blocks (like voice, streaming or notifications) need some special setup within openHAB - in these case links to the respective documentation is provided.
|
||||
It should also be mentioned that each of the blocks do have a context sensitive menu which appears upon a right click on the block itself.
|
||||
|
||||
**Block context menu**
|
||||
|
||||

|
||||
|
||||
**Looking for help**
|
||||
|
||||
A special mention should go towards the **Help** entry that links to a resource that is usually very helpful to understand the context of that particular block.
|
||||
A special mention should go towards the **Help** entry in a block context menu [right click on any block](rules-blockly-before-using.html#block-context-menu) that links to a resource that is usually very helpful to understand the context of that particular block.
|
||||
To retrieve the particular help for a block right click on a block to open the context menu and click on the **help**-entry:
|
||||
|
||||

|
||||
|
||||
There is also a help-button available in each section that links to the documentation of the whole section.
|
||||
|
||||

|
||||
|
||||
Please read this information first before asking questions in the forum. *In case you ask for help please always post the respective code that is being generated.*
|
||||
|
||||
## Before using blockly
|
||||
|
||||
Please visit [Getting started with openHAB Blocklies](rules-blockly-before-using.html) before asking questions in the forum
|
||||
|
||||
## Blocks
|
||||
## Blocks Overview
|
||||
|
||||
### Items and Things
|
||||
|
||||
|
@ -71,7 +74,7 @@ See [Timers and Delays](rules-blockly-timers-and-delays.html) section.
|
|||
### Date Handling
|
||||
|
||||
Date blocks are used as input parameters for other blocks.
|
||||
At the moment some of these blocks are found in the ephemeris section, whilst others are found in the persistence section - they may be equally useful for both. These blocks are *typed* to assure correct connection to other blocks.
|
||||
Some of these blocks are used by ephemeris blocks, whilst others are used in the persistence section. Therefore blocks are *typed* to assure correct connection to other blocks.
|
||||
|
||||
[
|
||||
](rules-blockly-date-handling.html) [
|
||||
|
|
|
@ -85,7 +85,43 @@ All methods reveal the following folders
|
|||
- Press `Ctrl-s` (Windows) or `Command-s` (MacOS) to save your rule
|
||||
- Press `Ctrl-r` (Windows) or `Command-r` (MacOS) to directly run your rule with the trigger
|
||||
- Press `Ctrl-d` (Windows) or `Command-d` (MacOS) to disable / enable your rule
|
||||
- Click on  on the lower right to see the generated code (click again to come back to the blocks)
|
||||
- Click on  on the lower right of the bottom toolbar to see the generated code and will transition to (click again to come back to the blocks)
|
||||
|
||||
### Block context menu
|
||||
|
||||
It should also be mentioned that each of the blocks do have a context sensitive menu which appears upon a right click on the block itself.
|
||||
|
||||

|
||||
|
||||
- **Duplicate**: Clones the block
|
||||
- **Add comment**: Adds a comment to the block
|
||||
- **Inline Inputs** / External inputs: Switches between horizontal or vertical alignment of inputs
|
||||
|
||||
Inline:
|
||||

|
||||
|
||||
External:
|
||||

|
||||
|
||||
- **Collapse (expand) block**: Shrinks the block to get a better overview
|
||||
|
||||
Normal block view:
|
||||

|
||||
|
||||
Collapsed view:
|
||||
|
||||

|
||||
|
||||
- **Disable (enable) block**: Disables the block, so no code is generated and its functionality switched off
|
||||
- **Delete**: delete the blocks (this can be reverted via Command/Ctrl-Z)
|
||||
|
||||
### Zoom the workspace
|
||||
|
||||
The following controls allow the workspace to be zoomed:
|
||||
|
||||

|
||||
|
||||
Pinching on a tablet or a touch bar also allows convenient zooming of the workspace.
|
||||
|
||||
## Use Frontail for viewing log files
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ The time is set to `00:00:00`.
|
|||
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.0M6 the following formats are supported)
|
||||
The String may be one of the following formats (since 3.3) the following formats are supported)
|
||||
|
||||
- yyyy-MM-dd
|
||||
- yyyy-MM-dd HH:mm
|
||||
|
@ -117,7 +117,7 @@ Tip: if you want to create a datetime with your time zone use the "copy of"-bloc
|
|||
|
||||
### Create Datetime based on a specific date ("Copy Of")
|
||||
|
||||
since 3.3.0M6
|
||||
since 3.3
|
||||
|
||||

|
||||
|
||||
|
@ -197,7 +197,7 @@ This variable is then used as the value to amend the lastUpdatedTime of an item
|
|||
|
||||
### Datetime from item
|
||||
|
||||
since 3.3.0M6
|
||||
since 3.3
|
||||
|
||||

|
||||
|
||||
|
@ -215,7 +215,7 @@ Type: *String*
|
|||
|
||||
Returns the String representation of a given *ZonedDateTime*-block, with or without the time.
|
||||
|
||||
since 3.3.0M6: also returns the same datetime format that is used by openHAB itself
|
||||
since 3.3: also returns the same datetime format that is used by openHAB itself
|
||||
|
||||
**Example**
|
||||
|
||||
|
@ -233,7 +233,7 @@ The output in the log will be.
|
|||
|
||||
### Date Comparison
|
||||
|
||||
since 3.3.0M6
|
||||
since 3.3
|
||||
|
||||

|
||||
|
||||
|
@ -246,7 +246,7 @@ Returns true/false based on the comparison
|
|||
|
||||
### Date Comparison Between
|
||||
|
||||
since 3.3.0M6
|
||||
since 3.3
|
||||
|
||||

|
||||
|
||||
|
@ -259,7 +259,7 @@ Returns true/false based on the comparison
|
|||
|
||||
### Get part of datetime
|
||||
|
||||
since 3.3.0M6
|
||||
since 3.3
|
||||
|
||||

|
||||
|
||||
|
@ -269,7 +269,7 @@ Returns the selected part of the datetime as a number.
|
|||
|
||||
### Get difference between datetimes
|
||||
|
||||
since 3.3.0M6
|
||||
since 3.3
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -4,8 +4,12 @@ title: Rules Blockly - Items & Things
|
|||
---
|
||||
<!-- markdownlint-disable MD036 -->
|
||||
|
||||
# Item & Things
|
||||
|
||||
[return to Blockly Reference](index.html#items-and-things)
|
||||
|
||||
## Introduction
|
||||
|
||||
*Items* and *Things* are the [major entities of openHAB](https://www.openhab.org/docs/concepts/) to control and monitor the home.
|
||||
These can be accessed via the "Items & Things" section of the [Blockly Toolbox](/docs/configuration/index.html#blockly-toolbox).
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ These blocks enable arbitrary content to be published to the [openHAB log](https
|
|||
- debug
|
||||
- trace
|
||||
|
||||
Since OpenHAB 3.3.0M6: The block attached to the log-block is not restricted to a string type block anymore
|
||||
Since 3.3: The block attached to the log-block is not restricted to a string type block anymore
|
||||
|
||||
### Print Statement
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ Provides the possibility to inject any ECMAScript at a given position.
|
|||
This should be used in cases when Blockly does not provide the desired functionality.
|
||||
Use with diligence.
|
||||
|
||||
### Example:
|
||||
### Example
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ An example is as follows:
|
|||
|
||||

|
||||
|
||||
Setting up an endless timer in teh above way is not recommended. The example shown below will stop rescheduling after 3 doorbell rings.
|
||||
Setting up an endless timer in the above way is not recommended. The example shown below will stop rescheduling after 3 doorbell rings.
|
||||
|
||||

|
||||
|
||||
|
@ -179,6 +179,7 @@ if (typeof this.timers['rescheduleTimerBlock'] === 'undefined' || this.timers['r
|
|||
### Timer is Running
|
||||
|
||||

|
||||
|
||||
*Function*: returns `true` if the code *within the timer block* is currently running - i.e. the countdown has finished, and the code within the timer block is currently executing. This event will usually only last a few milliseconds, and you’d be (un)lucky to catch it when your rule retriggers.
|
||||
|
||||
### Timer has terminated
|
||||
|
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 136 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 101 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 356 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 264 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 48 KiB |