After you guys were seriously freaking out
when I released the X1/L1 scripting logic node, I dreamed about a same functionality for the Gira HomeServer.
Somewhere in a small town in the Netherlands, we spend weeks to make the unbelievable possible.
After designing a completely new packaging method for building blocks, which was need for this next step, we could finally turn that dream into reality.
It's probably the most revolutionary step for the KNX HomeServer in quite a while… SCRIPTING.
Pushing KNX automation further than originally planned.
Same idea: safe JavaScript-like scripting inside a logic block, so scripts stay clean, powerfull and now even exchangeable between projects with an X1/L1 !
Same philosophy.
Same power.
Bigger playground.
One block. Endless possibilities.
See all documentation and examples here: https://www.roelbroersma.nl/scripting/
Let’s see what kind of chaos you create with this one:
So for safe matters, there is a script-timeout integrated! It's no problem when doing stupid things, it just gives you a timeout after (default) 2 seconds.
Download latest version at: https://www.roelbroersma.nl/download...ock_latest.zip
How it works
Sending any value to the Trigger port (bool/number, even false or zero) will execute the script.
Output ports will always be set when the script is triggered. If the script doesn’t have a value for the output, it will set 0 to the numeric ports or "" to the text ports. If you want SBC (Send-By-Change), then connect a SBC block in line to the output.
will set the Output port when Input1=5. Otherwise it will set it to 0. It will do the same as below:
Trigger the block when it received something at INPUT1? Do it like this:
image.png
Special Considerations
It's very easy to test your scripts in Monitoring Mode! So when the Homeserver is running and you don't have to reboot it each time when you change your script:
In the Gira Logic Editor (when you are at the right worksheet), hit F5, that will open the monitoring pane on the right.
You can now right-click the Script input click: "Monitoring: Set input", see the screenshot below:
image.png
However, remember that the setting a value via the Monitoring input has a limitation of 78 characters!
image.png
image.png
This is ONLY IN MONITORING MODE, when you set the input to a fixed value, or get a input from another logic node, no problem. The Homeserver will accept it. I've seen guys who even fake it (see below) so you can continue to actively test scripts without restarting:
image.png
Some examples
NUMBERS
String manipulation (text)
LOGIC
JSON
Let's take the following sample JSON to explain:
You can even ask AI (ChatGPT, CoPilot or DeepSeek):
"Hello, can you generate JavaScript code for the Homeserver Building Block (see examples at https://www.roelbroersma.nl/scripting)?
I have 2 inputs and 1 output.
Release notes
v1.1 (20-feb-2026)
v1.0 Initial version (18-feb-2026)
when I released the X1/L1 scripting logic node, I dreamed about a same functionality for the Gira HomeServer.Somewhere in a small town in the Netherlands, we spend weeks to make the unbelievable possible.
After designing a completely new packaging method for building blocks, which was need for this next step, we could finally turn that dream into reality.
It's probably the most revolutionary step for the KNX HomeServer in quite a while… SCRIPTING.
Pushing KNX automation further than originally planned.
Same idea: safe JavaScript-like scripting inside a logic block, so scripts stay clean, powerfull and now even exchangeable between projects with an X1/L1 !
Same philosophy.
Same power.
Bigger playground.
One block. Endless possibilities.
See all documentation and examples here: https://www.roelbroersma.nl/scripting/
Let’s see what kind of chaos you create with this one:
PHP-Code:
for (i=1;i>0;i++) {let x=1;} // Endless loop
Download latest version at: https://www.roelbroersma.nl/download...ock_latest.zip
How it works
Sending any value to the Trigger port (bool/number, even false or zero) will execute the script.
Output ports will always be set when the script is triggered. If the script doesn’t have a value for the output, it will set 0 to the numeric ports or "" to the text ports. If you want SBC (Send-By-Change), then connect a SBC block in line to the output.
PHP-Code:
if (IN1=5) OUT1=1;
PHP-Code:
if (IN1=5) OUT1=1;else OUT1=0;
image.png
Special Considerations
It's very easy to test your scripts in Monitoring Mode! So when the Homeserver is running and you don't have to reboot it each time when you change your script:
In the Gira Logic Editor (when you are at the right worksheet), hit F5, that will open the monitoring pane on the right.
You can now right-click the Script input click: "Monitoring: Set input", see the screenshot below:
image.png
However, remember that the setting a value via the Monitoring input has a limitation of 78 characters!
image.png
image.png
This is ONLY IN MONITORING MODE, when you set the input to a fixed value, or get a input from another logic node, no problem. The Homeserver will accept it. I've seen guys who even fake it (see below) so you can continue to actively test scripts without restarting:
image.png
Some examples
NUMBERS
PHP-Code:
OUT1 = IN1 * 1.19; // Multiply with Mwst.
OUT1 = IN1 + IN2 + IN3 + (IN4+2) // Set Output sum.
OUT1 = IN1 + IN2; OUT2 = IN1 - IN2; // Set multiple outputs in one time
OUT1 = (IN1 / 255) * 100; // Devide and use ( and )
OUT1 = Math.round(IN1 * 100) / 100; // Math.round will always round on whole number, to have two decimals, device by 100.
OUT1 = Math.min(Math.max(IN1, 0), 100); // Limit the Input between 0 and 100
OUT1 = Math.abs(IN1); // Inverse: -5 -> 5
OUT1 = -IN1; // Also 5 -> -5
OUT1 = Math.pow(IN1, 2); // (power of 2): IN1²
OUT1 = Math.sqrt(IN1); // (taking the root): √IN1
String manipulation (text)
PHP-Code:
OUT11 = "Hello there!"; // Set a simple text to Output1
OUT11 = "Value is: " + IN1; // Set combined text+value. Example: "Value is: 10"
OUT11 = "My " + IN11 + " has " + IN1 + " homes"; // Concatenate Strings. Example: "My Son has 2 homes"
OUT11 = IN11.toString().substring(0, 5); // Take the first 5 characters (start at character 0)
OUT11 = IN11.toString().substring(0, 5); // Trim spaces
if (IN11.length > 10) OUT11 = IN11.substring(0, 10) + "..."; // Shorten text to 10 characters + "..."
else OUT11 = IN11;
OUT11 = IN11.toString().substring(0, 5); // Take the first 5 characters (start at character 0)
OUT11 = IN11.replace(/,/g,"."); // Replace all commas by dots.
OUT11 = IN11.slice(-3); // Remove last 3 characters
LOGIC
PHP-Code:
if (IN1=1) OUT1=1 // Use If to set output ONLY if IN1=1, otherwise it will be 0 (the default)
var temp = IN1; // Declare a variable and use it or
OUT1 = temp;
i=1;
OUT1 = this["IN"+1] // Computed variabe: OUT1=IN1
if (IN1 >= 50) OUT1 = 1; // Use if else
else OUT1 = 0;
if (IN1==1) OUT1 = 1; // Use if, elseif, else
else if (IN2==1) OUT1 = 2;
else if (IN3==1) OUT1 = 3;
else OUT1 = 0;
if (OUT1==1 && IN2==0) OUT2 = 123; // Read the value of OUT1
switch(IN1) { // Switch Logic (easier than if/elseif/else)
case 0: OUT1 = "OFF"; break;
case 1: OUT1 = "AUTO"; break;
case 2: OUT1 = "MANUAL"; break;
default: OUT1 = "UNKNOWN";
}
for (var i = 1; i <= 5; i++) { // A FOR Loop
if (this["IN" + i] == true) { // The computed variable IN1...IN5
OUT1 = i;
break;
}
}
JSON
Let's take the following sample JSON to explain:
PHP-Code:
{
"device": {
"name": "LivingRoomController",
"status": "online",
"metrics": {
"temperature": 21.6,
"humidity": 48,
"power": 312.4
},
"modes": [
{ "id": 1, "name": "Auto", "active": true },
{ "id": 2, "name": "Eco", "active": false },
{ "id": 3, "name": "Boost", "active": false }
]
}
}
PHP-Code:
var obj = JSON.parse(IN11); // Read Input11 as JSON
OUT11 = obj.device.name; // "LivingRoomController"
OUT12 = obj.device.metrics.temperature; // 21.6
OUT13 = obj.device.modes[0].name; // "Auto"
OUT14 = obj.device.modes[2].active; // false
OUT15 = obj.device.modes.length; // 3
OUT16 = obj.device.status + " / " + obj.device.metrics.power + "W";
You can even ask AI (ChatGPT, CoPilot or DeepSeek):
"Hello, can you generate JavaScript code for the Homeserver Building Block (see examples at https://www.roelbroersma.nl/scripting)?
I have 2 inputs and 1 output.
- IN11 = weather information as text
- IN1 = expected afternoon temperature (number)
- Output format: Temp: XX°C - DESCRIPTION
- DESCRIPTION must be truncated to 20 characters and end with .. if longer
- Use only plain JavaScript
- Assign the result to OUT11
- Number Inputs IN1-IN10 and Outputs: OUT1-OUT10
- Text Inputs IN11-IN20 and Outputs: OUT11-OUT20"
Release notes
v1.1 (20-feb-2026)
- Small timing/caching fix with uuid
v1.0 Initial version (18-feb-2026)
- Includes a Timeout setting.
- See the execution time of scripts.
- Use JSON, functions, string manipulations, math logic like if/else and more..
- Automatich update check (only check, no update).
- Multi-threaded environment, does not block execution of others..


Kommentar