You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: configuration/blockly/rules-blockly-getting-started.md
+71-49Lines changed: 71 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
2
layout: documentation
3
-
title: Rules Blockly - Before Using
3
+
title: Rules Blockly - Getting Started
4
4
---
5
5
<!-- markdownlint-disable MD036 -->
6
6
7
-
# Before using blockly in openHAB
7
+
# Getting Started with Blockly in openHAB
8
8
9
-
[return to Blockly Reference](index.html#before-using-blockly)
9
+
[Return to Blockly Reference](index.html#getting-started)
10
10
11
11
## Preface
12
12
@@ -17,34 +17,31 @@ Please read them carefully before asking questions in the forum.
17
17
18
18
[[toc]]
19
19
20
-
## **openHAB Configuration Files**
20
+
## openHAB Configuration Files
21
21
22
22
Some openHAB blocks rely on particular configuration files found in the openHAB configuration folder.
23
-
This folder is referred to as $OPENHAB\_CONF in this page, and the location of this folder for your setup can be found via the UI: _Help & About_ -> _Technical Information_ -> _Configuration folder_.
23
+
This folder is referred to as `$OPENHAB_CONF` throughout this documentation.
24
+
The location of this folder can be found via the UI when logged in as an admin: _Help & About_ -> _Technical Information_ -> _Configuration folder_.
24
25
25
-
- via mounting the files shares from the server to your client-PC.
26
-
In the main UI as an admin you can go to _Help & About_ and will have the different folder locations under _Technical information_.
27
-
- the exact configuration of the shares can be found on your server at [/etc/samba/smb.conf](https://github.com/openhab/openhabian/blob/main/includes/smb.conf).
28
-
- Use the share _openHAB_-conf when mounting it from Windows or macOS
26
+
When using openHABian, a [samba share](https://github.com/openhab/openhabian/blob/main/includes/smb.conf) called `openHAB-conf` is created for the configuration folder.
27
+
This share can be mounted on your computer for easy access.
29
28
30
-
**Link the openHAB share in Windows**
29
+
### Mounting the openHAB-conf share in Windows
31
30
32
-
- Find you openHAB-Server via the network share functionality
33
-
-User the share _openHAB_-conf to assign it to a network drive
31
+
- Find your openHAB-Server via the network share functionality
32
+
-Find the `openHAB-conf` folder and assign it to a network drive
34
33
35
-
**Link the openHAB share in macOS**
34
+
### Mounting the openHAB share in macOS
36
35
37
36
- Finder -> Go -> Connect to Server
38
-
- Enter the username and server name to connect to the openHAB Server
39
-
37
+
- Enter the username and server name to connect to the openHAB Server
- Access the folder directly on the openHAB server at _/etc/openhab_
44
+
- Access the folder directly on the openHAB server at `/etc/openhab`
48
45
49
46
All methods reveal the following folders
50
47
@@ -61,29 +58,39 @@ All methods reveal the following folders
61
58
- things
62
59
- transform
63
60
64
-
## Creating a blockly rule via the UI
65
-
66
-
Also view [Creating a Blockly Rule](https://youtu.be/EdllUlJ7p6k?t=429)
67
-
68
-
- go to Settings -> Rules
69
-
- press  on bottom right
70
-
- enter a unique id and rule name for your new blockly rule
71
-
- Under "When" click on "Add Trigger" to define a trigger for the rule (you may add multiple triggers which are perceived as any of those triggers may occurs which stands for an OR combination of the triggers)
72
-
- choose a title for the rule
73
-
- choose "item" (or something else) that should trigger the rule
74
-
- select the item from your model and the click PICK on the upper right corner
75
-
- choose "received a command", "was updated" or "changed"
- Press `Ctrl-s` (Windows) or `Command-s` (macOS) to save your rule
83
-
- Press `Ctrl-r` (Windows) or `Command-r` (macOS) to directly run your rule with the trigger
84
-
- Press `Ctrl-d` (Windows) or `Command-d` (macOS) to disable / enable your rule.
85
-
See the following video on [How to disable Rules](https://youtu.be/hSRfooBKn9A?t=1668)
86
-
-**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).
81
+
- Press <kbd>Ctrl</kbd>+<kbd>S</kbd> (Windows) or <kbd>Command</kbd>+<kbd>S</kbd> (macOS) to save your rule
82
+
- Press <kbd>Ctrl</kbd>+<kbd>R</kbd> (Windows) or <kbd>Command</kbd>+<kbd>R</kbd> (macOS) to directly run your rule with the trigger
83
+
- Press <kbd>Ctrl</kbd>+<kbd>D</kbd> (Windows) or <kbd>Command</kbd>+<kbd>D</kbd> (macOS) to disable / enable your rule.
84
+
See the following video on [How to disable Rules](https://youtu.be/hSRfooBKn9A?t=1668)
85
+
-**Click on****on the lower right of the bottom toolbar to see the generated code** and it will transition to (click again to come back to the blocks).
86
+
87
+
::: Note
88
+
89
+
Multiple triggers may be added to the rule.
90
+
The rule will be executed once for each trigger that occurred.
91
+
This means that if multiple trigger occurred, the rule will be executed multiple times.
92
+
93
+
:::
87
94
88
95
More about the topic of code generation can be viewed at [Blockly as an ECMA-Script code generator](https://youtu.be/EdllUlJ7p6k?t=1739)
89
96
@@ -108,6 +115,21 @@ A context menu is available when right-clicking on a block.
108
115
Right-clicking on an empty area in the workspace will pop up a slightly different context menu.
109
116
In particular, `Clean up Blocks` will automatically move and arrange your blocks neatly.
110
117
118
+
### Getting Help
119
+
120
+
Each block offers a **Help** link in its [context menu](#context-menu).
121
+
It will open a page that provides further information about the function of that particular block.
_When asking for help in the community forums, please include the respective code that is being generated._
130
+
131
+
See also: [Various Help Documentation available in openHAB Blocky](https://youtu.be/EdllUlJ7p6k?t=1589)
132
+
111
133
### Selecting Blocks
112
134
113
135
Click on a block to select it.
@@ -150,28 +172,28 @@ You can also copy a set of blocks into your clipboard, and paste them into anoth
150
172
151
173
### Searching the workspace
152
174
153
-
Sometimes blockly rules become pretty big, and it is hard to find particular blocks in the rule.
175
+
Sometimes Blockly rules become pretty big, and it is hard to find particular blocks in the rule.
154
176
Therefore, a search functionality has been provided by pressing Cmd/Ctrl-F which opens a small search window in the top right (just below the "save"-label).
155
177
After pressing _Enter_ all found blocks that contain the search term are marked in black.
During development the log-block is lot very often which writes information into the log files.
183
+
The logblock can be used to write information into the log file during development.
162
184
163
-
- To be able to conveniently view your log files it is recommended to setup _frontail_ which can be achieved easily via[openhabian-config](https://www.openhab.org/docs/installation/openhabian.html#optional-components)
185
+
- To view the log file, it is recommended to setup _frontail_ which can be installed easily with[openhabian-config](https://www.openhab.org/docs/installation/openhabian.html#optional-components)
164
186
- Start `openhabian-config` on your server and choose option 20 and then option 21
165
187
- After installation you can view your logs under [openhabian-config](http://myopenhab-server:9001) (adapt the server name)
166
-
-**see [how to log](https://www.openhab.org/docs/administration/logging.html)**
188
+
-See [Logging in openHAB](https://www.openhab.org/docs/administration/logging.html) for more details.
167
189
168
190
More on that topic can be viewed at [Logging](https://youtu.be/EdllUlJ7p6k?t=670)
169
191
170
-
## Show an item status watch list besides the blockly rules
192
+
## Show an item status watch list besides the Blockly rules
171
193
172
-
In the developer section there is the possibility to add a sidebar to the blockly rules development workspace that allows to watch live status of an item.
173
-
View the chapter [Debugging Rules with openHAB Developer Tools to watch Item-Status](https://youtu.be/EdllUlJ7p6k?t=325) for more information
194
+
In the developer section there is the possibility to add a sidebar to the Blockly rules development workspace that allows to watch live status of an item.
195
+
View the chapter [Debugging Rules with openHAB Developer Tools to watch Item-Status](https://youtu.be/EdllUlJ7p6k?t=325) for more information.
174
196
175
197
## Return to Blockly Reference
176
198
177
-
[return to Blockly Reference](index.html#before-using-blockly)
199
+
[Return to Blockly Reference](index.html#before-using-blockly)
Copy file name to clipboardExpand all lines: configuration/blockly/rules-blockly-standard-ext.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ title: Rules Blockly - openHAB Extensions to the Standard
6
6
7
7
# openHAB Extensions to the Standard
8
8
9
-
[return to Blockly Reference](index.html#openhab-extensions-to-the-standard)
9
+
[Return to Blockly Reference](index.html#openhab-extensions-to-the-standard)
10
10
11
11
## Introduction
12
12
@@ -243,9 +243,9 @@ Therefore there is a good introduction to loops available which can be viewed at
243
243
244
244
## Functions
245
245
246
-
A more advanced feature for reusable blockly code is _functions_.
246
+
A more advanced feature for reusable Blockly code is _functions_.
247
247
More about that topic can be viewed at [Functions](https://youtu.be/hSRfooBKn9A?t=60) and [Parameters](https://youtu.be/hSRfooBKn9A?t=170).
248
248
249
249
## Return to Blockly Reference
250
250
251
-
[return to Blockly Reference](index.html#openhab-extensions-to-the-standard)
251
+
[Return to Blockly Reference](index.html#openhab-extensions-to-the-standard)
0 commit comments