-
-
Notifications
You must be signed in to change notification settings - Fork 735
Yaml rules and rule templates documentation #2737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,106
−7
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
037c5e7
Add rules and rule templates to the YAML overview page
6d32dc4
Extend concepts documentation with standard triggers, conditions and …
0326d4f
Create YAML rules documentation
4b39d35
Create YAML rule templates documentation
2c39731
Address review feedback
96fa3da
Address review comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| --- | ||
| layout: documentation | ||
| title: Standard Actions | ||
| --- | ||
|
|
||
| # Standard Actions | ||
|
|
||
| This page describes the standard actions for [rules](./rules.md). | ||
|
|
||
| OpenHAB comes with a set of standard actions. | ||
|
Nadahar marked this conversation as resolved.
Outdated
|
||
| These are built-in mechanisms that perform actions on behalf of rules. | ||
|
|
||
| ## Actions Structure | ||
|
|
||
| The standard actions are fundamentally Java classes that implement the required logic. | ||
| We identify these actions using a code called the action type. | ||
| These codes are used as titles for the sections below. | ||
| To tell the action implementation what to do, actions can have configuration parameters with predefined names. | ||
| These configuration parameters and a brief description of what values they expect are listed in the following sections. | ||
|
|
||
| ### `core.RuleEnablementAction` | ||
|
|
||
| This action enables or disables one or more specified `Rule`s. | ||
|
|
||
| | Parameter | Description | | ||
| |------------|-----------------------------------------------------------------------------------------| | ||
| | `ruleUIDs` | The `List` of rule UIDs of the `Rule`s to enable or disable. | | ||
| | `enable` | The boolean value that decides if the rule(s) should be enabled or disabled. | | ||
|
|
||
| ### `core.RunRuleAction` | ||
|
|
||
| This action runs one or more specified `Rule`s. | ||
|
|
||
| | Parameter | Description | | ||
| |------------------------|--------------------------------------------------------------------------------------------| | ||
| | `ruleUIDs` | The `List` of rule UIDs of the `Rule`s to run. | | ||
| | `[considerConditions]` | A boolean value that determines if `Condition`s should be considered. Defaults to `false`. | | ||
|
|
||
| ### `core.ItemCommandAction` | ||
|
|
||
| This action sends a `Command` to an `Item`. | ||
|
|
||
| | Parameter | Description | | ||
| |------------|-----------------------------------------------------------------------------------------| | ||
| | `itemName` | The name of the `Item`. | | ||
| | `command` | The `Command` to send. | | ||
|
|
||
| ### `core.ItemStateUpdateAction` | ||
|
|
||
| This action updates the `State` of an `Item`. | ||
|
|
||
| | Parameter | Description | | ||
| |------------|-----------------------------------------------------------------------------------------| | ||
| | `itemName` | The name of the `Item`. | | ||
| | `state` | The `State` to set. | | ||
|
|
||
| ### `media.PlayAction` | ||
|
|
||
| This action plays an audio file. | ||
|
|
||
| | Parameter | Description | | ||
| |-------------|-----------------------------------------------------------------------------------------| | ||
| | `sound` | The filename of the file from the `sounds` folder. | | ||
| | `[sink]` | The ID of the audio sink to use. Leave out to use the default. | | ||
| | `[volume]` | The volume to be used. Leave out to use the default. | | ||
|
|
||
| ### `media.SayAction` | ||
|
|
||
| This action uses the voice system to say the specified text. | ||
|
|
||
| | Parameter | Description | | ||
| |-------------|-----------------------------------------------------------------------------------------| | ||
| | `text` | The text to say. | | ||
| | `[sink]` | The ID of the voice to use. Leave out to use the default. | | ||
|
Nadahar marked this conversation as resolved.
Outdated
|
||
| | `[volume]` | The volume to be used. Leave out to use the default. | | ||
|
|
||
| ### `script.ScriptAction` | ||
|
|
||
| This action executes the provided script. | ||
|
|
||
| | Parameter | Description | | ||
| |-----------|-------------------------------------------------------------------------| | ||
| | `type` | The code/MIME-type for the scripting language. | | ||
| | `script` | The script content to execute. | | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| --- | ||
| layout: documentation | ||
| title: Standard Conditions | ||
| --- | ||
|
|
||
| # Standard Conditions | ||
|
|
||
| This page describes the standard conditions for [rules](./rules.md). | ||
|
|
||
| OpenHAB comes with a set of standard conditions. | ||
|
Nadahar marked this conversation as resolved.
Outdated
|
||
| These are built-in mechanisms that decide if a rule should be executed when triggered. | ||
|
|
||
| ## Conditions Structure | ||
|
|
||
| The standard conditions are fundamentally Java classes that implement the required logic. | ||
| We identify these conditions using a code called the condition type. | ||
| These codes are used as titles for the sections below. | ||
| To tell the condition implementation what to evaluate, conditions can have configuration parameters with predefined names. | ||
| These configuration parameters and a brief description of what values they expect are listed in the following sections. | ||
|
|
||
| ### `ephemeris.DaysetCondition` | ||
|
|
||
| This condition checks if the current day is in the configured `dayset`. | ||
|
|
||
| | Parameter | Description | | ||
| |------------|-----------------------------------------------------------------------------------------| | ||
| | `dayset` | The name of a `dayset` from the ephemeris settings. | | ||
| | `[offset]` | The number of days to add to or subtract from the current day (values can be negative). | | ||
|
|
||
| ### `ephemeris.WeekdayCondition` | ||
|
|
||
| This condition verifies that the current day is a weekday. | ||
|
|
||
| | Parameter | Description | | ||
| |------------|-----------------------------------------------------------------------------------------| | ||
| | `[offset]` | The number of days to add to or subtract from the current day (values can be negative). | | ||
|
|
||
| ### `ephemeris.WeekendCondition` | ||
|
|
||
| This condition verifies that the current day is in a weekend. | ||
|
|
||
| | Parameter | Description | | ||
| |------------|-----------------------------------------------------------------------------------------| | ||
| | `[offset]` | The number of days to add to or subtract from the current day (values can be negative). | | ||
|
|
||
| ### `ephemeris.HolidayCondition` | ||
|
|
||
| This condition verifies that the current day is a holiday. | ||
|
|
||
| | Parameter | Description | | ||
| |------------|-----------------------------------------------------------------------------------------| | ||
| | `[offset]` | The number of days to add to or subtract from the current day (values can be negative). | | ||
|
|
||
| ### `ephemeris.NotHolidayCondition` | ||
|
|
||
| This condition verifies that the current day isn't a holiday. | ||
|
|
||
| | Parameter | Description | | ||
| |------------|-----------------------------------------------------------------------------------------| | ||
| | `[offset]` | The number of days to add to or subtract from the current day (values can be negative). | | ||
|
|
||
| ### `timer.DayOfWeekCondition` | ||
|
|
||
| This condition checks the current day of the week against a specified list of days. | ||
|
|
||
| | Parameter | Description | | ||
| |-----------|-----------------------------------------------------------------------------------------------------------------------------------------| | ||
| | `days` | A set of days to check against. The days are specified with the following strings: `MON`, `TUE`, `WED`, `THU`, `FRI`, `SAT`, and `SUN`. | | ||
|
|
||
| ### `timer.IntervalCondition` | ||
|
|
||
| This condition verifies that a minimum interval has elapsed since the last time the condition was met. | ||
|
|
||
| | Parameter | Description | | ||
| |---------------|-------------------------------------------------------------------------| | ||
| | `minInterval` | The minimum number of milliseconds since the last satisfied evaluation. | | ||
|
|
||
| ### `core.ItemStateCondition` | ||
|
|
||
| This condition verifies that the `State` of the specified `Item` fulfills the requirements. | ||
|
|
||
| | Parameter | Description | | ||
| |---------------|-------------------------------------------------------------------------| | ||
| | `itemName` | The name of the `Item`. | | ||
| | `operator` | The evaluation operator, one of `=`, `!=`, `<`, `<=`, `>`, and `>=`. | | ||
| | `state` | The `State` to compare with. | | ||
|
|
||
| ### `script.ScriptCondition` | ||
|
|
||
| This condition verifies that the provided script returns `true`. | ||
|
|
||
| | Parameter | Description | | ||
| |-----------|-------------------------------------------------------------------------| | ||
| | `type` | The code/MIME-type for the scripting language. | | ||
| | `script` | The script content in the specified scripting language. | | ||
|
|
||
| ### `core.ThingStatusCondition` | ||
|
|
||
| This condition verifies that the status of the specified `Thing` fulfills the requirements. | ||
|
|
||
| | Parameter | Description | | ||
| |------------|-------------------------------------------------------------------------| | ||
| | `thingUID` | The UID of the `Thing`. | | ||
| | `operator` | The evaluation operator, either `=` or `!=`. | | ||
| | `status` | The status to compare with. | | ||
|
Nadahar marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### `core.TimeOfDayCondition` | ||
|
|
||
| This condition verifies that the clock is within the specified time window. | ||
|
|
||
| | Parameter | Description | | ||
| |-------------|--------------------------------------------------------------------------| | ||
| | `startTime` | The start of the time window. | | ||
| | `endTime` | The end of the time window. | | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.