itemutils
- Description:
Items namespace
This namespace provides tools for Items.
- Source:
Classes
Methods
(static) dimItem(itemName, targetState, step, time, ignoreExternalChangeopt, overwriteopt)
- Description:
Dims an Item step-by-step to a target state.
Only works for Items with support for float states. The dimmer uses the shared cache to ensure that there are not multiple timers for the same Item active at the same time.
- Source:
Example
// Dim the Bedroom_Light to 50% in 750 seconds (1% each 15 seconds).
itemutils.dimItem('Bedroom_Light', 50.0, 1, 15 * 1000);
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
itemName |
string | name of the Item to control |
||
targetState |
number | float number to dim to |
||
step |
number | dimming step size |
||
time |
number | time in milliseconds between each step |
||
ignoreExternalChange |
boolean |
<optional> |
false
|
whether to break dimmer if Item receives a large external change |
overwrite |
boolean |
<optional> |
false
|
whether to cancel an existing dimmer and create a new one |
Throws:
-
when a parameter has wrong type
- Type
- TypeError
(static) getGroupUtils(groupName) → {GroupUtils}
- Description:
Gets an instance of groupUtils.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
groupName |
string | the name of the group |
Returns:
- Type
- GroupUtils
(static) getRoofwindowOpenLevel(baseItem) → {roofwindowState}
- Description:
Get the level a roofwindow is opened. The roofwindow can either be completely opened or a bit opened (große Lüftung) or a little bit opened (kleine Lüftung) or closed. Item naming scheme is required:
- baseitemname +
_zu
- baseitemname +
_klLueftung
- baseitemname +
_grLueftung
- baseitemname +
- Source:
Parameters:
Name | Type | Description |
---|---|---|
baseItem |
String | base of the Items names, e.g. |
Returns:
items.roofwindowState
- Type
- roofwindowState
Type Definitions
roofwindowState
- Description:
representation of roofwindow state / openess level
- Source:
Properties:
Name | Type | Description |
---|---|---|
text |
String | textual representation of openess level (in German) |
int |
Number | Integer reprentation of openess level: 100 for completely closed, 1 for a little bit opened, 2 for a bit opened & 4 for completely opened (5 on error) |
representation of roofwindow state / openess level
Type:
- Object