Inputs
Inputs
Section titled “Inputs”generateInputs(id, config) rendert Eingaben für IOTA-Attribute und Commands. Alle Felder mit data-iota werden von extractData() erfasst.
Top-Level Config
Section titled “Top-Level Config”| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
typeId | Ja | string | - | Blocktyp, z.B. block_inputs oder block_mail_inputs. |
typeConfig | Ja | object | - | Block-spezifische Konfiguration. |
saveButton | Nein | ActionConfig | - | Globaler Speichern-Button. |
actionButtons | Nein | ActionConfig[] | - | Zusätzliche Action Buttons. |
layout | Nein | { type?: 'splitActionButtons'; actionButtonsPosition?: 'left' | 'right' } | - | Layout für Action Buttons. |
Action Functions
Section titled “Action Functions”Actions werden nur im Input-Kontext genutzt: in saveButton, actionButtons, input.action.onclick oder onchange.
addMail
Section titled “addMail”Fügt den Inhalt eines Mail-Inputs der Chip-Liste unter dem Feld hinzu.
Verhalten
Section titled “Verhalten”- Validiert einzelne Mail-Adressen.
- Ignoriert Duplikate.
- Leert das Eingabefeld nach erfolgreichem Hinzufügen.
Beispiel
Section titled “Beispiel”offlineInput
Section titled “offlineInput”Synchronisiert das Offline-Zeitfeld mit der Offline-Checkbox.
Verhalten
Section titled “Verhalten”- Setzt die Checkbox auf aktiv, wenn der Input nicht leer und nicht 0 ist.
Beispiel
Section titled “Beispiel”offlineCheckbox
Section titled “offlineCheckbox”Setzt beim Aktivieren der Offline-Checkbox einen Default-Wert in das Offline-Zeitfeld.
Config
Section titled “Config”| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
defaultValue | Nein | string | number | 48 | Wert in Stunden, der in das Offline-Zeitfeld geschrieben wird. |
Beispiel
Section titled “Beispiel”updateSelectDependency
Section titled “updateSelectDependency”Aktualisiert Optionen, Wert und Disabled-State eines Ziel-Selects anhand eines Quell-Selects.
Config
Section titled “Config”| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
targetIotaVar | Ja | string | - | data-iota des Ziel-Selects. |
defaultValue | Nein | string | - | Fallback-Wert, wenn keine Regel passt. |
rules | Nein | Array<{ when: string; options?: Array<{ label: string; value: string }>; value?: string; disabled?: boolean }> | - | Regeln pro Quellwert. |
Beispiel
Section titled “Beispiel”saveAttributes
Section titled “saveAttributes”Speichert alle Inputs, Selects, Checkboxes und Mail-Chips mit data-iota auf dem aktuellen Device.
Verhalten
Section titled “Verhalten”- Validiert Number-Felder vor dem Speichern.
- Sendet PATCH an
/Device/${deviceid}. - Aktualisiert danach das Dashboard.
Beispiel
Section titled “Beispiel”changeDeviceType
Section titled “changeDeviceType”Speichert Attribute, wechselt den DeviceType und leitet danach auf das neue Details-Dashboard weiter.
Config
Section titled “Config”| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
changeDeviceType.iotaVar | Ja | string | - | Attribut, dessen Wert für die Typauswahl verwendet wird. |
changeDeviceType.array | Ja | Array<{ value: string; typeId: string | number }> | - | Mapping von Attributwert zu neuem DeviceType. |
Beispiel
Section titled “Beispiel”saveCommand
Section titled “saveCommand”Sendet einen IOTA Command. Inputwerte werden als Command-Parameter übernommen.
Config
Section titled “Config”| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
commandType | type | Ja | string | - | Command-Typ. |
deviceId | deviceid | Nein | string | ${deviceid} | Zielgerät. |
parameterMap | Nein | Record<string, string> | - | Mappt Input-iotaVars auf Parameter-Namen. |
staticParameters | parameters | Nein | Array<{ name: string; value: string }> | - | Zusätzliche feste Parameter. |
parameterTransform | Nein | { type: 'thresholdAlarm'; low?: string; high?: string; active?: string; control?: string } | - | Erzeugt Command-Parameter aus Speziallogik. |
Beispiel
Section titled “Beispiel”Threshold Alarm Beispiel
Section titled “Threshold Alarm Beispiel”thresholdAlarm verwendet standardmäßig threshold_low, threshold_high, alarm_active
und ctrl. Abweichende Feldnamen können über low, high, active und control
gesetzt werden.
saveAttributesAndCommand
Section titled “saveAttributesAndCommand”Speichert zuerst Attribute ohne Alert/Reload und sendet danach einen Command.
Config
Section titled “Config”| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
commandType | type | Ja | string | - | Command-Typ. |
parameterMap | Nein | Record<string, string> | - | Mappt gespeicherte Rohdaten auf Command-Parameter. |
staticParameters | parameters | Nein | Array<{ name: string; value: string }> | - | Zusätzliche feste Parameter. |
parameterTransform | Nein | { type: 'thresholdAlarm'; low?: string; high?: string; active?: string; control?: string } | - | Erzeugt Command-Parameter aus Speziallogik. |
Verhalten
Section titled “Verhalten”- Der Command wird nur gesendet, wenn das Attributspeichern erfolgreich war.
Beispiel
Section titled “Beispiel”saveCommandType
Section titled “saveCommandType”Sendet je nach Checkbox-Wert einen von zwei Command-Typen.
Config
Section titled “Config”| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
type_1 | Ja | string | - | Command-Typ bei Wert 1. |
type_0 | Ja | string | - | Command-Typ bei Wert 0. |
Verhalten
Section titled “Verhalten”- Erwartet exakt ein extrahiertes Feld, sonst wird ein Fehler angezeigt.
Beispiel
Section titled “Beispiel”saveAttributesMapped
Section titled “saveAttributesMapped”Speichert nur gemappte Attribute. Nützlich, wenn UI-Feldnamen nicht den IOTA-Attributen entsprechen.
Config
Section titled “Config”| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
attributeMap | Ja | Record<string, string> | - | Mapping von Input-iotaVar zu Zielattribut. |
Beispiel
Section titled “Beispiel”saveAttributesToMulitpleDevices
Section titled “saveAttributesToMulitpleDevices”Speichert dieselben Attribute auf mehrere Devices aus einer Grafana-Variable.
Config
Section titled “Config”| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
usecaseDevicesVarGraf | Ja | string | - | Kommagetrennte DeviceIds, typischerweise aus einer Grafana-Variable. |
Verhalten
Section titled “Verhalten”- Zeigt vorab einen Zeit-Hinweis.
- Sendet Updates nacheinander mit kurzem Delay.
Beispiel
Section titled “Beispiel”Feldtypen
Section titled “Feldtypen”input - Input
Section titled “input - Input”Standard-Eingabefeld für Text, Zahlen, Passwörter, E-Mail und Selects.
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
input.label | Nein | string | - | Label oberhalb des Feldes. |
input.placeholder | Nein | string | - | Placeholder im Feld. |
input.init | Nein | string | number | - | Initialer Wert, meistens aus initVarGraf(). |
input.iotaVar | Ja | string | - | IOTA-Attribut. Kommagetrennte Werte schreiben denselben Wert auf mehrere Attribute. |
input.type | Nein | 'text' | 'email' | 'number' | 'password' | 'select' | text | HTML-Input-Typ. Bei select wird createSelectField genutzt. |
input.min | Nein | number | - | Minimalwert für Number-Validierung. |
input.max | Nein | number | - | Maximalwert für Number-Validierung. |
input.step | Nein | number | string | - | Schrittweite für Number-Validierung. |
input.icon | Nein | 'add' | 'addMail' | 'cancel' | 'mail' | - | Icon links im Feld. |
input.onchange | Nein | ActionConfig | - | Action bei Wert-Änderung. |
input.action | Nein | { icon: string; onclick?: ActionConfig } | - | Icon-Button rechts im Feld. |
input.options | Bedingt | Array<{ label: string; value: string }> | - | Optionen, wenn input.type = select ist. |
input.disabled | Nein | boolean | - | Deaktiviert Select-Inputs. |
Zahlenfeld mit Validierung
Section titled “Zahlenfeld mit Validierung”Input mit Action-Button
Section titled “Input mit Action-Button”select - Select
Section titled “select - Select”Eigenes Select-Feld oder Input mit type select.
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
select.label | Nein | string | - | Label oberhalb des Selects. |
select.init | Nein | string | - | Initial ausgewählter Wert. |
select.iotaVar | Ja | string | - | IOTA-Attribut für den Select-Wert. |
select.options | Ja | Array<{ label: string; value: string }> | - | Optionen. |
select.onchange | Nein | ActionConfig | - | Action, z.B. updateSelectDependency. |
select.disabled | Nein | boolean | - | Rendert den Select deaktiviert. |
Einfacher Select
Section titled “Einfacher Select”Select mit abhängigen Optionen
Section titled “Select mit abhängigen Optionen”checkbox - Checkbox
Section titled “checkbox - Checkbox”Toggle, der als 1 oder 0 extrahiert und gespeichert wird.
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
checkbox.label | Nein | string | - | Text neben der Checkbox. |
checkbox.init | Nein | string | number | - | 0 = aus, 1 = an. |
checkbox.iotaVar | Ja | string | - | IOTA-Attribut. |
checkbox.onchange | Nein | ActionConfig | - | Action bei Statuswechsel. |
checkbox.center | Nein | boolean | false | Zentriert die Checkbox. |
Checkbox mit Save
Section titled “Checkbox mit Save”checkbox2 - Zweite Checkbox
Section titled “checkbox2 - Zweite Checkbox”Optionaler zweiter Toggle in demselben Feld.
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
checkbox2.label | Nein | string | - | Text neben der zweiten Checkbox. |
checkbox2.init | Nein | string | number | - | 0 = aus, 1 = an. |
checkbox2.iotaVar | Ja | string | - | IOTA-Attribut. |
checkbox2.onchange | Nein | ActionConfig | - | Action bei Statuswechsel. |
Zwei Checkboxen in einem Feld
Section titled “Zwei Checkboxen in einem Feld”dependentCheckbox - Abhängige Checkbox
Section titled “dependentCheckbox - Abhängige Checkbox”Checkbox, die nur aktiv ist, wenn checkbox oder checkbox2 aktiv ist.
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
dependentCheckbox.label | Nein | string | - | Text neben der abhängigen Checkbox. |
dependentCheckbox.init | Nein | string | number | - | Initialwert. Wird ignoriert, wenn keine Hauptcheckbox aktiv ist. |
dependentCheckbox.iotaVar | Ja | string | - | IOTA-Attribut. |
Abhängige Benachrichtigung
Section titled “Abhängige Benachrichtigung”display - Display
Section titled “display - Display”Readonly-Anzeige für Werte, die nicht gespeichert werden.
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
display.label | Nein | string | - | Label oberhalb des Wertes. |
display.init | Ja | string | - | Anzuzeigender Wert. |
display.emptyText | Nein | string | - | Text, wenn init leer ist. |
Readonly-Wert anzeigen
Section titled “Readonly-Wert anzeigen”E-Mail-Eingabe mit Chip-Liste, Semikolon-Trennung und Validierung.
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
mail.label | Nein | string | - | Label des Mail-Feldes. |
mail.init | Nein | string | - | Initiale Mail-Liste, getrennt mit Semikolon. |
mail.iotaVar | Ja | string | - | IOTA-Attribut für die gespeicherte Semikolon-Liste. |
Mail-Liste
Section titled “Mail-Liste”Action Buttons
Section titled “Action Buttons”Zusätzliche Buttons unter oder neben dem Input-Inhalt.
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
actionButtons[].label | Ja | string | - | Button-Text. |
actionButtons[].typeId | Ja | Action typeId | - | Action aus der Action-Referenz. |
layout.type | Nein | 'splitActionButtons' | - | Teilt Inhalt und Buttons in zwei Spalten. |
layout.actionButtonsPosition | Nein | 'left' | 'right' | right | Position der Buttons im Split-Layout. |
Split-Layout mit Command-Buttons
Section titled “Split-Layout mit Command-Buttons”Blocktypen
Section titled “Blocktypen”block_inputs - Inputs
Section titled “block_inputs - Inputs”Eine Standardzeile mit beliebigen Input-, Select-, Checkbox- oder Display-Feldern.
Config-Pfad: typeConfig.inputAttributes
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
saveButton | Nein | ActionConfig | - | Globaler Speichern-Button unterhalb aller Felder. |
typeConfig.inputAttributes | Ja | Array<FieldConfig> | - | Felder in einer Zeile. |
Drei Attribute speichern
Section titled “Drei Attribute speichern”block_mail - Mail
Section titled “block_mail - Mail”Standard-Mail-Konfiguration mit optionaler Checkbox, zweiter Checkbox, dependentCheckbox und Sensor-Readonly-Wert.
Config-Pfad: typeConfig.mailConfig
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
typeConfig.mailConfig.mail | Ja | MailConfig | - | Mail-Feld. |
typeConfig.mailConfig.checkbox | Nein | CheckboxConfig | - | Hauptcheckbox. |
typeConfig.mailConfig.checkbox2 | Nein | CheckboxConfig | - | Zweite Hauptcheckbox. |
typeConfig.mailConfig.dependentCheckbox | Nein | CheckboxConfig | - | Nur aktiv, wenn checkbox oder checkbox2 aktiv ist. |
typeConfig.mailConfig.sensorThreshold | Nein | DisplayConfig | - | Readonly-Anzeige unterhalb der Mail-Konfiguration. |
typeConfig.mailConfig.saveButton | Nein | ActionConfig | - | Speichern für die Mail-Zeile. |
Mail mit Aktivierungscheckbox
Section titled “Mail mit Aktivierungscheckbox”block_mail_inputs - Mail und Inputs
Section titled “block_mail_inputs - Mail und Inputs”Zwei Spalten: Attributzeilen und Mail-Konfiguration. Optional kann die Reihenfolge gedreht werden.
Config-Pfad: typeConfig
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
typeConfig.rows | Ja | Array<RowConfig> | - | Attributzeilen. |
typeConfig.mailConfig | Ja | MailConfig | - | Mail-Konfiguration. |
typeConfig.reverseCols | Nein | boolean | false | Dreht die Spaltenreihenfolge. |
Schwellwerte und Mails
Section titled “Schwellwerte und Mails”block_offline - Offline
Section titled “block_offline - Offline”Spezialblock für Offline-Benachrichtigungen mit Mail-Liste, Checkbox und Offline-Zeit.
Config-Pfad: typeConfig.offline
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
typeConfig.offline.checkbox | Ja | CheckboxConfig | - | Aktiviert Offline-Benachrichtigung. |
typeConfig.offline.input | Ja | InputConfig | - | Offline-Zeit in Stunden; wird beim Speichern als Minutenwert geschrieben. |
typeConfig.offline.mail | Ja | MailConfig | - | Mail-Liste. |
typeConfig.offline.saveButton | Nein | ActionConfig | { typeId: 'saveAttributes' } | Speichern der Offline-Zeit. |
typeConfig.reverseCols | Nein | boolean | false | Dreht Mail- und Offline-Spalte. |
Offline Alarm
Section titled “Offline Alarm”block_checkbox_row - Checkbox Row
Section titled “block_checkbox_row - Checkbox Row”Eine horizontale Reihe aus Checkboxes mit optionalem Save-Button.
Config-Pfad: typeConfig.checkboxRow
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
typeConfig.checkboxRow.checkboxes | Ja | Array<CheckboxConfig> | - | Checkboxes in der Reihe. |
typeConfig.checkboxRow.saveButton | Nein | ActionConfig | - | Speicherbutton unterhalb der Reihe. |
IO Richtung
Section titled “IO Richtung”block_custom - Custom
Section titled “block_custom - Custom”Container für mehrere Custom Columns.
Config-Pfad: typeConfig.custom_columns
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
typeConfig.custom_columns | Ja | Array<CustomColumnConfig> | - | Liste von Custom Columns. |
Custom Grid
Section titled “Custom Grid”custom_column_mail - Custom Column Mail
Section titled “custom_column_mail - Custom Column Mail”Mail-Spalte innerhalb von block_custom.
Config-Pfad: typeConfig.mailConfig
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
typeConfig.mailConfig | Ja | MailConfig | - | Mail-Konfiguration. |
Mail-Spalte in Custom Panel
Section titled “Mail-Spalte in Custom Panel”custom_column_inputs - Custom Column Inputs
Section titled “custom_column_inputs - Custom Column Inputs”Tabellarisches Input-Grid mit Spaltenüberschriften und Zeilentiteln.
Config-Pfad: typeConfig
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
typeConfig.headers | Ja | Array<string> | - | Spaltenüberschriften. |
typeConfig.rows | Ja | Array<{ title: string; inputs: InputConfig[] }> | - | Grid-Zeilen. |
Tabellarische Schwellwerte
Section titled “Tabellarische Schwellwerte”custom_column_checkbox_row - Custom Column Checkbox Row
Section titled “custom_column_checkbox_row - Custom Column Checkbox Row”Checkbox-Reihe innerhalb von block_custom.
Config-Pfad: typeConfig.checkboxRow
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
typeConfig.checkboxRow.checkboxes | Ja | Array<CheckboxConfig> | - | Checkboxes. |
Checkbox-Reihe in Custom Panel
Section titled “Checkbox-Reihe in Custom Panel”custom_column_checkbox_input - Custom Column Checkbox Input
Section titled “custom_column_checkbox_input - Custom Column Checkbox Input”Kombiniert eine Checkbox mit einem Input in einer Custom Column.
Config-Pfad: typeConfig
| Feld | Required | Typ | Default | Beschreibung |
|---|---|---|---|---|
typeConfig.checkbox | Ja | CheckboxConfig | - | Checkbox. |
typeConfig.input | Ja | InputConfig | - | Input. |
typeConfig.saveButton | Nein | ActionConfig | - | Optionaler Speicherbutton. |