rulesx
- Description:
Rules namespace
This namespace provides complete rules with specific functions. It is not comparable to but uses the namespace rules from openhab-js.
- Source:
Classes
Namespaces
Methods
(static) createAlarmClock(switchItem, alarmFunc)
- Description:
Creates an alarm clock with time and days configurable over Items, therefore compatible with Sitemaps.
The manager rule that creates and updates the alarm clock rule
_createClockRule
on change of settings Items. Also creates and removes the alarm clock rule on command ON/OFF of switchItem.
- Source:
Example
rulesx.createAlarmClock('Florian_alarm1', data => { console.log('Successfully tested alarm clock.'); });
Parameters:
Name | Type | Description |
---|---|---|
switchItem |
string | name of Item to switch the alarm on/off |
alarmFunc |
function | function to execute when the alarm clock fires |
(static) createAlarmClockItems(switchItemName, switchItemLabel, persistenceGroup, sitemapSnippetopt, weekdaysLabelsopt)
- Description:
Creates all required Items for an alarm clock.
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
switchItemName |
String | name of Item to switch alarm on/off |
||
switchItemLabel |
String | label of Item to switch alarm on/off |
||
persistenceGroup |
String | name of group whose members are persisted & restored on startup |
||
sitemapSnippet |
Boolean |
<optional> |
false
|
whether to output a Sitemap snippet for alarm configuration |
weekdaysLabels |
Array.<String> |
<optional> |
['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag']
|
names of weekdays in your language, starting with Monday & ending with Sunday |
(static) createSceneEngine(sceneDefinition)
- Description:
Provides the
rulesx.SceneEngine
.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sceneDefinition |
object | scenes definition Properties
|