Ich nutze für meine Rules Blockly. Ein entscheidener Nachteil war, dass ich erstellte Prozeduren und Funktionen nur über Copy / Paste für andere Rules nutzen konnte.
Ich bin im Bereich Entwicklung/Block Libraries auf die Möglichkeit gestoßen, neue Blockly-Elemente selbst zu erstellen.
Das sind dann keine echten Funktionen/Prozeduren, sondern der Code wird wohl nur bei Nutzung des neuen Blockly-Elements injiziert, ist aber ein Lösungsansatz.
Über try / error und https://community.openhab.org/t/tutoria ... ies/130074 habe ich eine Konfiguration hinbekommen.
Fragen
- Wie erstellt ihr solche Block Libraries
- Wo gibt es hier eine Beschreibung der verwendbaren Elemente (z.B. warum erhalte ich über {{input:BLWERT}}) den Parameterwert
Code: Alles auswählen
uid: tomsBlockLibrary
tags: []
props:
parameters: []
parameterGroups: []
timestamp: Mar 16, 2026, 12:01:00 AM
component: BlockLibrary
config:
name: Toms Block Library
slots:
blocks:
- component: BlockType
config:
args0:
- type: input_value
name: BLWERT
align: right
- type: input_value
name: BLVON
align: right
- type: input_value
name: BLBIS
align: right
colour: 90
message0: CheckIntervall Wert %1 von inkl. %2 bis excl. %3
nextStatement: ""
previousStatement: ""
type: CheckIntervall
output: Boolean
tooltip: ""
helpUrl: https://community.openhab.org/t/tutorial-how-to-write-block-libraries/130074
slots:
code:
- component: BlockCodeTemplate
config:
template: >
({{input:BLWERT}} >= {{input:BLVON}} && {{input:BLWERT}} <
{{input:BLBIS}})