Skip to content
Grafana Panels Docs

Inputs

generateInputs(id, config) rendert Eingaben für IOTA-Attribute und Commands. Alle Felder mit data-iota werden von extractData() erfasst.

FeldRequiredTypDefaultBeschreibung
typeIdJastring-Blocktyp, z.B. block_inputs oder block_mail_inputs.
typeConfigJaobject-Block-spezifische Konfiguration.
saveButtonNeinActionConfig-Globaler Speichern-Button.
actionButtonsNeinActionConfig[]-Zusätzliche Action Buttons.
layoutNein{ type?: 'splitActionButtons'; actionButtonsPosition?: 'left' | 'right' }-Layout für Action Buttons.

Actions werden nur im Input-Kontext genutzt: in saveButton, actionButtons, input.action.onclick oder onchange.

Fügt den Inhalt eines Mail-Inputs der Chip-Liste unter dem Feld hinzu.

  • Validiert einzelne Mail-Adressen.
  • Ignoriert Duplikate.
  • Leert das Eingabefeld nach erfolgreichem Hinzufügen.
{
  typeId: 'addMail',
}

Synchronisiert das Offline-Zeitfeld mit der Offline-Checkbox.

  • Setzt die Checkbox auf aktiv, wenn der Input nicht leer und nicht 0 ist.
{
  typeId: 'offlineInput',
}

Setzt beim Aktivieren der Offline-Checkbox einen Default-Wert in das Offline-Zeitfeld.

FeldRequiredTypDefaultBeschreibung
defaultValueNeinstring | number48Wert in Stunden, der in das Offline-Zeitfeld geschrieben wird.
{
  typeId: 'offlineCheckbox',
  config: {
    defaultValue: initVarGraf('${OFFLINE}', 2),
  },
}

Aktualisiert Optionen, Wert und Disabled-State eines Ziel-Selects anhand eines Quell-Selects.

FeldRequiredTypDefaultBeschreibung
targetIotaVarJastring-data-iota des Ziel-Selects.
defaultValueNeinstring-Fallback-Wert, wenn keine Regel passt.
rulesNeinArray<{ when: string; options?: Array<{ label: string; value: string }>; value?: string; disabled?: boolean }>-Regeln pro Quellwert.
{
  typeId: 'updateSelectDependency',
  config: {
    targetIotaVar: 'alarm_level',
    rules: [
      {
        when: 'advanced',
        options: [{ label: 'High', value: 'high' }],
      },
    ],
  },
}

Speichert alle Inputs, Selects, Checkboxes und Mail-Chips mit data-iota auf dem aktuellen Device.

  • Validiert Number-Felder vor dem Speichern.
  • Sendet PATCH an /Device/${deviceid}.
  • Aktualisiert danach das Dashboard.
{
  typeId: 'saveAttributes',
}

Speichert Attribute, wechselt den DeviceType und leitet danach auf das neue Details-Dashboard weiter.

FeldRequiredTypDefaultBeschreibung
changeDeviceType.iotaVarJastring-Attribut, dessen Wert für die Typauswahl verwendet wird.
changeDeviceType.arrayJaArray<{ value: string; typeId: string | number }>-Mapping von Attributwert zu neuem DeviceType.
{
  typeId: 'changeDeviceType',
  config: {
    changeDeviceType: {
      iotaVar: 'measuring_direction',
      array: [
        { value: 'consumption', typeId: 20437 },
        { value: 'supply', typeId: 20438 },
      ],
    },
  },
}

Sendet einen IOTA Command. Inputwerte werden als Command-Parameter übernommen.

FeldRequiredTypDefaultBeschreibung
commandType | typeJastring-Command-Typ.
deviceId | deviceidNeinstring${deviceid}Zielgerät.
parameterMapNeinRecord<string, string>-Mappt Input-iotaVars auf Parameter-Namen.
staticParameters | parametersNeinArray<{ name: string; value: string }>-Zusätzliche feste Parameter.
parameterTransformNein{ type: 'thresholdAlarm'; low?: string; high?: string; active?: string; control?: string }-Erzeugt Command-Parameter aus Speziallogik.
{
  typeId: 'saveCommand',
  config: {
    commandType: 'out_set',
    parameterMap: {
      relay_state: 'state',
    },
    staticParameters: [{ name: 'source', value: 'grafana' }],
  },
}
{
  typeId: 'saveCommand',
  config: {
    commandType: 'threshold_alarm',
    parameterTransform: {
      type: 'thresholdAlarm',
    },
  },
}

thresholdAlarm verwendet standardmäßig threshold_low, threshold_high, alarm_active und ctrl. Abweichende Feldnamen können über low, high, active und control gesetzt werden.

Speichert zuerst Attribute ohne Alert/Reload und sendet danach einen Command.

FeldRequiredTypDefaultBeschreibung
commandType | typeJastring-Command-Typ.
parameterMapNeinRecord<string, string>-Mappt gespeicherte Rohdaten auf Command-Parameter.
staticParameters | parametersNeinArray<{ name: string; value: string }>-Zusätzliche feste Parameter.
parameterTransformNein{ type: 'thresholdAlarm'; low?: string; high?: string; active?: string; control?: string }-Erzeugt Command-Parameter aus Speziallogik.
  • Der Command wird nur gesendet, wenn das Attributspeichern erfolgreich war.
{
  typeId: 'saveAttributesAndCommand',
  config: {
    commandType: 'threshold_set',
    parameterMap: {
      threshold: 'value',
    },
  },
}

Sendet je nach Checkbox-Wert einen von zwei Command-Typen.

FeldRequiredTypDefaultBeschreibung
type_1Jastring-Command-Typ bei Wert 1.
type_0Jastring-Command-Typ bei Wert 0.
  • Erwartet exakt ein extrahiertes Feld, sonst wird ein Fehler angezeigt.
{
  typeId: 'saveCommandType',
  config: {
    type_1: 'relay_on',
    type_0: 'relay_off',
  },
}

Speichert nur gemappte Attribute. Nützlich, wenn UI-Feldnamen nicht den IOTA-Attributen entsprechen.

FeldRequiredTypDefaultBeschreibung
attributeMapJaRecord<string, string>-Mapping von Input-iotaVar zu Zielattribut.
{
  typeId: 'saveAttributesMapped',
  config: {
    attributeMap: {
      ui_threshold: 'temperature_threshold',
    },
  },
}

Speichert dieselben Attribute auf mehrere Devices aus einer Grafana-Variable.

FeldRequiredTypDefaultBeschreibung
usecaseDevicesVarGrafJastring-Kommagetrennte DeviceIds, typischerweise aus einer Grafana-Variable.
  • Zeigt vorab einen Zeit-Hinweis.
  • Sendet Updates nacheinander mit kurzem Delay.
{
  typeId: 'saveAttributesToMulitpleDevices',
  config: {
    usecaseDevicesVarGraf: '${all_usecase_devices}',
  },
}

Standard-Eingabefeld für Text, Zahlen, Passwörter, E-Mail und Selects.

FeldRequiredTypDefaultBeschreibung
input.labelNeinstring-Label oberhalb des Feldes.
input.placeholderNeinstring-Placeholder im Feld.
input.initNeinstring | number-Initialer Wert, meistens aus initVarGraf().
input.iotaVarJastring-IOTA-Attribut. Kommagetrennte Werte schreiben denselben Wert auf mehrere Attribute.
input.typeNein'text' | 'email' | 'number' | 'password' | 'select'textHTML-Input-Typ. Bei select wird createSelectField genutzt.
input.minNeinnumber-Minimalwert für Number-Validierung.
input.maxNeinnumber-Maximalwert für Number-Validierung.
input.stepNeinnumber | string-Schrittweite für Number-Validierung.
input.iconNein'add' | 'addMail' | 'cancel' | 'mail'-Icon links im Feld.
input.onchangeNeinActionConfig-Action bei Wert-Änderung.
input.actionNein{ icon: string; onclick?: ActionConfig }-Icon-Button rechts im Feld.
input.optionsBedingtArray<{ label: string; value: string }>-Optionen, wenn input.type = select ist.
input.disabledNeinboolean-Deaktiviert Select-Inputs.
{
  input: {
    label: 'Alarm Schwellwert [°C]',
    iotaVar: 'temp_threshold',
    type: 'number',
    min: -10,
    max: 50,
    step: 0.5,
    init: initVarGraf('${THRESHOLD}', 0),
  },
}
{
  input: {
    label: 'E-Mail',
    iotaVar: 'notification_emails',
    type: 'email',
    icon: 'mail',
    action: {
      icon: 'add',
      onclick: { typeId: 'addMail' },
    },
  },
}

Eigenes Select-Feld oder Input mit type select.

FeldRequiredTypDefaultBeschreibung
select.labelNeinstring-Label oberhalb des Selects.
select.initNeinstring-Initial ausgewählter Wert.
select.iotaVarJastring-IOTA-Attribut für den Select-Wert.
select.optionsJaArray<{ label: string; value: string }>-Optionen.
select.onchangeNeinActionConfig-Action, z.B. updateSelectDependency.
select.disabledNeinboolean-Rendert den Select deaktiviert.
{
  select: {
    label: 'Messrichtung',
    iotaVar: 'measuring_direction',
    init: initVarGraf('${INPUTS}', 1),
    options: [
      { label: 'Verbrauch', value: 'consumption' },
      { label: 'Einspeisung', value: 'supply' },
    ],
  },
}
{
  select: {
    label: 'Modus',
    iotaVar: 'mode',
    options: [
      { label: 'Standard', value: 'standard' },
      { label: 'Erweitert', value: 'advanced' },
    ],
    onchange: {
      typeId: 'updateSelectDependency',
      config: {
        targetIotaVar: 'alarm_level',
        rules: [
          {
            when: 'advanced',
            options: [{ label: 'High', value: 'high' }],
          },
        ],
      },
    },
  },
}

Toggle, der als 1 oder 0 extrahiert und gespeichert wird.

FeldRequiredTypDefaultBeschreibung
checkbox.labelNeinstring-Text neben der Checkbox.
checkbox.initNeinstring | number-0 = aus, 1 = an.
checkbox.iotaVarJastring-IOTA-Attribut.
checkbox.onchangeNeinActionConfig-Action bei Statuswechsel.
checkbox.centerNeinbooleanfalseZentriert die Checkbox.
{
  checkbox: {
    label: 'Alarm aktiv',
    iotaVar: 'alarm_active',
    init: initVarGraf('${ALARMS}', 0),
  },
  saveButton: { typeId: 'saveAttributes' },
}

Optionaler zweiter Toggle in demselben Feld.

FeldRequiredTypDefaultBeschreibung
checkbox2.labelNeinstring-Text neben der zweiten Checkbox.
checkbox2.initNeinstring | number-0 = aus, 1 = an.
checkbox2.iotaVarJastring-IOTA-Attribut.
checkbox2.onchangeNeinActionConfig-Action bei Statuswechsel.
{
  checkbox: {
    label: 'Eingang',
    iotaVar: 'io_in',
    init: initVarGraf('${IO}', 0),
  },
  checkbox2: {
    label: 'Ausgang',
    iotaVar: 'io_out',
    init: initVarGraf('${IO}', 1),
  },
}

Checkbox, die nur aktiv ist, wenn checkbox oder checkbox2 aktiv ist.

FeldRequiredTypDefaultBeschreibung
dependentCheckbox.labelNeinstring-Text neben der abhängigen Checkbox.
dependentCheckbox.initNeinstring | number-Initialwert. Wird ignoriert, wenn keine Hauptcheckbox aktiv ist.
dependentCheckbox.iotaVarJastring-IOTA-Attribut.
{
  checkbox: {
    label: 'Alarm aktiv',
    iotaVar: 'alarm_active',
    init: initVarGraf('${ALARM}', 0),
  },
  dependentCheckbox: {
    label: 'Push zusätzlich aktivieren',
    iotaVar: 'alarm_push',
    init: initVarGraf('${ALARM}', 1),
  },
}

Readonly-Anzeige für Werte, die nicht gespeichert werden.

FeldRequiredTypDefaultBeschreibung
display.labelNeinstring-Label oberhalb des Wertes.
display.initJastring-Anzuzeigender Wert.
display.emptyTextNeinstring-Text, wenn init leer ist.
{
  display: {
    label: 'Alarmeinstellung auf dem Sensor:',
    init: initVarGraf('${SENSOR_THRESHOLD}', 0),
    emptyText: 'Keine Einstellung vorhanden!',
  },
}

E-Mail-Eingabe mit Chip-Liste, Semikolon-Trennung und Validierung.

FeldRequiredTypDefaultBeschreibung
mail.labelNeinstring-Label des Mail-Feldes.
mail.initNeinstring-Initiale Mail-Liste, getrennt mit Semikolon.
mail.iotaVarJastring-IOTA-Attribut für die gespeicherte Semikolon-Liste.
{
  mail: {
    label: 'Benachrichtigungen an:',
    iotaVar: 'notification_emails',
    init: initVarGraf('${MAILS}', 0),
  },
}

Zusätzliche Buttons unter oder neben dem Input-Inhalt.

FeldRequiredTypDefaultBeschreibung
actionButtons[].labelJastring-Button-Text.
actionButtons[].typeIdJaAction typeId-Action aus der Action-Referenz.
layout.typeNein'splitActionButtons'-Teilt Inhalt und Buttons in zwei Spalten.
layout.actionButtonsPositionNein'left' | 'right'rightPosition der Buttons im Split-Layout.
var config = {
  typeId: 'block_inputs',
  layout: {
    type: 'splitActionButtons',
    actionButtonsPosition: 'right',
  },
  actionButtons: [
    {
      label: 'Relais setzen',
      typeId: 'saveCommand',
      config: { commandType: 'relay_set' },
    },
  ],
  typeConfig: {
    inputAttributes: [{ input: { label: 'Status', iotaVar: 'relay_state' } }],
  },
};

Eine Standardzeile mit beliebigen Input-, Select-, Checkbox- oder Display-Feldern.

Config-Pfad: typeConfig.inputAttributes

FeldRequiredTypDefaultBeschreibung
saveButtonNeinActionConfig-Globaler Speichern-Button unterhalb aller Felder.
typeConfig.inputAttributesJaArray<FieldConfig>-Felder in einer Zeile.
var config = {
  typeId: 'block_inputs',
  saveButton: { typeId: 'saveAttributes' },
  typeConfig: {
    inputAttributes: [
      { input: { label: 'Name', iotaVar: 'serial', init: initVarGraf('${EDITVARS}', 0) } },
      {
        input: {
          label: 'Installationsort',
          iotaVar: 'installation_place',
          init: initVarGraf('${EDITVARS}', 1),
        },
      },
      {
        input: { label: 'Kommentar', iotaVar: 'description', init: initVarGraf('${EDITVARS}', 2) },
      },
    ],
  },
};

Standard-Mail-Konfiguration mit optionaler Checkbox, zweiter Checkbox, dependentCheckbox und Sensor-Readonly-Wert.

Config-Pfad: typeConfig.mailConfig

FeldRequiredTypDefaultBeschreibung
typeConfig.mailConfig.mailJaMailConfig-Mail-Feld.
typeConfig.mailConfig.checkboxNeinCheckboxConfig-Hauptcheckbox.
typeConfig.mailConfig.checkbox2NeinCheckboxConfig-Zweite Hauptcheckbox.
typeConfig.mailConfig.dependentCheckboxNeinCheckboxConfig-Nur aktiv, wenn checkbox oder checkbox2 aktiv ist.
typeConfig.mailConfig.sensorThresholdNeinDisplayConfig-Readonly-Anzeige unterhalb der Mail-Konfiguration.
typeConfig.mailConfig.saveButtonNeinActionConfig-Speichern für die Mail-Zeile.
var config = {
  typeId: 'block_mail',
  typeConfig: {
    mailConfig: {
      mail: {
        label: 'Report E-Mails',
        iotaVar: 'report_emails',
        init: initVarGraf('${REPORT}', 1),
      },
      checkbox: {
        label: 'Reporting aktivieren',
        iotaVar: 'report_active',
        init: initVarGraf('${REPORT}', 0),
      },
      saveButton: { typeId: 'saveAttributes' },
    },
  },
};

Zwei Spalten: Attributzeilen und Mail-Konfiguration. Optional kann die Reihenfolge gedreht werden.

Config-Pfad: typeConfig

FeldRequiredTypDefaultBeschreibung
typeConfig.rowsJaArray<RowConfig>-Attributzeilen.
typeConfig.mailConfigJaMailConfig-Mail-Konfiguration.
typeConfig.reverseColsNeinbooleanfalseDreht die Spaltenreihenfolge.
var config = {
  typeId: 'block_mail_inputs',
  saveButton: { typeId: 'saveAttributes' },
  typeConfig: {
    rows: [
      {
        header: 'Temperatur',
        attributes: [
          { input: { label: 'Min', type: 'number', step: 0.5, iotaVar: 'temp_min' } },
          { input: { label: 'Max', type: 'number', step: 0.5, iotaVar: 'temp_max' } },
        ],
      },
    ],
    mailConfig: { mail: { label: 'Alarm Mails', iotaVar: 'alarm_mails' } },
    reverseCols: true,
  },
};

Spezialblock für Offline-Benachrichtigungen mit Mail-Liste, Checkbox und Offline-Zeit.

Config-Pfad: typeConfig.offline

FeldRequiredTypDefaultBeschreibung
typeConfig.offline.checkboxJaCheckboxConfig-Aktiviert Offline-Benachrichtigung.
typeConfig.offline.inputJaInputConfig-Offline-Zeit in Stunden; wird beim Speichern als Minutenwert geschrieben.
typeConfig.offline.mailJaMailConfig-Mail-Liste.
typeConfig.offline.saveButtonNeinActionConfig{ typeId: 'saveAttributes' }Speichern der Offline-Zeit.
typeConfig.reverseColsNeinbooleanfalseDreht Mail- und Offline-Spalte.
var config = {
  typeId: 'block_offline',
  typeConfig: {
    offline: {
      checkbox: { label: 'Offline Alarm aktiv', onchange: { typeId: 'offlineCheckbox' } },
      input: {
        label: 'Offline-Zeit [h]',
        iotaVar: 'offline_time',
        onchange: { typeId: 'offlineInput' },
      },
      mail: { iotaVar: 'offline_emails', init: initVarGraf('${OFFLINE}', 1) },
    },
  },
};

Eine horizontale Reihe aus Checkboxes mit optionalem Save-Button.

Config-Pfad: typeConfig.checkboxRow

FeldRequiredTypDefaultBeschreibung
typeConfig.checkboxRow.checkboxesJaArray<CheckboxConfig>-Checkboxes in der Reihe.
typeConfig.checkboxRow.saveButtonNeinActionConfig-Speicherbutton unterhalb der Reihe.
var config = {
  typeId: 'block_checkbox_row',
  typeConfig: {
    checkboxRow: {
      checkboxes: [
        { label: 'Eingang', iotaVar: 'io_in', init: initVarGraf('${IO}', 0) },
        { label: 'Ausgang', iotaVar: 'io_out', init: initVarGraf('${IO}', 1) },
      ],
      saveButton: { typeId: 'saveAttributes' },
    },
  },
};

Container für mehrere Custom Columns.

Config-Pfad: typeConfig.custom_columns

FeldRequiredTypDefaultBeschreibung
typeConfig.custom_columnsJaArray<CustomColumnConfig>-Liste von Custom Columns.
var config = {
  typeId: 'block_custom',
  typeConfig: {
    custom_columns: [
      {
        typeId: 'custom_column_inputs',
        typeConfig: {
          headers: ['unterer Alarm', 'oberer Alarm'],
          rows: [
            {
              title: 'Distanz [m]',
              inputs: [
                { iotaVar: 'alarm_low', type: 'number', step: 0.01 },
                { iotaVar: 'alarm_high', type: 'number', step: 0.01 },
              ],
            },
          ],
        },
      },
    ],
  },
};

Mail-Spalte innerhalb von block_custom.

Config-Pfad: typeConfig.mailConfig

FeldRequiredTypDefaultBeschreibung
typeConfig.mailConfigJaMailConfig-Mail-Konfiguration.
{
  typeId: 'custom_column_mail',
  typeConfig: {
    mailConfig: {
      mail: {
        label: 'Alarm Mails',
        iotaVar: 'alarm_mails',
        init: initVarGraf('${MAILS}', 0),
      },
      saveButton: { typeId: 'saveAttributes' },
    },
  },
}

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

FeldRequiredTypDefaultBeschreibung
typeConfig.headersJaArray<string>-Spaltenüberschriften.
typeConfig.rowsJaArray<{ title: string; inputs: InputConfig[] }>-Grid-Zeilen.
{
  typeId: 'custom_column_inputs',
  typeConfig: {
    headers: ['untere Warnung', 'obere Warnung'],
    rows: [
      {
        title: 'Temperatur [°C]',
        inputs: [
          { iotaVar: 'temp_warning_low', type: 'number', step: 0.5 },
          { iotaVar: 'temp_warning_high', type: 'number', step: 0.5 },
        ],
      },
    ],
  },
}

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

FeldRequiredTypDefaultBeschreibung
typeConfig.checkboxRow.checkboxesJaArray<CheckboxConfig>-Checkboxes.
{
  typeId: 'custom_column_checkbox_row',
  typeConfig: {
    checkboxRow: {
      checkboxes: [
        { label: 'Eingang', iotaVar: 'io_in' },
        { label: 'Ausgang', iotaVar: 'io_out' },
      ],
      saveButton: { typeId: 'saveAttributes' },
    },
  },
}

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

FeldRequiredTypDefaultBeschreibung
typeConfig.checkboxJaCheckboxConfig-Checkbox.
typeConfig.inputJaInputConfig-Input.
typeConfig.saveButtonNeinActionConfig-Optionaler Speicherbutton.
{
  typeId: 'custom_column_checkbox_input',
  typeConfig: {
    checkbox: {
      label: 'Grenzwert aktiv',
      iotaVar: 'threshold_active',
      init: initVarGraf('${THRESHOLD}', 0),
    },
    input: {
      label: 'Grenzwert',
      iotaVar: 'threshold_value',
      type: 'number',
      step: 0.5,
      init: initVarGraf('${THRESHOLD}', 1),
    },
    saveButton: { typeId: 'saveAttributes' },
  },
}