rulesx
- Description:
Rules namespace
This namespace provides complete rules with specific functionality, as well as utilities to be used in rules. It is not comparable to but uses the namespace rules from openhab-js. The rules provided by this namespace are developed to be created from file-based scripts only!
- Source:
Classes
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:
(static) createRainAlarmRule(config)
- Description:
Create a rain alarm rule that monitors rain and wind conditions to raise alerts for open windows and doors when it rains.
Please note that, if enabled, the wind speed condition is only evaluated when the rain alarm becomes active or when the contact opens. It is not continuously monitored, so if the wind speed changes while the rain alarm is active, it will not trigger a alert.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
config |
RainAlarmConfig |
(static) createSceneEngine(sceneDefinition)
- Description:
Provides the
rulesx.SceneEngine
.
- Source:
Parameters:
(static) createTemperatureAlarmRule(config) → {MuteAlertFunction}
- Description:
Create a rule for a temperature-based alarm that monitors the temperature and raises alerts for open windows and doors when the temperatur condition callback returns true.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
config |
TemperatureAlarmConfig |
Returns:
a method to mute alerts for a specific contact Item for a certain time
- Type
- MuteAlertFunction