rulesx

Namespace

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

SceneEngine

Namespaces

alerting

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:
Source:
Parameters:
Name Type Description
sceneDefinition object

scenes definition

Properties
Name Type Description
controller string

name of Item that calls the scenes

scenes Array.<object>

Array of scenes

Properties
Name Type Description
value number

integer identifying the scene

targets Array.<object>

Array of scene members

Properties
Name Type Attributes Default Description
item string

name of Item

value string

target state of Item

required boolean <optional>
true

whether the Item's state must match the target state when the engine gets the current scene on change of a member

conditionFn function <optional>

the Item is only commanded and required for scene checks if the evaluation of this function returns true